Import Cobalt 21.lts.1.278101
diff --git a/src/base/message_loop/message_loop.cc b/src/base/message_loop/message_loop.cc
index 33fc553..11b4a69 100644
--- a/src/base/message_loop/message_loop.cc
+++ b/src/base/message_loop/message_loop.cc
@@ -24,6 +24,7 @@
 #include "base/threading/thread_id_name_manager.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/trace_event/trace_event.h"
+#include "nb/memory_scope.h"
 
 namespace base {
 
@@ -404,6 +405,7 @@
 }
 
 void MessageLoop::SetThreadTaskRunnerHandle() {
+  TRACK_MEMORY_SCOPE("MessageLoop");
   DCHECK_CALLED_ON_VALID_THREAD(bound_thread_checker_);
   // Clear the previous thread task runner first, because only one can exist at
   // a time.
@@ -529,6 +531,7 @@
 }
 
 bool MessageLoop::DoDelayedWork(TimeTicks* next_delayed_work_time) {
+  TRACK_MEMORY_SCOPE("MessageLoop");
   if (!task_execution_allowed_ ||
       !pending_task_queue_.delayed_tasks().HasTasks()) {
     *next_delayed_work_time = TimeTicks();
diff --git a/src/base/run_loop.cc b/src/base/run_loop.cc
index d4d87d7..29deb1d 100644
--- a/src/base/run_loop.cc
+++ b/src/base/run_loop.cc
@@ -12,6 +12,7 @@
 #include "base/threading/thread_local.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "build/build_config.h"
+#include "nb/memory_scope.h"
 
 namespace base {
 
@@ -255,6 +256,7 @@
 #endif  // DCHECK_IS_ON()
 
 bool RunLoop::BeforeRun() {
+  TRACK_MEMORY_SCOPE("MessageLoop");
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
 
 #if DCHECK_IS_ON()
diff --git a/src/cobalt/base/application_event.h b/src/cobalt/base/application_event.h
deleted file mode 100644
index 44b0c9d..0000000
--- a/src/cobalt/base/application_event.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2015 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef COBALT_BASE_APPLICATION_EVENT_H_
-#define COBALT_BASE_APPLICATION_EVENT_H_
-
-#include "cobalt/base/event.h"
-#include "starboard/event.h"
-
-namespace base {
-
-class ApplicationEvent : public base::Event {
- public:
-  explicit ApplicationEvent(SbEventType type) : type_(type) {}
-  SbEventType type() const { return type_; }
-
-  BASE_EVENT_SUBCLASS(ApplicationEvent);
-
- private:
-  SbEventType type_;
-};
-
-}  // namespace base
-
-#endif  // COBALT_BASE_APPLICATION_EVENT_H_
diff --git a/src/cobalt/base/deep_link_event.h b/src/cobalt/base/deep_link_event.h
index 763725c..c2d3aaf 100644
--- a/src/cobalt/base/deep_link_event.h
+++ b/src/cobalt/base/deep_link_event.h
@@ -17,6 +17,7 @@
 
 #include <string>
 
+#include "base/callback.h"
 #include "base/compiler_specific.h"
 #include "base/strings/string_util.h"
 #include "cobalt/base/event.h"
@@ -25,13 +26,16 @@
 
 class DeepLinkEvent : public Event {
  public:
-  explicit DeepLinkEvent(const std::string& link) : link_(link) {}
+  DeepLinkEvent(const std::string& link, const base::Closure& consumed_callback)
+      : link_(link), consumed_callback_(consumed_callback) {}
   const std::string& link() const { return link_; }
+  const base::Closure& callback() const { return consumed_callback_; }
 
   BASE_EVENT_SUBCLASS(DeepLinkEvent);
 
  private:
   std::string link_;
+  base::Closure consumed_callback_;
 };
 
 }  // namespace base
diff --git a/src/cobalt/black_box_tests/black_box_tests.py b/src/cobalt/black_box_tests/black_box_tests.py
index bc72938..220c342 100644
--- a/src/cobalt/black_box_tests/black_box_tests.py
+++ b/src/cobalt/black_box_tests/black_box_tests.py
@@ -46,9 +46,7 @@
 # resume signals.
 _TESTS_NEEDING_SYSTEM_SIGNAL = [
     'cancel_sync_loads_when_suspended',
-    # TODO: Re-enable once mouseenter, mouseleave, and moveto webdriver
-    #       functionality is available.
-    #   'pointer_test',
+    'pointer_test',
     'preload_font',
     'preload_visibility',
     'preload_launch_parameter',
@@ -68,7 +66,7 @@
 # These tests can only be run on platforms whose app launcher can send deep
 # links.
 _TESTS_NEEDING_DEEP_LINK = [
-    'fire_deep_link_before_load',
+    'deep_links',
 ]
 # Location of test files.
 _TEST_DIR_PATH = 'cobalt.black_box_tests.tests.'
@@ -92,12 +90,12 @@
   @classmethod
   def setUpClass(cls):
     super(BlackBoxTestCase, cls).setUpClass()
-    print('Running ' + cls.__name__)
+    logging.info('Running ' + cls.__name__)
 
   @classmethod
   def tearDownClass(cls):
     super(BlackBoxTestCase, cls).tearDownClass()
-    print('Done ' + cls.__name__)
+    logging.info('Done ' + cls.__name__)
 
   def CreateCobaltRunner(self, url, target_params=None):
     all_target_params = list(target_params) if target_params else []
@@ -154,8 +152,6 @@
                test_name=None,
                wpt_http_port=None,
                device_ips=None):
-    logging.basicConfig(level=logging.DEBUG)
-
     # Setup global variables used by test cases.
     global _launcher_params
     _launcher_params = command_line.CreateLauncherParams()
@@ -262,6 +258,7 @@
 
 def main():
   parser = argparse.ArgumentParser()
+  parser.add_argument('-v', '--verbose', required=False, action='store_true')
   parser.add_argument(
       '--server_binding_address',
       default='127.0.0.1',
@@ -297,6 +294,14 @@
             'specified, all IPs will be allowed to connect.'))
   args, _ = parser.parse_known_args()
 
+  # This format matches Cobalt's console log format.
+  logging_format = ('[%(process)d:%(asctime)s.%(msecs)03d...:'
+                    '%(levelname)s:%(filename)s(%(lineno)s)] %(message)s')
+  logging.basicConfig(
+      level=logging.INFO, format=logging_format, datefmt='%m%d/%H%M%S')
+  if args.verbose:
+    logging.getLogger().setLevel(logging.DEBUG)
+
   test_object = BlackBoxTests(args.server_binding_address, args.proxy_address,
                               args.proxy_port, args.test_name,
                               args.wpt_http_port, args.device_ips)
diff --git a/src/cobalt/black_box_tests/proxy_server.py b/src/cobalt/black_box_tests/proxy_server.py
index 5b51830..ddf9a5f 100644
--- a/src/cobalt/black_box_tests/proxy_server.py
+++ b/src/cobalt/black_box_tests/proxy_server.py
@@ -32,13 +32,15 @@
 
 class ProxyServer(object):
 
-  def __init__(self, hostname='0.0.0.0', port='8000', host_resolve_map=None,
+  def __init__(self,
+               hostname='0.0.0.0',
+               port='8000',
+               host_resolve_map=None,
                client_ips=None):
     self.command = [
         'python',
         os.path.join(SRC_DIR, 'third_party', 'proxy_py', 'proxy.py'),
-        '--hostname', hostname,
-        '--port', port
+        '--hostname', hostname, '--port', port, '--log-level', 'WARNING'
     ]
     self.host_resolver_path = None
 
diff --git a/src/cobalt/black_box_tests/testdata/deep_links.html b/src/cobalt/black_box_tests/testdata/deep_links.html
new file mode 100644
index 0000000..ea23fd8
--- /dev/null
+++ b/src/cobalt/black_box_tests/testdata/deep_links.html
@@ -0,0 +1,8 @@
+<HTML>
+  <HEAD></HEAD>
+  <BODY>
+    <!-- async required for Android, which needs to suspend to send the deeplink -->
+    <script async src='black_box_js_test_utils.js'></script>
+    <script async src='deep_links.js'></script>
+  </BODY>
+</HTML>
diff --git a/src/cobalt/black_box_tests/testdata/deep_links.js b/src/cobalt/black_box_tests/testdata/deep_links.js
new file mode 100644
index 0000000..34dfaa1
--- /dev/null
+++ b/src/cobalt/black_box_tests/testdata/deep_links.js
@@ -0,0 +1,125 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Fail if the deep link is not received within 15 seconds.
+var kTimeout = 15 * 1000;
+var failTimer = setTimeout(fail, kTimeout);
+var linksReceived = 0;
+var kNavigateDelayed = "navigate_delayed"
+var kNavigateImmediate = "navigate_immediate"
+var kNavigated = "navigated"
+var kConsume = "consume"
+var kConsumed = "consumed"
+var deepLinkExpected = true;
+var navigationExpected = false;
+
+function fail() {
+  console.log("Failing due to timeout!");
+  assertTrue(false);
+}
+
+// The test sends "link 1", "link 2", "link 3" before load & so only "link 3"
+// should be handled.
+function listener(link) {
+  linksReceived += 1;
+
+  // Since the test harness is loaded async for this test, its functions may
+  // not yet exist when the listener is called. Add a delay before using
+  // the harness functions.
+  window.checkTimer = setTimeout(function () {
+    // At most one deep link is expected.
+    assertEqual(1, linksReceived);
+
+    assertTrue(deepLinkExpected);
+    assertEqual("link 3", link);
+    clearTimeout(window.checkTimer);
+    if (!navigationExpected) {
+      console.log("Ending test.");
+      onEndTest();
+    }
+    clearTimeout(failTimer);
+  }, 250);
+  console.log("Received link: " + link.toString());
+}
+
+window.onload = function () {
+  console.log("Window loads after " + linksReceived + " deep links.");
+  setupFinished();
+
+  if (!params.has('delayedlink')) {
+    // Test that undelayed links are received before the onload handler.
+    assertEqual(deepLinkExpected ? 1 : 0, linksReceived);
+  }
+
+  if (!deepLinkExpected) {
+    // Add a delay before ending the test to ensure that events are not
+    // received right after onload.
+    setTimeout(function () {
+      console.log("Ending test.");
+      onEndTest();
+      clearTimeout(failTimer);
+    }, 1500);
+  }
+}
+
+const params = new Map(
+  window.location.search.slice(1).split('&').map(kv => kv.split('=')))
+
+// A link expected if we got 'consume' and did not get 'consumed'.
+deepLinkExpected = params.has(kConsume) && !params.has(kConsumed);
+
+// Navigate if we got 'navigate' and did not get 'navigated'.
+if (!params.has(kNavigated)) {
+  var newLocation = window.location.href + '&' + kNavigated;
+
+  if (!params.has(kConsume)) {
+    // Add a 'consume' when we navigate.
+    newLocation += "&" + kConsume
+  } else if (!params.has(kConsumed)) {
+    // Add a 'consumed' if we have consumed the deep link.
+    newLocation += "&" + kConsumed
+  }
+
+  if (params.has(kNavigateDelayed)) {
+    console.log("Navigating page after a delay.");
+    navigationExpected = true;
+
+    setTimeout(function () {
+      console.log("Navigating now.");
+      window.location.href = newLocation;
+    }, 500);
+  } else if (params.has(kNavigateImmediate)) {
+    console.log("Navigating page immediately.");
+    navigationExpected = true;
+    window.location.href = newLocation;
+  }
+}
+
+// Consume the deep link if we got 'consume'.
+if (params.has(kConsume)) {
+  // If the query string has this value, read the initialDeepLink instead of
+  // waiting for onDeepList calls.
+  if (params.has("initial")) {
+    console.log("Accessing initialDeepLink.");
+    var link = h5vcc.runtime.initialDeepLink;
+    if (link != "") {
+      listener(link);
+    }
+  }
+
+  console.log("Adding onDeepLink listener.");
+  h5vcc.runtime.onDeepLink.addListener(listener);
+} else {
+  console.log("Not consuming deep link.");
+}
diff --git a/src/cobalt/black_box_tests/testdata/fire_deep_link_before_load.html b/src/cobalt/black_box_tests/testdata/fire_deep_link_before_load.html
deleted file mode 100644
index 3292d7e..0000000
--- a/src/cobalt/black_box_tests/testdata/fire_deep_link_before_load.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<HTML>
-  <HEAD></HEAD>
-  <BODY>
-    <!-- async required for Android, which needs to suspend to send the deeplink -->
-    <script async src='black_box_js_test_utils.js'></script>
-    <script async src='fire_deep_link_before_load.js'></script>
-  </BODY>
-</HTML>
diff --git a/src/cobalt/black_box_tests/testdata/fire_deep_link_before_load.js b/src/cobalt/black_box_tests/testdata/fire_deep_link_before_load.js
deleted file mode 100644
index cc2128c..0000000
--- a/src/cobalt/black_box_tests/testdata/fire_deep_link_before_load.js
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2019 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Fail if the deep link is not received within 15 seconds.
-var kTimeout = 15 * 1000;
-var failTimer = setTimeout(fail, kTimeout);
-
-function fail() {
-    console.log("Failing due to timeout!");
-    assertTrue(false);
-}
-
-// The test sends "link 1", "link 2", "link 3" before load & so only "link 3"
-// should be handled.
-function listener(link) {
-    console.log("Received link: " + link.toString());
-    assertEqual("link 3", link);
-    console.log("Ending test");
-    onEndTest();
-    clearTimeout(failTimer);
-}
-
-h5vcc.runtime.onDeepLink.addListener(listener);
-console.log("Listener added");
\ No newline at end of file
diff --git a/src/cobalt/black_box_tests/tests/cancel_sync_loads_when_suspended.py b/src/cobalt/black_box_tests/tests/cancel_sync_loads_when_suspended.py
index dfb3927..def8cba 100644
--- a/src/cobalt/black_box_tests/tests/cancel_sync_loads_when_suspended.py
+++ b/src/cobalt/black_box_tests/tests/cancel_sync_loads_when_suspended.py
@@ -38,6 +38,7 @@
 
 import _env  # pylint: disable=unused-import,g-bad-import-order
 
+import logging
 import os
 import SimpleHTTPServer
 import threading
@@ -69,9 +70,9 @@
     if parsed_path.path == '/testdata/' + _CANCEL_SYNC_LOADS_WHEN_SUSPENDED_JS:
       _received_script_resource_request.set()
       # It is important not to send any response back, so we block.
-      print('Waiting on test to finish.')
+      logging.info('Waiting on test to finish.')
       _test_finished.wait()
-      print('Test is finished.')
+      logging.info('Test is finished.')
       return
 
     return SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
@@ -105,19 +106,19 @@
           cobalt_launcher_thread.start()
 
           # Step 3. Wait HTTP request for html resource.
-          print('Waiting for script resource request')
+          logging.info('Waiting for script resource request')
           request_received = _received_script_resource_request.wait(
               _MAX_ALLOTTED_TIME_SECONDS)
-          print('Request received: {}'.format(request_received))
+          logging.info('Request received: {}'.format(request_received))
           # Step 5. Wait for a request for javascript resource.
           self.assertTrue(request_received)
 
           # Step 6. Suspend Cobalt process.
-          print('Suspending Cobalt.')
+          logging.info('Suspending Cobalt.')
           runner.SendSuspend()
           # Step 7. Cobalt disconnects from the socket.
           # Step 8. Resume Cobalt process, which enables the JS test to pass.
-          print('Resuming Cobalt.')
+          logging.info('Resuming Cobalt.')
           runner.SendResume()
 
           # Step 9. Check to see if JSTestsSucceeded().
@@ -129,5 +130,5 @@
       # Consider an exception being thrown as a test failure.
       self.assertTrue(False)
     finally:
-      print('Cleaning up.')
+      logging.info('Cleaning up.')
       _test_finished.set()
diff --git a/src/cobalt/black_box_tests/tests/deep_links.py b/src/cobalt/black_box_tests/tests/deep_links.py
new file mode 100644
index 0000000..5e4ee00
--- /dev/null
+++ b/src/cobalt/black_box_tests/tests/deep_links.py
@@ -0,0 +1,292 @@
+# Copyright 2020 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests sending deep links."""
+
+# This test script works by splitting the work over 3 threads, so that they
+# can each make progress even if they come across blocking operations.
+# The three threads are:
+#   1. Main thread, runs BlackBoxTestCase, sends suspend/resume signals, etc.
+#   2. HTTP Server, responsible for slowly responding to a fetch of a javascript
+#      file.
+#   3. Webdriver thread, instructs Cobalt to navigate to a URL
+#
+# Steps in ~ chronological order:
+#   1. Create a TCP socket and listen on all interfaces.
+#   2. Start Cobalt, and point it to the socket created in Step 1.
+#   3. Send 3 deep links.
+#   4. Load & run the javascript resource.
+#   5. Check to see if JSTestsSucceeded(), receiving only the last deep link.
+
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+
+import _env  # pylint: disable=unused-import,g-bad-import-order
+
+import inspect
+import logging
+import os
+import threading
+import time
+import traceback
+
+from cobalt.black_box_tests import black_box_tests
+from cobalt.black_box_tests.threaded_web_server import MakeRequestHandlerClass
+from cobalt.black_box_tests.threaded_web_server import ThreadedWebServer
+
+import SimpleHTTPServer
+import urlparse
+
+_DEEP_LINKS_HTML = 'deep_links.html'
+_DEEP_LINKS_JS = 'deep_links.js'
+_MAX_ALLOTTED_TIME_SECONDS = 60
+
+_script_loading_signal = threading.Event()
+
+# The base path of the requested assets is the parent directory.
+_SERVER_ROOT_PATH = os.path.join(os.path.dirname(__file__), os.pardir)
+
+
+class JavascriptRequestDetector(MakeRequestHandlerClass(_SERVER_ROOT_PATH)):
+  """Proxies everything to SimpleHTTPRequestHandler, except some paths."""
+
+  def do_GET(self):  # pylint: disable=invalid-name
+    """Handles HTTP GET requests for resources."""
+
+    parsed_path = urlparse.urlparse(self.path)
+    if parsed_path.path == '/testdata/' + _DEEP_LINKS_JS:
+      # It is important not to send any response back, so we block.
+      logging.info('Waiting on links to be fired.')
+      _script_loading_signal.wait()
+      # Sending deep links is not instant on all platforms.
+      # Wait some time to ensure the links are all actually received.
+      logging.info('Links have been fired. Waiting...')
+      time.sleep(1)
+      logging.info('Done Waiting. Getting JS.')
+
+    return SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
+
+
+class DeepLink(black_box_tests.BlackBoxTestCase):
+  """Tests firing deep links before web module is loaded."""
+
+  def _LoadPage(self, webdriver, url):
+    """Instructs webdriver to navigate to url."""
+    try:
+      # Note: The following is a blocking request, and returns only when the
+      # page has fully loaded.  In this test, the page will not fully load
+      # so, this does not return until Cobalt exits.
+      webdriver.get(url)
+    except:  # pylint: disable=bare-except
+      traceback.print_exc()
+
+  def _SendLink(self, query_parameter=''):
+    """Test sending links into Cobalt after it's started."""
+
+    logging.info('[ RUN ] ' + inspect.stack()[1][3] + ' ' + query_parameter)
+    # Step 2. Start Cobalt, and point it to the socket created in Step 1.
+    try:
+      with ThreadedWebServer(JavascriptRequestDetector,
+                             self.GetBindingAddress()) as server:
+        with self.CreateCobaltRunner(url='about:blank') as runner:
+          target_url = server.GetURL(file_name='../testdata/' +
+                                     _DEEP_LINKS_HTML)
+          if query_parameter != '':
+            target_url += '?' + query_parameter
+          cobalt_launcher_thread = threading.Thread(
+              target=DeepLink._LoadPage,
+              args=(self, runner.webdriver, target_url))
+          cobalt_launcher_thread.start()
+
+          # Step 3. Send 3 deep links
+          for i in range(1, 4):
+            link = 'link ' + str(i)
+            logging.info('Sending link : ' + link)
+            self.assertTrue(runner.SendDeepLink(link))
+          logging.info('Links fired.')
+          # Step 4. Load & run the javascript resource.
+          _script_loading_signal.set()
+
+          # Step 5. Check to see if JSTestsSucceeded().
+          # Note that this call will check the DOM multiple times for a period
+          # of time (current default is 30 seconds).
+          success = runner.JSTestsSucceeded()
+          if success:
+            logging.info('[ OK ] ' + inspect.stack()[1][3])
+          else:
+            logging.info('[ FAILED ] ' + inspect.stack()[1][3])
+          self.assertTrue(success)
+    except:  # pylint: disable=bare-except
+      traceback.print_exc()
+      # Consider an exception being thrown as a test failure.
+      self.assertTrue(False)
+    finally:
+      logging.info('Cleaning up.')
+      _script_loading_signal.set()
+
+  def _StartLink(self, query_parameter=''):
+    """Test the initial link provided when starting Cobalt."""
+
+    logging.info('[ RUN ] ' + inspect.stack()[1][3] + ' ' + query_parameter)
+    with ThreadedWebServer(binding_address=self.GetBindingAddress()) as server:
+      url = server.GetURL(file_name='testdata/' + _DEEP_LINKS_HTML)
+      if query_parameter != '':
+        url += '?' + query_parameter
+      initial_deep_link = 'link 3'  # Expected by our test JS
+
+      with self.CreateCobaltRunner(
+          url=url, target_params=['--link=' + initial_deep_link]) as runner:
+        success = runner.JSTestsSucceeded()
+        if success:
+          logging.info('[ OK ] ' + inspect.stack()[1][3])
+        else:
+          logging.info('[ FAILED ] ' + inspect.stack()[1][3])
+        self.assertTrue(success)
+
+  def _DelayedLink(self, query_parameter=''):
+    """Test sending links into Cobalt after it's started."""
+
+    logging.info('[ RUN ] ' + inspect.stack()[1][3] + ' ' + query_parameter)
+    # Step 2. Start Cobalt, and point it to the socket created in Step 1.
+    try:
+      with ThreadedWebServer(JavascriptRequestDetector,
+                             self.GetBindingAddress()) as server:
+        with self.CreateCobaltRunner(url='about:blank') as runner:
+          target_url = server.GetURL(file_name='../testdata/' +
+                                     _DEEP_LINKS_HTML)
+          if query_parameter != '':
+            target_url += '?' + query_parameter
+          cobalt_launcher_thread = threading.Thread(
+              target=DeepLink._LoadPage,
+              args=(self, runner.webdriver, target_url))
+          cobalt_launcher_thread.start()
+
+          # Step 3. Load & run the javascript resource.
+          _script_loading_signal.set()
+
+          # Step 4. Wait before sending the link.
+          runner.WaitForJSTestsSetup()
+
+          # Step 5. Send deep link
+          link = 'link 3'  # Expected by our test JS
+          logging.info('Sending link : ' + link)
+          self.assertTrue(runner.SendDeepLink(link))
+          logging.info('Links fired.')
+
+          # Step 6. Check to see if JSTestsSucceeded().
+          # Note that this call will check the DOM multiple times for a period
+          # of time (current default is 30 seconds).
+          success = runner.JSTestsSucceeded()
+          if success:
+            logging.info('[ OK ] ' + inspect.stack()[1][3])
+          else:
+            logging.info('[ FAILED ] ' + inspect.stack()[1][3])
+          self.assertTrue(success)
+    except:  # pylint: disable=bare-except
+      traceback.print_exc()
+      # Consider an exception being thrown as a test failure.
+      self.assertTrue(False)
+    finally:
+      logging.info('Cleaning up.')
+      _script_loading_signal.set()
+
+  def test_delayed_link_unconsumed(self):
+    """Test that a deep link does not have to be consumed."""
+    return self._DelayedLink('consumed&delayedlink')
+
+  def test_delayed_link_and_consume(self):
+    """Test that a deep link is received."""
+    return self._DelayedLink('consume&delayedlink')
+
+  def test_send_link_unconsumed(self):
+    """Test that the link does not have to be consumed."""
+    return self._SendLink()
+
+  def test_send_link_and_consume(self):
+    """Test that the last link is received."""
+    return self._SendLink('consume')
+
+  def test_send_link_and_consume_with_initial_deep_link(self):
+    """Test that the link is visible in initialDeepLink."""
+    return self._SendLink('consume&initial')
+
+  def test_send_link_and_navigate_and_consume(self):
+    """Test that the link is received after navigating."""
+    return self._SendLink('navigate_immediate')
+
+  def test_send_link_and_navigate_with_delay_and_consume(self):
+    """Test that the link is received after navigating with a delay."""
+    return self._SendLink('navigate_delayed')
+
+  def test_send_link_and_navigate_and_consume_with_initial_deep_link(self):
+    """Test that the link is received in initialDeepLink after navigating."""
+    return self._SendLink('navigate_immediate&initial')
+
+  def test_send_link_and_navigate_with_delay_and_consume_with_initial_deep_link(
+      self):
+    """Test that the link is received in initialDeepLink after navigating with a delay."""
+    return self._SendLink('navigate_delayed&initial')
+
+  def test_send_link_and_consume_and_navigate(self):
+    """Test that a consumed link is not received again after navigating."""
+    return self._SendLink('consume&navigate_immediate')
+
+  def test_send_link_and_consume_and_navigate_with_delay(self):
+    """Test that a consumed link is not received again after navigating with a delay."""
+    return self._SendLink('consume&navigate_delayed')
+
+  def test_send_link_and_consume_with_initial_deep_link_and_navigate(self):
+    """Test that a link consumed with initialDeepLink is not received again after navigating."""
+    return self._SendLink('consume&initial&navigate_immediate')
+
+  def test_start_link_unconsumed(self):
+    """Test that the link does not have to be consumed."""
+    return self._StartLink()
+
+  def test_start_link_and_consume(self):
+    """Test that the last link is received."""
+    return self._StartLink('consume')
+
+  def test_start_link_and_consume_with_initial_deep_link(self):
+    """Test that the link is visible in initialDeepLink."""
+    return self._StartLink('consume&initial')
+
+  def test_start_link_and_navigate_and_consume(self):
+    """Test that the link is received after navigating."""
+    return self._StartLink('navigate_immediate')
+
+  def test_start_link_and_navigate_with_delay_and_consume(self):
+    """Test that the link is received after navigating with a delay."""
+    return self._StartLink('navigate_delayed')
+
+  def test_start_link_and_navigate_and_consume_with_initial_deep_link(self):
+    """Test that the link is received in initialDeepLink after navigating."""
+    return self._StartLink('navigate_immediate&initial')
+
+  def test_start_link_and_navigate_with_delay_and_consume_with_initial_deep_link(
+      self):
+    """Test that the link is received in initialDeepLink after navigating with a delay."""
+    return self._StartLink('navigate_delayed&initial')
+
+  def test_start_link_and_consume_and_navigate(self):
+    """Test that a consumed link is not received again after navigating."""
+    return self._StartLink('consume&navigate_immediate')
+
+  def test_start_link_and_consume_and_navigate_with_delay(self):
+    """Test that a consumed link is not received again after navigating with a delay."""
+    return self._StartLink('consume&navigate_delayed')
+
+  def test_start_link_and_consume_with_initial_deep_link_and_navigate(self):
+    """Test that a link consumed with initialDeepLink is not received again after navigating."""
+    return self._StartLink('consume&initial&navigate_immediate')
diff --git a/src/cobalt/black_box_tests/tests/fire_deep_link_before_load.py b/src/cobalt/black_box_tests/tests/fire_deep_link_before_load.py
deleted file mode 100644
index bce2852..0000000
--- a/src/cobalt/black_box_tests/tests/fire_deep_link_before_load.py
+++ /dev/null
@@ -1,133 +0,0 @@
-# Copyright 2019 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests sending deep links before load."""
-
-# This test script works by splitting the work over 3 threads, so that they
-# can each make progress even if they come across blocking operations.
-# The three threads are:
-#   1. Main thread, runs BlackBoxTestCase, sends suspend/resume signals, etc.
-#   2. HTTP Server, responsible for slowly responding to a fetch of a javascript
-#      file.
-#   3. Webdriver thread, instructs Cobalt to navigate to a URL
-#
-# Steps in ~ chronological order:
-#   1. Create a TCP socket and listen on all interfaces.
-#   2. Start Cobalt, and point it to the socket created in Step 1.
-#   3. Send 3 deep links.
-#   4. Load & run the javascript resource.
-#   5. Check to see if JSTestsSucceeded(), receiving only the last deep link.
-
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-
-import _env  # pylint: disable=unused-import,g-bad-import-order
-
-import os
-import threading
-import traceback
-
-from cobalt.black_box_tests import black_box_tests
-from cobalt.black_box_tests.threaded_web_server import MakeRequestHandlerClass
-from cobalt.black_box_tests.threaded_web_server import ThreadedWebServer
-
-import SimpleHTTPServer
-import urlparse
-
-_FIRE_DEEP_LINK_BEFORE_LOAD_HTML = 'fire_deep_link_before_load.html'
-_FIRE_DEEP_LINK_BEFORE_LOAD_JS = 'fire_deep_link_before_load.js'
-_MAX_ALLOTTED_TIME_SECONDS = 60
-
-_links_fired = threading.Event()
-
-# The base path of the requested assets is the parent directory.
-_SERVER_ROOT_PATH = os.path.join(os.path.dirname(__file__), os.pardir)
-
-
-class JavascriptRequestDetector(MakeRequestHandlerClass(_SERVER_ROOT_PATH)):
-  """Proxies everything to SimpleHTTPRequestHandler, except some paths."""
-
-  def do_GET(self):  # pylint: disable=invalid-name
-    """Handles HTTP GET requests for resources."""
-
-    parsed_path = urlparse.urlparse(self.path)
-    if parsed_path.path == '/testdata/' + _FIRE_DEEP_LINK_BEFORE_LOAD_JS:
-      # It is important not to send any response back, so we block.
-      print('Waiting on links to be fired.')
-      _links_fired.wait()
-      print('Links have been fired. Getting JS.')
-
-    return SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
-
-
-class FireDeepLinkBeforeLoad(black_box_tests.BlackBoxTestCase):
-  """Tests firing deep links before web module is loaded."""
-
-  def _LoadPage(self, webdriver, url):
-    """Instructs webdriver to navigate to url."""
-    try:
-      # Note: The following is a blocking request, and returns only when the
-      # page has fully loaded.  In this test, the page will not fully load
-      # so, this does not return until Cobalt exits.
-      webdriver.get(url)
-    except:  # pylint: disable=bare-except
-      traceback.print_exc()
-
-  def test_send_link(self):
-    """Test sending links into Cobalt after it's started."""
-
-    # Step 2. Start Cobalt, and point it to the socket created in Step 1.
-    try:
-      with ThreadedWebServer(JavascriptRequestDetector,
-                             self.GetBindingAddress()) as server:
-        with self.CreateCobaltRunner(url='about:blank') as runner:
-          target_url = server.GetURL(file_name='../testdata/' +
-                                     _FIRE_DEEP_LINK_BEFORE_LOAD_HTML)
-          cobalt_launcher_thread = threading.Thread(
-              target=FireDeepLinkBeforeLoad._LoadPage,
-              args=(self, runner.webdriver, target_url))
-          cobalt_launcher_thread.start()
-
-          # Step 3. Send 3 deep links
-          for i in range(1, 4):
-            link = 'link ' + str(i)
-            print('Sending link : ' + link)
-            self.assertTrue(runner.SendDeepLink(link))
-          print('Links fired.')
-          # Step 4. Load & run the javascript resource.
-          _links_fired.set()
-
-          # Step 5. Check to see if JSTestsSucceeded().
-          # Note that this call will check the DOM multiple times for a period
-          # of time (current default is 30 seconds).
-          self.assertTrue(runner.JSTestsSucceeded())
-    except:  # pylint: disable=bare-except
-      traceback.print_exc()
-      # Consider an exception being thrown as a test failure.
-      self.assertTrue(False)
-    finally:
-      print('Cleaning up.')
-      _links_fired.set()
-
-  def test_start_link(self):
-    """Test the initial link provided when starting Cobalt."""
-
-    with ThreadedWebServer(binding_address=self.GetBindingAddress()) as server:
-      url = server.GetURL(file_name='testdata/' +
-                          _FIRE_DEEP_LINK_BEFORE_LOAD_HTML)
-      initial_deep_link = 'link 3'  # Expected by our test JS
-
-      with self.CreateCobaltRunner(
-          url=url, target_params=['--link=' + initial_deep_link]) as runner:
-        self.assertTrue(runner.JSTestsSucceeded())
diff --git a/src/cobalt/black_box_tests/tests/pointer_test.py b/src/cobalt/black_box_tests/tests/pointer_test.py
index a01556f..706bbc5 100644
--- a/src/cobalt/black_box_tests/tests/pointer_test.py
+++ b/src/cobalt/black_box_tests/tests/pointer_test.py
@@ -25,6 +25,7 @@
 
 import _env  # pylint: disable=unused-import,g-bad-import-order
 
+import logging
 import traceback
 
 from cobalt.black_box_tests import black_box_tests
@@ -51,9 +52,9 @@
         url = server.GetURL(file_name='testdata/pointer_test.html')
 
         with self.CreateCobaltRunner(url=url) as runner:
-          print('JS Test Setup WaitForJSTestsSetup')
+          logging.info('JS Test Setup WaitForJSTestsSetup')
           runner.WaitForJSTestsSetup()
-          print('JS Test Setup')
+          logging.info('JS Test Setup')
           self.assertTrue(runner.webdriver)
 
           top_one = find_element_by_id(runner, 'top_one')
@@ -100,4 +101,4 @@
       # Consider an exception being thrown as a test failure.
       self.assertTrue(False)
     finally:
-      print('Cleaning up.')
+      logging.info('Cleaning up.')
diff --git a/src/cobalt/black_box_tests/threaded_web_server.py b/src/cobalt/black_box_tests/threaded_web_server.py
index 7287b2d..2a37dd6 100644
--- a/src/cobalt/black_box_tests/threaded_web_server.py
+++ b/src/cobalt/black_box_tests/threaded_web_server.py
@@ -17,6 +17,7 @@
 from __future__ import division
 from __future__ import print_function
 
+import logging
 import os
 import SimpleHTTPServer
 import socket
@@ -53,6 +54,9 @@
                                               self._base_path)
       return potential_path
 
+    def log_message(self, format, *args):
+      logging.info(format % (args))
+
   return TestDataHTTPRequestHandler
 
 
diff --git a/src/cobalt/browser/application.cc b/src/cobalt/browser/application.cc
index 274b91a..d5a6545 100644
--- a/src/cobalt/browser/application.cc
+++ b/src/cobalt/browser/application.cc
@@ -38,7 +38,6 @@
 #include "cobalt/base/accessibility_caption_settings_changed_event.h"
 #include "cobalt/base/accessibility_settings_changed_event.h"
 #include "cobalt/base/accessibility_text_to_speech_settings_changed_event.h"
-#include "cobalt/base/application_event.h"
 #include "cobalt/base/cobalt_paths.h"
 #include "cobalt/base/deep_link_event.h"
 #include "cobalt/base/get_application_key.h"
@@ -565,8 +564,8 @@
   base::Optional<cssom::ViewportSize> requested_viewport_size =
       GetRequestedViewportSize(command_line);
 
-  early_deep_link_ = GetInitialDeepLink();
-  DLOG(INFO) << "Initial deep link: " << early_deep_link_;
+  unconsumed_deep_link_ = GetInitialDeepLink();
+  DLOG(INFO) << "Initial deep link: " << unconsumed_deep_link_;
 
   WebModule::Options web_options;
   storage::StorageManager::Options storage_manager_options;
@@ -653,8 +652,8 @@
   SecurityFlags security_flags{csp::kCSPRequired, network::kHTTPSRequired};
   // Set callback to be notified when a navigation occurs that destroys the
   // underlying WebModule.
-  options.web_module_recreated_callback =
-      base::Bind(&Application::WebModuleRecreated, base::Unretained(this));
+  options.web_module_created_callback =
+      base::Bind(&Application::WebModuleCreated, base::Unretained(this));
 
   // The main web module's stat tracker tracks event stats.
   options.web_module_options.track_event_stats = true;
@@ -728,8 +727,6 @@
   options.web_module_options.csp_enforcement_mode = dom::kCspEnforcementEnable;
 
   options.requested_viewport_size = requested_viewport_size;
-  options.web_module_loaded_callback =
-      base::Bind(&Application::DispatchEarlyDeepLink, base::Unretained(this));
   account_manager_.reset(new account::AccountManager());
 
   storage_manager_.reset(new storage::StorageManager(
@@ -980,14 +977,7 @@
 #endif  // SB_API_VERSION >= 12 ||
         // SB_HAS(ON_SCREEN_KEYBOARD)
     case kSbEventTypeLink: {
-      const char* link = static_cast<const char*>(starboard_event->data);
-      if (browser_module_->IsWebModuleLoaded()) {
-        DLOG(INFO) << "Dispatching deep link: " << link;
-        DispatchEventInternal(new base::DeepLinkEvent(link));
-      } else {
-        DLOG(INFO) << "Storing deep link: " << link;
-        early_deep_link_ = link;
-      }
+      DispatchDeepLink(static_cast<const char*>(starboard_event->data));
       break;
     }
     case kSbEventTypeAccessiblitySettingsChanged:
@@ -1202,8 +1192,9 @@
 }
 #endif  // SB_API_VERSION >= 12 || SB_HAS(CAPTIONS)
 
-void Application::WebModuleRecreated() {
-  TRACE_EVENT0("cobalt::browser", "Application::WebModuleRecreated()");
+void Application::WebModuleCreated() {
+  TRACE_EVENT0("cobalt::browser", "Application::WebModuleCreated()");
+  DispatchDeepLinkIfNotConsumed();
 #if defined(ENABLE_WEBDRIVER)
   if (web_driver_module_) {
     web_driver_module_->OnWindowRecreated();
@@ -1235,7 +1226,7 @@
 // to a new location on the heap.
 void Application::UpdateUserAgent() {
   non_trivial_static_fields.Get().user_agent = browser_module_->GetUserAgent();
-  DLOG(INFO) << "User Agent: " << non_trivial_static_fields.Get().user_agent;
+  LOG(INFO) << "User Agent: " << non_trivial_static_fields.Get().user_agent;
 }
 
 void Application::UpdatePeriodicStats() {
@@ -1286,13 +1277,52 @@
 }
 #endif  // defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
 
-void Application::DispatchEarlyDeepLink() {
-  if (early_deep_link_.empty()) {
+// Called to handle deep link consumed events.
+void Application::OnDeepLinkConsumedCallback(const std::string& link) {
+  LOG(INFO) << "Got deep link consumed callback: " << link;
+  base::AutoLock auto_lock(unconsumed_deep_link_lock_);
+  if (link == unconsumed_deep_link_) {
+    unconsumed_deep_link_.clear();
+  }
+}
+
+void Application::DispatchDeepLink(const char* link) {
+  if (!link || *link == 0) {
     return;
   }
-  DLOG(INFO) << "Dispatching early deep link: " << early_deep_link_;
-  DispatchEventInternal(new base::DeepLinkEvent(early_deep_link_.c_str()));
-  early_deep_link_ = "";
+
+  std::string deep_link;
+  // This block exists to ensure that the lock is held while accessing
+  // unconsumed_deep_link_.
+  {
+    base::AutoLock auto_lock(unconsumed_deep_link_lock_);
+    // Stash the deep link so that if it is not consumed, it can be dispatched
+    // again after the next WebModule is created.
+    unconsumed_deep_link_ = link;
+    deep_link = unconsumed_deep_link_;
+  }
+
+  LOG(INFO) << "Dispatching deep link: " << deep_link;
+  DispatchEventInternal(new base::DeepLinkEvent(
+      deep_link, base::Bind(&Application::OnDeepLinkConsumedCallback,
+                            base::Unretained(this), deep_link)));
+}
+
+void Application::DispatchDeepLinkIfNotConsumed() {
+  std::string deep_link;
+  // This block exists to ensure that the lock is held while accessing
+  // unconsumed_deep_link_.
+  {
+    base::AutoLock auto_lock(unconsumed_deep_link_lock_);
+    deep_link = unconsumed_deep_link_;
+  }
+
+  if (!deep_link.empty()) {
+    LOG(INFO) << "Dispatching deep link: " << deep_link;
+    DispatchEventInternal(new base::DeepLinkEvent(
+        deep_link, base::Bind(&Application::OnDeepLinkConsumedCallback,
+                              base::Unretained(this), deep_link)));
+  }
 }
 
 }  // namespace browser
diff --git a/src/cobalt/browser/application.h b/src/cobalt/browser/application.h
index 4b616bb..2f8ab19 100644
--- a/src/cobalt/browser/application.h
+++ b/src/cobalt/browser/application.h
@@ -22,6 +22,7 @@
 #include "base/command_line.h"
 #include "base/macros.h"
 #include "base/message_loop/message_loop.h"
+#include "base/synchronization/lock.h"
 #include "base/threading/thread_checker.h"
 #include "cobalt/account/account_manager.h"
 #include "cobalt/base/event_dispatcher.h"
@@ -49,8 +50,8 @@
 // loop. This class is not designed to be thread safe.
 class Application {
  public:
-  // The passed in |quit_closure| can be called internally by the Application to
-  // signal that it would like to quit.
+  // The passed in |quit_closure| can be called internally by the Application
+  // to signal that it would like to quit.
   Application(const base::Closure& quit_closure, bool should_preload);
   virtual ~Application();
 
@@ -89,7 +90,7 @@
 #endif  // SB_API_VERSION >= 12 || SB_HAS(CAPTIONS)
 
   // Called when a navigation occurs in the BrowserModule.
-  void WebModuleRecreated();
+  void WebModuleCreated();
 
   // A conduit for system events.
   base::EventDispatcher event_dispatcher_;
@@ -219,12 +220,18 @@
   void OnMemoryTrackerCommand(const std::string& message);
 #endif  // defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
 
-  // The latest link received before the Web Module is loaded is stored here.
-  std::string early_deep_link_;
+  // Deep links are stored here until they are reported consumed.
+  std::string unconsumed_deep_link_;
 
-  // Dispach events for early deeplink. This should be called once the Web
-  // Module is loaded.
-  void DispatchEarlyDeepLink();
+  // Lock for access to unconsumed_deep_link_ from different threads.
+  base::Lock unconsumed_deep_link_lock_;
+
+  // Called when deep links are consumed.
+  void OnDeepLinkConsumedCallback(const std::string& link);
+
+  // Dispach events for deep links.
+  void DispatchDeepLink(const char* link);
+  void DispatchDeepLinkIfNotConsumed();
 
   DISALLOW_COPY_AND_ASSIGN(Application);
 };
diff --git a/src/cobalt/browser/browser_module.cc b/src/cobalt/browser/browser_module.cc
index ce59127..383de3e 100644
--- a/src/cobalt/browser/browser_module.cc
+++ b/src/cobalt/browser/browser_module.cc
@@ -260,7 +260,7 @@
       // SB_HAS(ON_SCREEN_KEYBOARD)
       web_module_loaded_(base::WaitableEvent::ResetPolicy::MANUAL,
                          base::WaitableEvent::InitialState::NOT_SIGNALED),
-      web_module_recreated_callback_(options_.web_module_recreated_callback),
+      web_module_created_callback_(options_.web_module_created_callback),
       navigate_time_("Time.Browser.Navigate", 0,
                      "The last time a navigation occurred."),
       on_load_event_time_("Time.Browser.OnLoadEvent", 0,
@@ -306,8 +306,7 @@
       main_web_module_generation_(0),
       next_timeline_id_(1),
       current_splash_screen_timeline_id_(-1),
-      current_main_web_module_timeline_id_(-1),
-      web_module_loaded_callback_(options_.web_module_loaded_callback) {
+      current_main_web_module_timeline_id_(-1) {
   TRACE_EVENT0("cobalt::browser", "BrowserModule::BrowserModule()");
 
   // Apply platform memory setting adjustments and defaults.
@@ -640,8 +639,8 @@
       viewport_size, GetResourceProvider(), kLayoutMaxRefreshFrequencyInHz,
       options));
   lifecycle_observers_.AddObserver(web_module_.get());
-  if (!web_module_recreated_callback_.is_null()) {
-    web_module_recreated_callback_.Run();
+  if (!web_module_created_callback_.is_null()) {
+    web_module_created_callback_.Run();
   }
 
   if (system_window_) {
@@ -696,10 +695,6 @@
   on_load_event_time_ = base::TimeTicks::Now().ToInternalValue();
 
   web_module_loaded_.Signal();
-
-  if (!web_module_loaded_callback_.is_null()) {
-    web_module_loaded_callback_.Run();
-  }
 }
 
 bool BrowserModule::WaitForLoad(const base::TimeDelta& timeout) {
diff --git a/src/cobalt/browser/browser_module.h b/src/cobalt/browser/browser_module.h
index ee6dabd..15e0b94 100644
--- a/src/cobalt/browser/browser_module.h
+++ b/src/cobalt/browser/browser_module.h
@@ -100,14 +100,13 @@
     renderer::RendererModule::Options renderer_module_options;
     WebModule::Options web_module_options;
     media::MediaModule::Options media_module_options;
-    base::Closure web_module_recreated_callback;
+    base::Closure web_module_created_callback;
     memory_settings::AutoMemSettings command_line_auto_mem_settings;
     memory_settings::AutoMemSettings build_auto_mem_settings;
     base::Optional<GURL> fallback_splash_screen_url;
     base::Optional<cssom::ViewportSize> requested_viewport_size;
     bool enable_splash_screen_on_reloads;
     bool enable_on_screen_keyboard = true;
-    base::Closure web_module_loaded_callback;
   };
 
   // Type for a collection of URL handler callbacks that can potentially handle
@@ -536,9 +535,9 @@
   // Will be signalled when the WebModule's Window.onload event is fired.
   base::WaitableEvent web_module_loaded_;
 
-  // This will be called after the WebModule has been destroyed and recreated,
-  // which could occur on navigation.
-  base::Closure web_module_recreated_callback_;
+  // This will be called after a WebModule has been recreated, which could occur
+  // on navigation.
+  base::Closure web_module_created_callback_;
 
   // The time when a URL navigation starts. This is recorded after the previous
   // WebModule is destroyed.
@@ -673,9 +672,6 @@
   // by automem.  We want this so that we can check that it never changes, since
   // we do not have the ability to modify it after startup.
   base::Optional<int64_t> javascript_gc_threshold_in_bytes_;
-
-  // Callback to run when the Web Module is loaded.
-  base::Closure web_module_loaded_callback_;
 };
 
 }  // namespace browser
diff --git a/src/cobalt/build/build.id b/src/cobalt/build/build.id
index 7f8b3ba..d887bd0 100644
--- a/src/cobalt/build/build.id
+++ b/src/cobalt/build/build.id
@@ -1 +1 @@
-276914
\ No newline at end of file
+278101
\ No newline at end of file
diff --git a/src/cobalt/dom/html_element.cc b/src/cobalt/dom/html_element.cc
index c2a30ca..ae93458 100644
--- a/src/cobalt/dom/html_element.cc
+++ b/src/cobalt/dom/html_element.cc
@@ -1250,6 +1250,12 @@
   // by OnRemovedFromDocument() being called on them from
   // Node::OnRemovedFromDocument().
   ClearRuleMatchingStateInternal(false /*invalidate_descendants*/);
+
+  // Release the associated navigation item as the object is no longer visible.
+  if (ui_nav_item_) {
+    ui_nav_item_->SetEnabled(false);
+    ui_nav_item_ = nullptr;
+  }
 }
 
 void HTMLElement::OnMutation() { InvalidateMatchingRulesRecursively(); }
@@ -2088,6 +2094,7 @@
       // that callbacks won't be invoked for it. The object will be destroyed
       // when all references to it are released.
       ui_nav_item_->SetEnabled(false);
+      ui_nav_item_ = nullptr;
     }
     ui_nav_item_ = new ui_navigation::NavItem(
         *ui_nav_item_type,
diff --git a/src/cobalt/h5vcc/h5vcc_deep_link_event_target.cc b/src/cobalt/h5vcc/h5vcc_deep_link_event_target.cc
index 3d7fb05..c54ff90 100644
--- a/src/cobalt/h5vcc/h5vcc_deep_link_event_target.cc
+++ b/src/cobalt/h5vcc/h5vcc_deep_link_event_target.cc
@@ -21,13 +21,16 @@
 const std::string& OnGetArgument(const std::string& link) { return link; }
 }  // namespace
 
-H5vccDeepLinkEventTarget::H5vccDeepLinkEventTarget()
-    : ALLOW_THIS_IN_INITIALIZER_LIST(listeners_(this)) {}
+H5vccDeepLinkEventTarget::H5vccDeepLinkEventTarget(
+    base::Callback<const std::string&()> unconsumed_deep_link_callback)
+    : ALLOW_THIS_IN_INITIALIZER_LIST(listeners_(this)),
+      unconsumed_deep_link_callback_(unconsumed_deep_link_callback) {}
 
 void H5vccDeepLinkEventTarget::AddListener(
     const H5vccDeepLinkEventTarget::H5vccDeepLinkEventCallbackHolder&
         callback_holder) {
-  listeners_.AddListener(callback_holder);
+  listeners_.AddListenerAndCallIfFirst(callback_holder,
+                                       unconsumed_deep_link_callback_);
 }
 
 void H5vccDeepLinkEventTarget::DispatchEvent(const std::string& link) {
diff --git a/src/cobalt/h5vcc/h5vcc_deep_link_event_target.h b/src/cobalt/h5vcc/h5vcc_deep_link_event_target.h
index 26a87f6..eda8221 100644
--- a/src/cobalt/h5vcc/h5vcc_deep_link_event_target.h
+++ b/src/cobalt/h5vcc/h5vcc_deep_link_event_target.h
@@ -42,12 +42,16 @@
   typedef script::ScriptValue<H5vccDeepLinkEventCallback>
       H5vccDeepLinkEventCallbackHolder;
 
-  H5vccDeepLinkEventTarget();
+  H5vccDeepLinkEventTarget(
+      base::Callback<const std::string&()> unconsumed_deep_link_callback);
 
   // Called from JavaScript to register an event listener callback.
   // May be called from any thread.
   void AddListener(const H5vccDeepLinkEventCallbackHolder& callback_holder);
 
+  // Returns true if there is no listener.
+  bool empty() { return listeners_.empty(); }
+
   // Dispatches an event to the registered listeners.
   // May be called from any thread.
   void DispatchEvent(const std::string& link);
@@ -57,6 +61,7 @@
  private:
   H5vccEventListenerContainer<const std::string&, H5vccDeepLinkEventCallback>
       listeners_;
+  base::Callback<const std::string&()> unconsumed_deep_link_callback_;
 
   DISALLOW_COPY_AND_ASSIGN(H5vccDeepLinkEventTarget);
 };
diff --git a/src/cobalt/h5vcc/h5vcc_event_listener_container.h b/src/cobalt/h5vcc/h5vcc_event_listener_container.h
index b96fbc3..7da01c0 100644
--- a/src/cobalt/h5vcc/h5vcc_event_listener_container.h
+++ b/src/cobalt/h5vcc/h5vcc_event_listener_container.h
@@ -73,6 +73,12 @@
     }
   }
 
+  // Returns true if there is no listener.
+  bool empty() {
+    base::AutoLock auto_lock(lock_);
+    return listeners_.empty();
+  }
+
   // Called from JavaScript to register an event listener. May be called from
   // any thread, and event notification will be called on the same thread.
   void AddListener(const CallbackHolderType& callback_holder) {
@@ -80,6 +86,22 @@
     listeners_.push_back(new Listener(owner_, callback_holder));
   }
 
+  // Called from JavaScript to register an event listener. May be called from
+  // any thread, and event notification will be called on the same thread.
+  // Call the first listener if the callback does not return empty.
+  void AddListenerAndCallIfFirst(const CallbackHolderType& callback_holder,
+                                 GetArgumentCallback arg_callback) {
+    base::AutoLock auto_lock(lock_);
+    bool was_empty = listeners_.empty();
+    listeners_.push_back(new Listener(owner_, callback_holder));
+    if (was_empty) {
+      CallbackArgType arg = arg_callback.Run();
+      if (!arg.empty()) {
+        listeners_.back()->callback.value().Run(arg);
+      }
+    }
+  }
+
   // Dispatches an event to the registered listeners. May be called from any
   // thread, and the callbacks will be invoked on the same thread each listener
   // was registered on. |get_argument_callback| must be a function that
diff --git a/src/cobalt/h5vcc/h5vcc_runtime.cc b/src/cobalt/h5vcc/h5vcc_runtime.cc
index c76ede9..ac392dd 100644
--- a/src/cobalt/h5vcc/h5vcc_runtime.cc
+++ b/src/cobalt/h5vcc/h5vcc_runtime.cc
@@ -14,7 +14,7 @@
 
 #include "cobalt/h5vcc/h5vcc_runtime.h"
 
-#include "cobalt/base/application_event.h"
+#include "base/synchronization/lock.h"
 #include "cobalt/base/deep_link_event.h"
 #include "cobalt/base/polymorphic_downcast.h"
 
@@ -22,15 +22,12 @@
 namespace h5vcc {
 H5vccRuntime::H5vccRuntime(base::EventDispatcher* event_dispatcher)
     : event_dispatcher_(event_dispatcher) {
-  on_deep_link_ = new H5vccDeepLinkEventTarget;
+  on_deep_link_ = new H5vccDeepLinkEventTarget(
+      base::Bind(&H5vccRuntime::GetUnconsumedDeepLink, base::Unretained(this)));
   on_pause_ = new H5vccRuntimeEventTarget;
   on_resume_ = new H5vccRuntimeEventTarget;
 
   DCHECK(event_dispatcher_);
-  application_event_callback_ =
-      base::Bind(&H5vccRuntime::OnApplicationEvent, base::Unretained(this));
-  event_dispatcher_->AddEventCallback(base::ApplicationEvent::TypeId(),
-                                      application_event_callback_);
   deep_link_event_callback_ =
       base::Bind(&H5vccRuntime::OnDeepLinkEvent, base::Unretained(this));
   event_dispatcher_->AddEventCallback(base::DeepLinkEvent::TypeId(),
@@ -38,12 +35,33 @@
 }
 
 H5vccRuntime::~H5vccRuntime() {
-  event_dispatcher_->RemoveEventCallback(base::ApplicationEvent::TypeId(),
-                                         application_event_callback_);
   event_dispatcher_->RemoveEventCallback(base::DeepLinkEvent::TypeId(),
                                          deep_link_event_callback_);
 }
 
+std::string H5vccRuntime::initial_deep_link() {
+  base::AutoLock auto_lock(lock_);
+  if (consumed_callback_) {
+    std::move(consumed_callback_).Run();
+  }
+  if (!initial_deep_link_.empty()) {
+    LOG(INFO) << "Returning stashed deep link: " << initial_deep_link_;
+  }
+  return initial_deep_link_;
+}
+
+const std::string& H5vccRuntime::GetUnconsumedDeepLink() {
+  base::AutoLock auto_lock(lock_);
+  if (!initial_deep_link_.empty() && consumed_callback_) {
+    LOG(INFO) << "Returning stashed unconsumed deep link: "
+              << initial_deep_link_;
+    std::move(consumed_callback_).Run();
+    return initial_deep_link_;
+  }
+  return empty_string_;
+}
+
+
 const scoped_refptr<H5vccDeepLinkEventTarget>& H5vccRuntime::on_deep_link()
     const {
   return on_deep_link_;
@@ -63,21 +81,30 @@
   tracer->Trace(on_resume_);
 }
 
-void H5vccRuntime::OnApplicationEvent(const base::Event* event) {
-  const base::ApplicationEvent* app_event =
-      base::polymorphic_downcast<const base::ApplicationEvent*>(event);
-  if (app_event->type() == kSbEventTypePause) {
-    on_pause()->DispatchEvent();
-  } else if (app_event->type() == kSbEventTypeUnpause) {
-    on_resume()->DispatchEvent();
-  }
-}
-
 void H5vccRuntime::OnDeepLinkEvent(const base::Event* event) {
+  base::AutoLock auto_lock(lock_);
   const base::DeepLinkEvent* deep_link_event =
       base::polymorphic_downcast<const base::DeepLinkEvent*>(event);
-  DLOG(INFO) << "Got deep link event: " << deep_link_event->link();
-  on_deep_link()->DispatchEvent(deep_link_event->link());
+  const std::string& link = deep_link_event->link();
+  if (link.empty()) {
+    return;
+  }
+
+  if (on_deep_link()->empty()) {
+    // Store the link for later consumption.
+    LOG(INFO) << "Stashing deep link: " << link;
+    initial_deep_link_ = link;
+    consumed_callback_ = deep_link_event->callback();
+  } else {
+    // Send the link.
+    DCHECK(consumed_callback_.is_null());
+    LOG(INFO) << "Dispatching deep link event: " << link;
+    on_deep_link()->DispatchEvent(link);
+    base::OnceClosure callback(deep_link_event->callback());
+    if (callback) {
+      std::move(callback).Run();
+    }
+  }
 }
 }  // namespace h5vcc
 }  // namespace cobalt
diff --git a/src/cobalt/h5vcc/h5vcc_runtime.h b/src/cobalt/h5vcc/h5vcc_runtime.h
index 60e1055..88be673 100644
--- a/src/cobalt/h5vcc/h5vcc_runtime.h
+++ b/src/cobalt/h5vcc/h5vcc_runtime.h
@@ -17,6 +17,7 @@
 
 #include <string>
 
+#include "base/callback.h"
 #include "cobalt/base/event_dispatcher.h"
 #include "cobalt/h5vcc/h5vcc_deep_link_event_target.h"
 #include "cobalt/h5vcc/h5vcc_runtime_event_target.h"
@@ -30,6 +31,7 @@
   explicit H5vccRuntime(base::EventDispatcher* event_dispatcher);
   ~H5vccRuntime();
 
+  std::string initial_deep_link();
   const scoped_refptr<H5vccDeepLinkEventTarget>& on_deep_link() const;
   const scoped_refptr<H5vccRuntimeEventTarget>& on_pause() const;
   const scoped_refptr<H5vccRuntimeEventTarget>& on_resume() const;
@@ -38,20 +40,26 @@
   void TraceMembers(script::Tracer* tracer) override;
 
  private:
-  // Called by the event dispatcher to handle various event types.
-  void OnApplicationEvent(const base::Event* event);
+  // Called by the event dispatcher to handle deep link events.
   void OnDeepLinkEvent(const base::Event* event);
 
+  // Returns the initial deep link if it's unconsumed.
+  const std::string& GetUnconsumedDeepLink();
+
   scoped_refptr<H5vccDeepLinkEventTarget> on_deep_link_;
   scoped_refptr<H5vccRuntimeEventTarget> on_pause_;
   scoped_refptr<H5vccRuntimeEventTarget> on_resume_;
 
   // Non-owned reference used to receive application event callbacks.
   base::EventDispatcher* event_dispatcher_;
+  std::string initial_deep_link_;
+  const std::string empty_string_;
 
   // Event callbacks.
-  base::EventCallback application_event_callback_;
   base::EventCallback deep_link_event_callback_;
+  base::OnceClosure consumed_callback_;
+
+  base::Lock lock_;
 
   DISALLOW_COPY_AND_ASSIGN(H5vccRuntime);
 };
diff --git a/src/cobalt/h5vcc/h5vcc_runtime.idl b/src/cobalt/h5vcc/h5vcc_runtime.idl
index 88b226a..2792622 100644
--- a/src/cobalt/h5vcc/h5vcc_runtime.idl
+++ b/src/cobalt/h5vcc/h5vcc_runtime.idl
@@ -13,6 +13,7 @@
 // limitations under the License.
 
 interface H5vccRuntime {
+  readonly attribute DOMString initialDeepLink;
   readonly attribute H5vccDeepLinkEventTarget onDeepLink;
   readonly attribute H5vccRuntimeEventTarget onPause;
   readonly attribute H5vccRuntimeEventTarget onResume;
diff --git a/src/cobalt/h5vcc/h5vcc_updater.cc b/src/cobalt/h5vcc/h5vcc_updater.cc
index 7441e70..4b7a171 100644
--- a/src/cobalt/h5vcc/h5vcc_updater.cc
+++ b/src/cobalt/h5vcc/h5vcc_updater.cc
@@ -46,5 +46,11 @@
   return updater_module_->GetUpdaterStatus();
 }
 
+void H5vccUpdater::ResetInstallations() {
+  if (updater_module_) {
+    updater_module_->ResetInstallations();
+  }
+}
+
 }  // namespace h5vcc
 }  // namespace cobalt
diff --git a/src/cobalt/h5vcc/h5vcc_updater.h b/src/cobalt/h5vcc/h5vcc_updater.h
index e27c2da..6578e58 100644
--- a/src/cobalt/h5vcc/h5vcc_updater.h
+++ b/src/cobalt/h5vcc/h5vcc_updater.h
@@ -42,6 +42,8 @@
 
   std::string GetUpdateStatus() const;
 
+  void ResetInstallations();
+
 #else
   H5vccUpdater() {}
 #endif
diff --git a/src/cobalt/h5vcc/h5vcc_updater.idl b/src/cobalt/h5vcc/h5vcc_updater.idl
index 257a1be..e92910f 100644
--- a/src/cobalt/h5vcc/h5vcc_updater.idl
+++ b/src/cobalt/h5vcc/h5vcc_updater.idl
@@ -20,4 +20,6 @@
   void setUpdaterChannel(DOMString channel);
 
   DOMString getUpdateStatus();
+
+  void resetInstallations();
 };
diff --git a/src/cobalt/layout/topmost_event_target.cc b/src/cobalt/layout/topmost_event_target.cc
index 75b106d..6316a6b 100644
--- a/src/cobalt/layout/topmost_event_target.cc
+++ b/src/cobalt/layout/topmost_event_target.cc
@@ -53,7 +53,6 @@
   ConsiderElement(html_element_, coordinate);
   box_ = NULL;
   render_sequence_.clear();
-  document->SetIndicatedElement(html_element_);
   scoped_refptr<dom::HTMLElement> topmost_element;
   topmost_element.swap(html_element_);
   DCHECK(!html_element_);
@@ -131,10 +130,10 @@
 }
 
 namespace {
-void SendStateChangeEvents(bool is_pointer_event,
-                           scoped_refptr<dom::HTMLElement> previous_element,
-                           scoped_refptr<dom::HTMLElement> target_element,
-                           dom::PointerEventInit* event_init) {
+void SendStateChangeLeaveEvents(
+    bool is_pointer_event, scoped_refptr<dom::HTMLElement> previous_element,
+    scoped_refptr<dom::HTMLElement> target_element,
+    dom::PointerEventInit* event_init) {
   // Send enter/leave/over/out (status change) events when needed.
   if (previous_element != target_element) {
     const scoped_refptr<dom::Window>& view = event_init->view();
@@ -151,13 +150,6 @@
       }
 
       event_init->set_related_target(target_element);
-      if (is_pointer_event) {
-        previous_element->DispatchEvent(new dom::PointerEvent(
-            base::Tokens::pointerout(), view, *event_init));
-      }
-      previous_element->DispatchEvent(
-          new dom::MouseEvent(base::Tokens::mouseout(), view, *event_init));
-
       // Find the nearest common ancestor, if there is any.
       dom::Document* previous_document = previous_element->node_document();
       if (previous_document) {
@@ -173,15 +165,33 @@
             nearest_common_ancestor = nearest_common_ancestor->parent_element();
           }
         }
+      }
 
-        for (scoped_refptr<dom::Element> element = previous_element;
-             element && element != nearest_common_ancestor;
-             element = element->parent_element()) {
-          if (is_pointer_event) {
+      if (is_pointer_event) {
+        previous_element->DispatchEvent(new dom::PointerEvent(
+            base::Tokens::pointerout(), view, *event_init));
+        if (previous_document) {
+          for (scoped_refptr<dom::Element> element = previous_element;
+               element && element != nearest_common_ancestor;
+               element = element->parent_element()) {
+            DCHECK(element->AsHTMLElement()->IsDesignated());
             element->DispatchEvent(new dom::PointerEvent(
                 base::Tokens::pointerleave(), dom::Event::kNotBubbles,
                 dom::Event::kNotCancelable, view, *event_init));
           }
+        }
+      }
+
+      // Send compatibility mapping mouse events for state changes.
+      //   https://www.w3.org/TR/pointerevents/#mapping-for-devices-that-do-not-support-hover
+      previous_element->DispatchEvent(
+          new dom::MouseEvent(base::Tokens::mouseout(), view, *event_init));
+
+      if (previous_document) {
+        for (scoped_refptr<dom::Element> element = previous_element;
+             element && element != nearest_common_ancestor;
+             element = element->parent_element()) {
+          DCHECK(element->AsHTMLElement()->IsDesignated());
           element->DispatchEvent(new dom::MouseEvent(
               base::Tokens::mouseleave(), dom::Event::kNotBubbles,
               dom::Event::kNotCancelable, view, *event_init));
@@ -193,6 +203,20 @@
         }
       }
     }
+  }
+}
+
+void SendStateChangeEnterEvents(
+    bool is_pointer_event, scoped_refptr<dom::HTMLElement> previous_element,
+    scoped_refptr<dom::HTMLElement> target_element,
+    dom::PointerEventInit* event_init) {
+  // Send enter/leave/over/out (status change) events when needed.
+  if (previous_element != target_element) {
+    const scoped_refptr<dom::Window>& view = event_init->view();
+
+    // The enter/leave status change events apply to all ancestors up to the
+    // nearest common ancestor between the previous and current element.
+    scoped_refptr<dom::Element> nearest_common_ancestor;
 
     // Send over and enter events.
     if (target_element) {
@@ -205,18 +229,22 @@
       if (is_pointer_event) {
         target_element->DispatchEvent(new dom::PointerEvent(
             base::Tokens::pointerover(), view, *event_init));
-      }
-      target_element->DispatchEvent(
-          new dom::MouseEvent(base::Tokens::mouseover(), view, *event_init));
-
-      for (scoped_refptr<dom::Element> element = target_element;
-           element != nearest_common_ancestor;
-           element = element->parent_element()) {
-        if (is_pointer_event) {
+        for (scoped_refptr<dom::Element> element = target_element;
+             element != nearest_common_ancestor;
+             element = element->parent_element()) {
           element->DispatchEvent(new dom::PointerEvent(
               base::Tokens::pointerenter(), dom::Event::kNotBubbles,
               dom::Event::kNotCancelable, view, *event_init));
         }
+      }
+
+      // Send compatibility mapping mouse events for state changes.
+      //   https://www.w3.org/TR/pointerevents/#mapping-for-devices-that-do-not-support-hover
+      target_element->DispatchEvent(
+          new dom::MouseEvent(base::Tokens::mouseover(), view, *event_init));
+      for (scoped_refptr<dom::Element> element = target_element;
+           element != nearest_common_ancestor;
+           element = element->parent_element()) {
         element->DispatchEvent(new dom::MouseEvent(
             base::Tokens::mouseenter(), dom::Event::kNotBubbles,
             dom::Event::kNotCancelable, view, *event_init));
@@ -368,6 +396,12 @@
     target_element = FindTopmostEventTarget(view->document(), coordinate);
   }
 
+  scoped_refptr<dom::HTMLElement> previous_html_element(
+      previous_html_element_weak_);
+
+  SendStateChangeLeaveEvents(pointer_event, previous_html_element,
+                             target_element, &event_init);
+
   if (target_element) {
     target_element->DispatchEvent(event);
   }
@@ -403,13 +437,14 @@
     }
   }
 
-  scoped_refptr<dom::HTMLElement> previous_html_element(
-      previous_html_element_weak_);
-
-  SendStateChangeEvents(pointer_event, previous_html_element, target_element,
-                        &event_init);
+  SendStateChangeEnterEvents(pointer_event, previous_html_element,
+                             target_element, &event_init);
 
   if (target_element) {
+    dom::Document* document = target_element->node_document();
+    if (document) {
+      document->SetIndicatedElement(target_element);
+    }
     previous_html_element_weak_ = base::AsWeakPtr(target_element.get());
   } else {
     previous_html_element_weak_.reset();
diff --git a/src/cobalt/media/fetcher_buffered_data_source.h b/src/cobalt/media/fetcher_buffered_data_source.h
index 033e05b..7fcc3e0 100644
--- a/src/cobalt/media/fetcher_buffered_data_source.h
+++ b/src/cobalt/media/fetcher_buffered_data_source.h
@@ -38,8 +38,7 @@
 namespace cobalt {
 namespace media {
 
-// TODO: This class requires a large block of memory.  Consider to
-// use ShellBufferFactory for its memory if possible to avoid possible OOM.
+// TODO: This class requires a large block of memory.
 
 // A BufferedDataSource based on net::URLFetcher that can be used to retrieve
 // progressive videos from both local and network sources.
diff --git a/src/cobalt/media/filters/shell_mp4_map.cc b/src/cobalt/media/filters/shell_mp4_map.cc
index 91a74ef..3a5189e 100644
--- a/src/cobalt/media/filters/shell_mp4_map.cc
+++ b/src/cobalt/media/filters/shell_mp4_map.cc
@@ -55,7 +55,7 @@
     if (cache_first_entry_number_ + cache_entry_count_ > entry_count_) {
       cache_entry_count_ = entry_count_ - cache_first_entry_number_;
     }
-    // drop old data to allow ShellBufferFactory to defrag
+    // drop old data
     cache_.clear();
     DCHECK_GE(cache_entry_count_, 0);
     int bytes_to_read = cache_entry_count_ * entry_size_;
diff --git a/src/cobalt/media/filters/shell_mp4_map.h b/src/cobalt/media/filters/shell_mp4_map.h
index fad4969..88e1319 100644
--- a/src/cobalt/media/filters/shell_mp4_map.h
+++ b/src/cobalt/media/filters/shell_mp4_map.h
@@ -34,9 +34,9 @@
 static const int kEntrySize_stsz = 4;
 
 // Utility class to parse the various subatoms of the stbl mp4 atom and use
-// them to provide byte offsets, sizes, and timestamps of a mp4 atom while
-// reusing memory issued by ShellBufferFactory. The caching design benefits
-// from, but does not require, sequential access in sample numbers.
+// them to provide byte offsets, sizes, and timestamps of a mp4 atom. The
+// caching design benefits from, but does not require, sequential access
+// in sample numbers.
 class ShellMP4Map : public base::RefCountedThreadSafe<ShellMP4Map> {
  public:
   explicit ShellMP4Map(scoped_refptr<ShellDataSourceReader> reader);
diff --git a/src/cobalt/media/sandbox/demuxer_helper.h b/src/cobalt/media/sandbox/demuxer_helper.h
index edd646b..69e100b 100644
--- a/src/cobalt/media/sandbox/demuxer_helper.h
+++ b/src/cobalt/media/sandbox/demuxer_helper.h
@@ -40,8 +40,7 @@
       const DemuxerReadyCB& demuxer_ready_cb);
   // This ctor will create an Demuxer internally that caches the media data in
   // memory before calling the callback.  This ensures that there is no I/O
-  // incurred during playback.  Note that the amount can cache is subject to
-  // the pool size of ShellBufferFactory.
+  // incurred during playback.
   DemuxerHelper(
       const scoped_refptr<base::SingleThreadTaskRunner>& media_message_loop,
       loader::FetcherFactory* fetcher_factory, const GURL& video_url,
diff --git a/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.cc b/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.cc
index 3301a4b..9ed9a55 100644
--- a/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.cc
+++ b/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.cc
@@ -391,6 +391,61 @@
         draw_state_.rounded_scissor_rect = old_scissor_rect;
         draw_state_.rounded_scissor_corners = old_scissor_corners;
         return;
+      } else {
+        // The source is too complex and must be rendered to a texture, then
+        // that texture will be rendered using the rounded viewport.
+        DrawObject::BaseState old_draw_state = draw_state_;
+
+        // Render the source into an offscreen target at 100% opacity in its
+        // own local space. To avoid magnification artifacts, scale up the
+        // local space to match the source's size when rendered in world space.
+        math::Matrix3F texcoord_transform(math::Matrix3F::Identity());
+        math::RectF content_rect = data.source->GetBounds();
+        const backend::TextureEGL* texture = nullptr;
+        if (!IsVisible(content_rect)) {
+          return;
+        }
+        draw_state_.opacity = 1.0f;
+
+        math::PointF mapped_origin = draw_state_.transform * math::PointF(0, 0);
+        math::PointF mapped_x = draw_state_.transform * math::PointF(1, 0);
+        math::PointF mapped_y = draw_state_.transform * math::PointF(0, 1);
+        math::Vector2dF mapped_vecx(mapped_x.x() - mapped_origin.x(),
+                                    mapped_x.y() - mapped_origin.y());
+        math::Vector2dF mapped_vecy(mapped_y.x() - mapped_origin.x(),
+                                    mapped_y.y() - mapped_origin.y());
+        float scale_x = mapped_vecx.Length();
+        float scale_y = mapped_vecy.Length();
+        draw_state_.transform = math::ScaleMatrix(std::max(1.0f, scale_x),
+                                                  std::max(1.0f, scale_y));
+
+        // Don't clip the source since it is in its own local space.
+        bool limit_to_screen_size = false;
+        math::RectF mapped_content_rect =
+            draw_state_.transform.MapRect(content_rect);
+        draw_state_.scissor = math::Rect::RoundFromRectF(
+            RoundOut(mapped_content_rect, 0.0f));
+        draw_state_.rounded_scissor_corners.reset();
+
+        OffscreenRasterize(data.source, limit_to_screen_size, &texture,
+                           &texcoord_transform, &mapped_content_rect);
+        if (mapped_content_rect.IsEmpty()) {
+          return;
+        }
+
+        // Then render that offscreen target with the rounded filter.
+        draw_state_ = old_draw_state;
+        draw_state_.rounded_scissor_rect = data.viewport_filter->viewport();
+        draw_state_.rounded_scissor_corners =
+            data.viewport_filter->rounded_corners();
+        std::unique_ptr<DrawObject> draw(new DrawRRectColorTexture(
+            graphics_state_, draw_state_, content_rect, kOpaqueWhite, texture,
+            texcoord_transform, true /* clamp_texcoords */));
+        AddDraw(std::move(draw), content_rect,
+                DrawObjectManager::kBlendSrcAlpha);
+
+        draw_state_ = old_draw_state;
+        return;
       }
     } else if (cobalt::math::IsOnlyScaleAndTranslate(transform)) {
       // Orthogonal viewport filters without rounded corners can be collapsed
@@ -451,17 +506,21 @@
 
       // Render source at 100% opacity to an offscreen target, then render
       // that result with the specified filter opacity.
-      OffscreenRasterize(data.source, &texture, &texcoord_transform,
-                         &content_rect);
+      float old_opacity = draw_state_.opacity;
+      draw_state_.opacity = 1.0f;
+      // Since the offscreen target is mapped to world space, limit the target
+      // to the screen size to avoid unnecessarily large offscreen targets.
+      bool limit_to_screen_size = true;
+      OffscreenRasterize(data.source, limit_to_screen_size, &texture,
+                         &texcoord_transform, &content_rect);
       if (content_rect.IsEmpty()) {
         return;
       }
 
       // The content rect is already in screen space, so reset the transform.
       math::Matrix3F old_transform = draw_state_.transform;
-      float old_opacity = draw_state_.opacity;
       draw_state_.transform = math::Matrix3F::Identity();
-      draw_state_.opacity *= filter_opacity;
+      draw_state_.opacity = old_opacity * filter_opacity;
       std::unique_ptr<DrawObject> draw(new DrawRectColorTexture(
           graphics_state_, draw_state_, content_rect, kOpaqueWhite, texture,
           texcoord_transform, true /* clamp_texcoords */));
@@ -1006,8 +1065,9 @@
       target_info.region);
 }
 
-// Add draw objects to render |node| to an offscreen render target at
-//   100% opacity.
+// Add draw objects to render |node| to an offscreen render target.
+// |limit_to_screen_size| specifies whether the allocated render target should
+//   be limited to the onscreen render target size.
 // |out_texture| and |out_texcoord_transform| describe the texture subregion
 //   that will contain the result of rendering |node|.
 // |out_content_rect| describes the onscreen rect (in screen space) which
@@ -1015,9 +1075,10 @@
 //   nothing needs to be rendered.
 void RenderTreeNodeVisitor::OffscreenRasterize(
     scoped_refptr<render_tree::Node> node,
-    const backend::TextureEGL** out_texture,
+    bool limit_to_screen_size, const backend::TextureEGL** out_texture,
     math::Matrix3F* out_texcoord_transform, math::RectF* out_content_rect) {
-  // Check whether the node is visible.
+  // Map the target to world space. This avoids scaling artifacts if the target
+  // is magnified.
   math::RectF mapped_bounds = draw_state_.transform.MapRect(node->GetBounds());
 
   if (!mapped_bounds.IsExpressibleAsRect()) {
@@ -1026,6 +1087,7 @@
     return;
   }
 
+  // Check whether the node is visible.
   math::RectF rounded_out_bounds = RoundOut(mapped_bounds, 0.0f);
   math::RectF clipped_bounds =
       math::IntersectRects(rounded_out_bounds, draw_state_.scissor);
@@ -1041,11 +1103,15 @@
   // the chance that the render target can be recycled in the next frame.
   OffscreenTargetManager::TargetInfo target_info;
   math::SizeF target_size(rounded_out_bounds.size());
-  target_size.SetToMin(onscreen_render_target_->GetSize());
+  if (limit_to_screen_size) {
+    target_size.SetToMin(onscreen_render_target_->GetSize());
+  }
   offscreen_target_manager_->AllocateUncachedTarget(target_size, &target_info);
 
   if (!target_info.framebuffer) {
-    LOG(ERROR) << "Could not allocate framebuffer for offscreen rasterization.";
+    LOG(ERROR) << "Could not allocate framebuffer ("
+               << target_size.width() << "x" << target_size.height()
+               << ") for offscreen rasterization.";
     out_content_rect->SetRect(0.0f, 0.0f, 0.0f, 0.0f);
     return;
   }
@@ -1071,13 +1137,9 @@
   draw_object_manager_->AddRenderTargetDependency(old_render_target,
                                                   render_target_);
 
-  // Draw the contents at 100% opacity. The caller will then draw the results
-  // onto the main render target at the desired opacity.
-  draw_state_.opacity = 1.0f;
-  draw_state_.scissor = math::Rect::RoundFromRectF(target_info.region);
-
   // Clear the new render target. (Set the transform to the identity matrix so
   // the bounds for the DrawClear comes out as the entire target region.)
+  draw_state_.scissor = math::Rect::RoundFromRectF(target_info.region);
   draw_state_.transform = math::Matrix3F::Identity();
   std::unique_ptr<DrawObject> draw_clear(
       new DrawClear(graphics_state_, draw_state_, kTransparentBlack));
diff --git a/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.h b/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.h
index 87dd574..7e169a4 100644
--- a/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.h
+++ b/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.h
@@ -100,6 +100,7 @@
                          const math::RectF& content_rect);
 
   void OffscreenRasterize(scoped_refptr<render_tree::Node> node,
+                          bool limit_to_screen_size,
                           const backend::TextureEGL** out_texture,
                           math::Matrix3F* out_texcoord_transform,
                           math::RectF* out_content_rect);
diff --git a/src/cobalt/renderer/rasterizer/pixel_test.cc b/src/cobalt/renderer/rasterizer/pixel_test.cc
index ae27062..464ef3d 100644
--- a/src/cobalt/renderer/rasterizer/pixel_test.cc
+++ b/src/cobalt/renderer/rasterizer/pixel_test.cc
@@ -1163,6 +1163,20 @@
                                        ColorRGBA(1.0, 0, 0, 1.0)));
 }
 
+TEST_F(PixelTest, RotatedTextInScaledRoundedCorners) {
+  // If the source has enough fidelity, then magnified versions of it
+  // should be crisp instead of blurry; blurriness indicates that any
+  // intermediate render targets used did not have enough resolution.
+  scoped_refptr<Node> rotated_text = new MatrixTransformNode(
+      CreateTextNodeWithinSurface(GetResourceProvider(), "Cobalt", FontStyle(),
+                                  5, ColorRGBA(0, 0, 0, 1.0)),
+      RotateMatrix(static_cast<float>(-M_PI) / 4.0f));
+  TestTree(new MatrixTransformNode(
+      new FilterNode(ViewportFilter(RectF(0, 0, 10, 10), RoundedCorners(3, 5)),
+                     rotated_text),
+      ScaleMatrix(50.0f, 25.0f)));
+}
+
 namespace {
 scoped_refptr<Node> CreateTextNodeWithBackgroundColor(
     ResourceProvider* resource_provider, const std::string& text,
diff --git a/src/cobalt/renderer/rasterizer/testdata/RotatedTextInScaledRoundedCorners-expected.png b/src/cobalt/renderer/rasterizer/testdata/RotatedTextInScaledRoundedCorners-expected.png
new file mode 100644
index 0000000..cdcd524
--- /dev/null
+++ b/src/cobalt/renderer/rasterizer/testdata/RotatedTextInScaledRoundedCorners-expected.png
Binary files differ
diff --git a/src/cobalt/system_window/system_window.gyp b/src/cobalt/system_window/system_window.gyp
index 3e75390..84c13b9 100644
--- a/src/cobalt/system_window/system_window.gyp
+++ b/src/cobalt/system_window/system_window.gyp
@@ -21,7 +21,6 @@
       'target_name': 'system_window',
       'type': 'static_library',
       'sources': [
-        'application_event.h',
         'keyboard_event.h',
         'system_window.h',
         'system_window.cc',
diff --git a/src/cobalt/tools/automated_testing/cobalt_runner.py b/src/cobalt/tools/automated_testing/cobalt_runner.py
index d25d559..4f627f7 100644
--- a/src/cobalt/tools/automated_testing/cobalt_runner.py
+++ b/src/cobalt/tools/automated_testing/cobalt_runner.py
@@ -5,6 +5,7 @@
 from __future__ import print_function
 
 import json
+import logging
 import os
 import re
 import sys
@@ -46,6 +47,7 @@
 WINDOWDRIVER_CREATED_TIMEOUT_SECONDS = 45
 WEBMODULE_LOADED_TIMEOUT_SECONDS = 45
 FIND_ELEMENT_RETRY_LIMIT = 20
+EXECUTE_JAVASCRIPT_RETRY_LIMIT = 10
 
 COBALT_WEBDRIVER_CAPABILITIES = {
     'browserName': 'cobalt',
@@ -112,6 +114,7 @@
     self.launcher_params = launcher_params
     if log_file:
       self.log_file = open(log_file)
+      logging.basicConfig(stream=self.log_file, level=logging.INFO)
     else:
       self.log_file = sys.stdout
     self.url = url
@@ -176,8 +179,8 @@
 
       # Bail out immediately if the Cobalt WebDriver server doesn't start.
       if RE_WEBDRIVER_FAILED.search(line):
-        print('\nCobalt WebDriver server not started.'
-              '\nIs another instance of Cobalt running?')
+        logging.error('\nCobalt WebDriver server not started.'
+                      '\nIs another instance of Cobalt running?')
         self.launcher.Kill()
 
       match = RE_WEBDRIVER_LISTEN.search(line)
@@ -185,7 +188,7 @@
         continue
 
       port = match.group(1)
-      print('WebDriver port opened:' + port + '\n', file=self.log_file)
+      logging.info('WebDriver port opened:' + port + '\n')
       self._StartWebdriver(port)
 
   def __enter__(self):
@@ -287,7 +290,7 @@
     self.webdriver = self.selenium_webdriver_module.Remote(
         url, COBALT_WEBDRIVER_CAPABILITIES)
     self.webdriver.command_executor.set_timeout(WEBDRIVER_HTTP_TIMEOUT_SECONDS)
-    print('Selenium Connected\n', file=self.log_file)
+    logging.info('Selenium Connected')
     self.test_script_started.set()
 
   def WaitForStart(self):
@@ -299,16 +302,17 @@
     if not self.test_script_started.wait(startup_timeout_seconds):
       self.Exit(should_fail=True)
       raise TimeoutException
-    print('Cobalt started', file=self.log_file)
+    logging.info('Cobalt started')
 
   def _RunLauncher(self):
     """Thread run routine."""
     try:
-      print('Running launcher', file=self.log_file)
+      logging.info('Running launcher')
       self.launcher.Run()
-      print('Cobalt terminated.', file=self.log_file)
+      logging.info('Cobalt terminated.')
       if not self.failed and self.success_message:
         print('{}\n'.format(self.success_message))
+        logging.info('{}\n'.format(self.success_message))
     # pylint: disable=broad-except
     except Exception as ex:
       sys.stderr.write('Exception running Cobalt ' + str(ex))
@@ -324,7 +328,20 @@
     return self.webdriver is not None
 
   def ExecuteJavaScript(self, js_code):
-    return self.webdriver.execute_script(js_code)
+    retry_count = 0
+    while retry_count < EXECUTE_JAVASCRIPT_RETRY_LIMIT:
+      retry_count += 1
+      try:
+        result = self.webdriver.execute_script(js_code)
+      except (selenium_exceptions.NoSuchElementException,
+              selenium_exceptions.NoSuchWindowException):
+        time.sleep(0.2)
+        continue
+      except Exception:
+        sys.excepthook(*sys.exc_info())
+        logging.exception("Failed with unexpected exception")
+      break
+    return result
 
   def GetCval(self, cval_name):
     """Returns the Python object represented by a cval string.
@@ -441,9 +458,13 @@
       retry_count += 1
       try:
         elements = self.webdriver.find_elements_by_css_selector(css_selector)
-      except selenium_exceptions.NoSuchElementException:
+      except (selenium_exceptions.NoSuchElementException,
+              selenium_exceptions.NoSuchWindowException):
         time.sleep(0.2)
         continue
+      except Exception:
+        sys.excepthook(*sys.exc_info())
+        logging.exception("Failed with unexpected exception")
       break
     if expected_num is not None and len(elements) != expected_num:
       raise CobaltRunner.AssertException(
diff --git a/src/cobalt/ui_navigation/nav_item.cc b/src/cobalt/ui_navigation/nav_item.cc
index d98745f..05f49d6 100644
--- a/src/cobalt/ui_navigation/nav_item.cc
+++ b/src/cobalt/ui_navigation/nav_item.cc
@@ -34,6 +34,7 @@
       nav_item_(GetInterface().create_item(type, &s_callbacks_, this)) {}
 
 NavItem::~NavItem() {
+  GetInterface().set_item_enabled(nav_item_, false);
   GetInterface().destroy_item(nav_item_);
 }
 
diff --git a/src/cobalt/updater/crash_client.cc b/src/cobalt/updater/crash_client.cc
index 25029db..75d2fa5 100644
--- a/src/cobalt/updater/crash_client.cc
+++ b/src/cobalt/updater/crash_client.cc
@@ -56,7 +56,7 @@
   base::PathService::Get(base::FILE_EXE, &handler_path);
 
   base::FilePath database_path;
-  if (!GetProductDirectory(&database_path)) {
+  if (!CreateProductDirectory(&database_path)) {
     LOG(ERROR) << "Failed to get the database path.";
     return false;
   }
diff --git a/src/cobalt/updater/crash_reporter.cc b/src/cobalt/updater/crash_reporter.cc
index 54bfece..f5c1a32 100644
--- a/src/cobalt/updater/crash_reporter.cc
+++ b/src/cobalt/updater/crash_reporter.cc
@@ -62,7 +62,7 @@
   base::PathService::Get(base::FILE_EXE, &handler_path);
 
   base::FilePath database_path;
-  if (!GetProductDirectory(&database_path)) {
+  if (!CreateProductDirectory(&database_path)) {
     LOG(DFATAL) << "Failed to get the database path.";
     return;
   }
diff --git a/src/cobalt/updater/installer.cc b/src/cobalt/updater/installer.cc
index 904c9ed..ab14865 100644
--- a/src/cobalt/updater/installer.cc
+++ b/src/cobalt/updater/installer.cc
@@ -27,7 +27,7 @@
 // identified by the |crx_id|.
 base::FilePath GetAppInstallDir(const std::string& crx_id) {
   base::FilePath app_install_dir;
-  if (GetProductDirectory(&app_install_dir)) {
+  if (CreateProductDirectory(&app_install_dir)) {
     app_install_dir = app_install_dir.AppendASCII(kAppsDir);
     app_install_dir = app_install_dir.AppendASCII(crx_id);
   }
diff --git a/src/cobalt/updater/prefs.cc b/src/cobalt/updater/prefs.cc
index 0f3aed1..5745632 100644
--- a/src/cobalt/updater/prefs.cc
+++ b/src/cobalt/updater/prefs.cc
@@ -21,7 +21,7 @@
 
 std::unique_ptr<PrefService> CreatePrefService() {
   base::FilePath product_data_dir;
-  if (!GetProductDirectory(&product_data_dir)) return nullptr;
+  if (!CreateProductDirectory(&product_data_dir)) return nullptr;
 
   const CobaltExtensionInstallationManagerApi* installation_api =
       static_cast<const CobaltExtensionInstallationManagerApi*>(
diff --git a/src/cobalt/updater/updater_module.cc b/src/cobalt/updater/updater_module.cc
index 2f00c8a..0a7904e 100644
--- a/src/cobalt/updater/updater_module.cc
+++ b/src/cobalt/updater/updater_module.cc
@@ -37,6 +37,7 @@
 #include "cobalt/updater/utils.h"
 #include "components/crx_file/crx_verifier.h"
 #include "components/update_client/utils.h"
+#include "starboard/common/file.h"
 #include "starboard/configuration_constants.h"
 
 namespace {
@@ -144,8 +145,9 @@
   update_client_->AddObserver(updater_observer_.get());
 
   // Schedule the first update check.
-  updater_thread_.task_runner()->PostTask(
-      FROM_HERE, base::Bind(&UpdaterModule::Update, base::Unretained(this)));
+  updater_thread_.task_runner()->PostDelayedTask(
+      FROM_HERE, base::Bind(&UpdaterModule::Update, base::Unretained(this)),
+      base::TimeDelta::FromMinutes(1));
 }
 
 void UpdaterModule::Finalize() {
@@ -258,5 +260,29 @@
       FROM_HERE, base::Bind(&UpdaterModule::Update, base::Unretained(this)));
 }
 
+void UpdaterModule::ResetInstallations() {
+  auto installation_manager =
+      static_cast<const CobaltExtensionInstallationManagerApi*>(
+          SbSystemGetExtension(kCobaltExtensionInstallationManagerName));
+  if (!installation_manager) {
+    SB_LOG(ERROR) << "Updater failed to get installation manager extension.";
+    return;
+  }
+  if (installation_manager->Reset() == IM_EXT_ERROR) {
+    SB_LOG(ERROR) << "Updater failed to reset installations.";
+    return;
+  }
+  base::FilePath product_data_dir;
+  if (!GetProductDirectoryPath(&product_data_dir)) {
+    SB_LOG(ERROR) << "Updater failed to get product directory path.";
+    return;
+  }
+  if (!starboard::SbFileDeleteRecursive(product_data_dir.value().c_str(),
+                                        true)) {
+    SB_LOG(ERROR) << "Updater failed to clean the product directory.";
+    return;
+  }
+}
+
 }  // namespace updater
 }  // namespace cobalt
diff --git a/src/cobalt/updater/updater_module.h b/src/cobalt/updater/updater_module.h
index aec4e5f..c441d1d 100644
--- a/src/cobalt/updater/updater_module.h
+++ b/src/cobalt/updater/updater_module.h
@@ -77,6 +77,8 @@
     return updater_configurator_->GetUpdaterStatus();
   }
 
+  void ResetInstallations();
+
  private:
   base::Thread updater_thread_;
   scoped_refptr<update_client::UpdateClient> update_client_;
diff --git a/src/cobalt/updater/utils.cc b/src/cobalt/updater/utils.cc
index dbd2f79..17f0822 100644
--- a/src/cobalt/updater/utils.cc
+++ b/src/cobalt/updater/utils.cc
@@ -23,7 +23,19 @@
 namespace cobalt {
 namespace updater {
 
-bool GetProductDirectory(base::FilePath* path) {
+bool CreateProductDirectory(base::FilePath* path) {
+  if (!GetProductDirectoryPath(path)) {
+    LOG(ERROR) << "Can't get product directory path";
+    return false;
+  }
+  if (!base::CreateDirectory(*path)) {
+    LOG(ERROR) << "Can't create product directory.";
+    return false;
+  }
+  return true;
+}
+
+bool GetProductDirectoryPath(base::FilePath* path) {
 #if defined(OS_WIN)
   constexpr int kPathKey = base::DIR_LOCAL_APP_DATA;
 #elif defined(OS_MACOSX)
@@ -42,12 +54,12 @@
 #if SB_API_VERSION >= 12
   if (!SbSystemGetPath(kSbSystemPathStorageDirectory, storage_dir.data(),
                        kSbFileMaxPath)) {
-    SB_LOG(ERROR) << "GetProductDirectory: Failed to get "
+    SB_LOG(ERROR) << "GetProductDirectoryPath: Failed to get "
                      "kSbSystemPathStorageDirectory";
     return false;
   }
 #else
-  SB_NOTREACHED() << "GetProductDirectory: kSbSystemPathStorageDirectory "
+  SB_NOTREACHED() << "GetProductDirectoryPath: kSbSystemPathStorageDirectory "
                      "is not available before "
                      "starboard version 12";
   return false;
@@ -56,10 +68,6 @@
   base::FilePath app_data_dir(storage_dir.data());
   const auto product_data_dir =
       app_data_dir.AppendASCII(PRODUCT_FULLNAME_STRING);
-  if (!base::CreateDirectory(product_data_dir)) {
-    LOG(ERROR) << "Can't create product directory.";
-    return false;
-  }
 
   *path = product_data_dir;
   return true;
diff --git a/src/cobalt/updater/utils.h b/src/cobalt/updater/utils.h
index 2a71b5c..3ca7793 100644
--- a/src/cobalt/updater/utils.h
+++ b/src/cobalt/updater/utils.h
@@ -16,8 +16,12 @@
 namespace cobalt {
 namespace updater {
 
-// Returns a directory where updater files or its data is stored.
-bool GetProductDirectory(base::FilePath* path);
+// Create a directory where updater files or its data is stored.
+bool CreateProductDirectory(base::FilePath* path);
+
+// Return the path to the product directory where updater files or its data is
+// stored.
+bool GetProductDirectoryPath(base::FilePath* path);
 
 // Returns the Evergreen version of the current installation.
 const std::string GetCurrentEvergreenVersion();
diff --git a/src/cobalt/updater/win/setup/setup.cc b/src/cobalt/updater/win/setup/setup.cc
index 2848c5c..0e00fd8 100644
--- a/src/cobalt/updater/win/setup/setup.cc
+++ b/src/cobalt/updater/win/setup/setup.cc
@@ -68,8 +68,8 @@
     return -1;
   }
   base::FilePath product_dir;
-  if (!GetProductDirectory(&product_dir)) {
-    LOG(ERROR) << "GetProductDirectory failed.";
+  if (!CreateProductDirectory(&product_dir)) {
+    LOG(ERROR) << "CreateProductDirectory failed.";
     return -1;
   }
   base::FilePath exe_path;
diff --git a/src/cobalt/updater/win/setup/uninstall.cc b/src/cobalt/updater/win/setup/uninstall.cc
index 8767e26..c51d2f4 100644
--- a/src/cobalt/updater/win/setup/uninstall.cc
+++ b/src/cobalt/updater/win/setup/uninstall.cc
@@ -46,8 +46,8 @@
   updater::UnregisterUpdateAppsTask();
 
   base::FilePath product_dir;
-  if (!GetProductDirectory(&product_dir)) {
-    LOG(ERROR) << "GetProductDirectory failed.";
+  if (!CreateProductDirectory(&product_dir)) {
+    LOG(ERROR) << "CreateProductDirectory failed.";
     return -1;
   }
 
diff --git a/src/cobalt/webdriver/protocol/moveto.cc b/src/cobalt/webdriver/protocol/moveto.cc
index 210af97..a8a10f9 100644
--- a/src/cobalt/webdriver/protocol/moveto.cc
+++ b/src/cobalt/webdriver/protocol/moveto.cc
@@ -13,6 +13,7 @@
 // limitations under the License.
 
 #include <memory>
+#include <string>
 
 #include "cobalt/webdriver/protocol/moveto.h"
 
@@ -48,9 +49,10 @@
   }
 
   base::Optional<ElementId> element;
-  const base::Value* element_value = NULL;
-  if (dictionary_value->Get(kElementKey, &element_value) && element_value) {
-    element = ElementId::FromValue(element_value);
+  std::string element_id;
+  if (dictionary_value->GetString(kElementKey, &element_id) &&
+      !element_id.empty()) {
+    element = ElementId(element_id);
   }
 
   int xoffset_value = 0;
diff --git a/src/components/update_client/cobalt_slot_management.cc b/src/components/update_client/cobalt_slot_management.cc
new file mode 100644
index 0000000..cc8856e
--- /dev/null
+++ b/src/components/update_client/cobalt_slot_management.cc
@@ -0,0 +1,280 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "components/update_client/cobalt_slot_management.h"
+
+#include "base/values.h"
+#include "cobalt/updater/utils.h"
+#include "components/update_client/utils.h"
+#include "starboard/configuration_constants.h"
+#include "starboard/file.h"
+#include "starboard/loader_app/app_key_files.h"
+#include "starboard/loader_app/drain_file.h"
+
+namespace update_client {
+
+namespace {
+bool CheckBadFileExists(const char* installation_path, const char* app_key) {
+  std::string bad_app_key_file_path =
+      starboard::loader_app::GetBadAppKeyFilePath(installation_path, app_key);
+  SB_DCHECK(!bad_app_key_file_path.empty());
+  SB_LOG(INFO) << "bad_app_key_file_path: " << bad_app_key_file_path;
+  SB_LOG(INFO) << "bad_app_key_file_path SbFileExists: "
+               << SbFileExists(bad_app_key_file_path.c_str());
+  return !bad_app_key_file_path.empty() &&
+         SbFileExists(bad_app_key_file_path.c_str());
+}
+}  // namespace
+
+CobaltSlotManagement::CobaltSlotManagement() : installation_api_(nullptr) {}
+
+bool CobaltSlotManagement::Init(
+    const CobaltExtensionInstallationManagerApi* installation_api) {
+  SB_LOG(INFO) << "CobaltSlotManagement::Init";
+
+  installation_api_ = installation_api;
+
+  // Make sure the index is reset
+  installation_index_ = IM_EXT_INVALID_INDEX;
+  if (!installation_api_) {
+    SB_LOG(ERROR) << "Failed to get installation manager";
+    return false;
+  }
+
+  char app_key[IM_EXT_MAX_APP_KEY_LENGTH];
+  if (installation_api_->GetAppKey(app_key, IM_EXT_MAX_APP_KEY_LENGTH) ==
+      IM_EXT_ERROR) {
+    SB_LOG(ERROR) << "Failed to get app key.";
+    return false;
+  }
+  app_key_ = app_key;
+  return true;
+}
+
+bool CobaltSlotManagement::SelectSlot(base::FilePath* dir) {
+  SB_DCHECK(installation_api_);
+  SB_LOG(INFO) << "CobaltSlotManagement::SelectSlot";
+  int max_slots = installation_api_->GetMaxNumberInstallations();
+  if (max_slots == IM_EXT_ERROR) {
+    SB_LOG(ERROR) << "Failed to get max number of slots";
+    return false;
+  }
+
+  // Default invalid version.
+  base::Version slot_candidate_version;
+  int slot_candidate = -1;
+  base::FilePath slot_candidate_path;
+
+  // Iterate over all writeable slots - index >= 1.
+  for (int i = 1; i < max_slots; i++) {
+    SB_LOG(INFO) << "CobaltSlotManagement::SelectSlot iterating slot=" << i;
+    std::vector<char> installation_path(kSbFileMaxPath);
+    if (installation_api_->GetInstallationPath(i, installation_path.data(),
+                                               installation_path.size()) ==
+        IM_EXT_ERROR) {
+      SB_LOG(ERROR) << "CobaltSlotManagement::SelectSlot: Failed to get "
+                       "installation path for slot="
+                    << i;
+      continue;
+    }
+
+    SB_DLOG(INFO) << "CobaltSlotManagement::SelectSlot: installation_path = "
+                  << installation_path.data();
+
+    base::FilePath installation_dir(
+        std::string(installation_path.begin(), installation_path.end()));
+
+    // Cleanup expired drain files.
+    DrainFileClear(installation_dir.value().c_str(), app_key_.c_str(), true);
+
+    // Cleanup all drain files from the current app.
+    DrainFileRemove(installation_dir.value().c_str(), app_key_.c_str());
+    base::Version version =
+        cobalt::updater::ReadEvergreenVersion(installation_dir);
+    if (!version.IsValid()) {
+      SB_LOG(INFO)
+          << "CobaltSlotManagement::SelectSlot installed version invalid";
+      if (!DrainFileDraining(installation_dir.value().c_str(), "")) {
+        SB_LOG(INFO) << "CobaltSlotManagement::SelectSlot not draining";
+        // Found empty slot.
+        slot_candidate = i;
+        slot_candidate_path = installation_dir;
+        break;
+      } else {
+        // There is active draining from another updater so bail out.
+        SB_LOG(ERROR) << "CobaltSlotManagement::SelectSlot bailing out";
+        return false;
+      }
+    } else if ((!slot_candidate_version.IsValid() ||
+                slot_candidate_version > version)) {
+      if (!DrainFileDraining(installation_dir.value().c_str(), "")) {
+        // Found a slot with older version that's not draining.
+        SB_LOG(INFO) << "CobaltSlotManagement::SelectSlot slot candidate: "
+                     << i;
+        slot_candidate_version = version;
+        slot_candidate = i;
+        slot_candidate_path = installation_dir;
+      } else {
+        // There is active draining from another updater so bail out.
+        SB_LOG(ERROR) << "CobaltSlotManagement::SelectSlot bailing out";
+        return false;
+      }
+    }
+  }
+
+  installation_index_ = slot_candidate;
+  *dir = slot_candidate_path;
+
+  if (installation_index_ == -1 ||
+      !DrainFileTryDrain(dir->value().c_str(), app_key_.c_str())) {
+    SB_LOG(ERROR)
+        << "CobaltSlotManagement::SelectSlot unable to find a slot, candidate="
+        << installation_index_;
+    return false;
+  }
+  return true;
+}
+
+bool CobaltSlotManagement::ConfirmSlot(const base::FilePath& dir) {
+  SB_DCHECK(installation_api_);
+  SB_LOG(INFO) << "CobaltSlotManagement::ConfirmSlot ";
+  if (!DrainFileRankAndCheck(dir.value().c_str(), app_key_.c_str())) {
+    SB_LOG(INFO) << "CobaltSlotManagement::ConfirmSlot: failed to lock slot ";
+    return false;
+  }
+
+  // TODO: Double check the installed_version.
+
+  // Use the installation slot
+  SB_LOG(INFO) << "Resetting the slot: " << installation_index_;
+  if (installation_api_->ResetInstallation(installation_index_) ==
+      IM_EXT_ERROR) {
+    SB_LOG(INFO) << "CobaltSlotManagement::ConfirmSlot: failed to reset slot ";
+    return false;
+  }
+
+  // Remove all files and directories except for our ranking drain file.
+  DrainFilePrepareDirectory(dir.value().c_str(), app_key_.c_str());
+
+  return true;
+}
+
+void CobaltSlotManagement::CleanupAllDrainFiles(const base::FilePath& dir) {
+  if (!dir.empty() && !app_key_.empty()) {
+    DrainFileRemove(dir.value().c_str(), app_key_.c_str());
+  }
+}
+
+int CobaltSlotManagement::GetInstallationIndex() {
+  return installation_index_;
+}
+
+bool CobaltFinishInstallation(
+    const CobaltExtensionInstallationManagerApi* installation_api,
+    int installation_index,
+    const std::string& dir,
+    const std::string& app_key) {
+  std::string good_app_key_file_path =
+      starboard::loader_app::GetGoodAppKeyFilePath(dir, app_key);
+  SB_CHECK(!good_app_key_file_path.empty());
+  if (!starboard::loader_app::CreateAppKeyFile(good_app_key_file_path)) {
+    SB_LOG(WARNING) << "Failed to create good app key file";
+  }
+  DrainFileRemove(dir.c_str(), app_key.c_str());
+  int ret =
+      installation_api->RequestRollForwardToInstallation(installation_index);
+  if (ret == IM_EXT_ERROR) {
+    SB_LOG(ERROR) << "Failed to request roll forward.";
+    return false;
+  }
+  return true;
+}
+
+bool CobaltQuickUpdate(
+    const CobaltExtensionInstallationManagerApi* installation_api,
+    const base::Version& current_version) {
+  if (!current_version.IsValid()) {
+    return false;
+  }
+  char app_key[IM_EXT_MAX_APP_KEY_LENGTH];
+  if (installation_api->GetAppKey(app_key, IM_EXT_MAX_APP_KEY_LENGTH) ==
+      IM_EXT_ERROR) {
+    SB_LOG(ERROR) << "CobaltQuickUpdate: Failed to get app key.";
+    return true;
+  }
+
+  int max_slots = installation_api->GetMaxNumberInstallations();
+  if (max_slots == IM_EXT_ERROR) {
+    SB_LOG(ERROR) << "CobaltQuickUpdate: Failed to get max number of slots.";
+    return true;
+  }
+
+  // We'll find the newest version of the installation that satisfies the
+  // requirements as the final candidate slot.
+  base::Version slot_candidate_version("1.0.1");
+  int slot_candidate = -1;
+
+  // Iterate over all writeable slots - index >= 1.
+  for (int i = 1; i < max_slots; i++) {
+    SB_LOG(INFO) << "CobaltQuickInstallation: iterating slot=" << i;
+    // Get the path to new installation.
+    std::vector<char> installation_path(kSbFileMaxPath);
+    if (installation_api->GetInstallationPath(i, installation_path.data(),
+                                              installation_path.size()) ==
+        IM_EXT_ERROR) {
+      SB_LOG(ERROR) << "CobaltQuickInstallation: Failed to get "
+                    << "installation path for slot=" << i;
+      continue;
+    }
+
+    SB_DLOG(INFO) << "CobaltQuickInstallation: installation_path = "
+                  << installation_path.data();
+
+    base::FilePath installation_dir = base::FilePath(
+        std::string(installation_path.begin(), installation_path.end()));
+
+    base::Version installed_version =
+        cobalt::updater::ReadEvergreenVersion(installation_dir);
+
+    if (!installed_version.IsValid()) {
+      SB_LOG(WARNING) << "CobaltQuickInstallation: invalid version ";
+      continue;
+    } else if (slot_candidate_version < installed_version &&
+               current_version < installed_version &&
+               !DrainFileDraining(installation_dir.value().c_str(), "") &&
+               !CheckBadFileExists(installation_dir.value().c_str(), app_key) &&
+               starboard::loader_app::AnyGoodAppKeyFile(
+                   installation_dir.value().c_str())) {
+      // Found a slot with newer version than the current version that's not
+      // draining, and no bad file of current app exists, and a good file
+      // exists. The final candidate is the newest version of the valid
+      // candidates.
+      SB_LOG(INFO) << "CobaltQuickInstallation: slot candidate: " << i;
+      slot_candidate_version = installed_version;
+      slot_candidate = i;
+    }
+  }
+
+  if (slot_candidate != -1) {
+    if (installation_api->RequestRollForwardToInstallation(slot_candidate) !=
+        IM_EXT_ERROR) {
+      SB_LOG(INFO) << "CobaltQuickInstallation: quick update succeeded.";
+      return true;
+    }
+  }
+  SB_LOG(WARNING) << "CobaltQuickInstallation: quick update failed.";
+  return false;
+}
+
+}  // namespace update_client
diff --git a/src/components/update_client/cobalt_slot_management.h b/src/components/update_client/cobalt_slot_management.h
new file mode 100644
index 0000000..e5d185c
--- /dev/null
+++ b/src/components/update_client/cobalt_slot_management.h
@@ -0,0 +1,81 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COMPONENTS_UPDATE_CLIENT_COBALT_SLOT_MANAGEMENT_H_
+#define COMPONENTS_UPDATE_CLIENT_COBALT_SLOT_MANAGEMENT_H_
+
+#include <string>
+
+#include "base/files/file_path.h"
+#include "base/version.h"
+#include "cobalt/extension/installation_manager.h"
+
+namespace update_client {
+
+// Installation slot management logic for the Cobalt Updater.
+// Multiple apps share the same installation slots on the file
+// system but do keep individual metadata for the slot selection.
+// Locking of the slots is performed through timestamped drain files.
+// And each app marks the slot installation as good by using a
+// good file.
+class CobaltSlotManagement {
+ public:
+  CobaltSlotManagement();
+
+  // Initialize with the |installation_api| extension.
+  bool Init(const CobaltExtensionInstallationManagerApi* installation_api);
+
+  // Selects the slot to use for the installation. The selected |dir| is
+  // populated if the selection was successful.
+  bool SelectSlot(base::FilePath* dir);
+
+  // The slot selection will be confirmed if the function returns true.
+  // The |dir| path will be used to perform the installation.
+  bool ConfirmSlot(const base::FilePath& dir);
+
+  CobaltSlotManagement(const CobaltSlotManagement&) = delete;
+  CobaltSlotManagement& operator=(CobaltSlotManagement&&) = delete;
+  void operator=(const CobaltSlotManagement&) = delete;
+
+  // Returns the selected index for the installation slot.
+  int GetInstallationIndex();
+
+  // Cleanup all drain files of the current app.
+  void CleanupAllDrainFiles(const base::FilePath& dir);
+
+ private:
+  int installation_index_ = IM_EXT_INVALID_INDEX;
+  const CobaltExtensionInstallationManagerApi* installation_api_;
+  std::string app_key_;
+};
+
+// Creates a good file and rolls forward to the installation in
+// the specified |installation_index| and |dir| for the app
+// identified by |app_key|.
+bool CobaltFinishInstallation(
+    const CobaltExtensionInstallationManagerApi* installation_api,
+    int installation_index,
+    const std::string& dir,
+    const std::string& app_key);
+
+// Performs a quick installation for the current app by
+// upgrading it locally to the latest Cobalt version successfully
+// installed by a different app.
+bool CobaltQuickUpdate(
+    const CobaltExtensionInstallationManagerApi* installation_api,
+    const base::Version& current_version);
+
+}  // namespace update_client
+
+#endif  // COMPONENTS_UPDATE_CLIENT_COBALT_SLOT_MANAGEMENT_H_
diff --git a/src/components/update_client/cobalt_slot_management_test.cc b/src/components/update_client/cobalt_slot_management_test.cc
new file mode 100644
index 0000000..46090c8
--- /dev/null
+++ b/src/components/update_client/cobalt_slot_management_test.cc
@@ -0,0 +1,235 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "components/update_client/cobalt_slot_management.h"
+
+#include "base/strings/string_util.h"
+#include "starboard/common/file.h"
+#include "starboard/loader_app/app_key_files.h"
+#include "starboard/loader_app/drain_file.h"
+#include "starboard/loader_app/installation_manager.h"
+#include "starboard/loader_app/system_get_extension_shim.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+#if SB_API_VERSION >= 12
+namespace update_client {
+namespace {
+
+constexpr char kTestAppKey1[] = "test_key1";
+constexpr char kTestAppKey2[] = "test_key2";
+constexpr char kManifestV1[] = R"json({
+  "manifest_version": 2,
+  "name": "Cobalt",
+  "description": "Cobalt",
+  "version": "1.1.0"
+})json";
+
+constexpr char kManifestV2[] = R"json(
+{
+  "manifest_version": 2,
+  "name": "Cobalt",
+  "description": "Cobalt",
+  "version": "1.2.0"
+})json";
+
+class CobaltSlotManagementTest : public testing::Test {
+ protected:
+  virtual void SetUp() override {
+    std::vector<char> buf(kSbFileMaxPath);
+    storage_path_implemented_ = SbSystemGetPath(kSbSystemPathStorageDirectory,
+                                                buf.data(), kSbFileMaxPath);
+    if (!storage_path_implemented_) {
+      return;
+    }
+
+    storage_path_ = buf.data();
+    ASSERT_TRUE(!storage_path_.empty());
+
+    starboard::SbFileDeleteRecursive(storage_path_.c_str(), true);
+    ImInitialize(3, kTestAppKey1);
+    api_ = static_cast<const CobaltExtensionInstallationManagerApi*>(
+        starboard::loader_app::SbSystemGetExtensionShim(
+            kCobaltExtensionInstallationManagerName));
+  }
+
+  virtual void TearDown() override {
+    starboard::SbFileDeleteRecursive(storage_path_.c_str(), true);
+    ImUninitialize();
+  }
+
+  void CreateManifest(const char* slot_path,
+                      const char* data,
+                      size_t data_length) {
+    std::string manifest1_path = storage_path_;
+    manifest1_path += kSbFileSepString;
+    manifest1_path += slot_path;
+    manifest1_path += kSbFileSepString;
+    manifest1_path += "manifest.json";
+
+    ASSERT_TRUE(SbFileAtomicReplace(manifest1_path.c_str(), data, data_length));
+  }
+
+  const CobaltExtensionInstallationManagerApi* api_;
+  bool storage_path_implemented_;
+  std::string storage_path_;
+};
+
+TEST_F(CobaltSlotManagementTest, Init) {
+  if (!storage_path_implemented_) {
+    return;
+  }
+  CobaltSlotManagement cobalt_slot_management;
+  ASSERT_TRUE(cobalt_slot_management.Init(api_));
+}
+
+TEST_F(CobaltSlotManagementTest, NegativeInit) {
+  if (!storage_path_implemented_) {
+    return;
+  }
+  CobaltSlotManagement cobalt_slot_management;
+  ASSERT_FALSE(cobalt_slot_management.Init(nullptr));
+}
+
+TEST_F(CobaltSlotManagementTest, SelectEmptySlot) {
+  if (!storage_path_implemented_) {
+    return;
+  }
+  CobaltSlotManagement cobalt_slot_management;
+  ASSERT_TRUE(cobalt_slot_management.Init(api_));
+  base::FilePath dir;
+  ASSERT_TRUE(cobalt_slot_management.SelectSlot(&dir));
+  ASSERT_TRUE(DrainFileDraining(dir.value().c_str(), kTestAppKey1));
+  ASSERT_TRUE(base::EndsWith(dir.value(), "installation_1",
+                             base::CompareCase::SENSITIVE));
+}
+
+TEST_F(CobaltSlotManagementTest, SelectSlotBailOnDraining) {
+  if (!storage_path_implemented_) {
+    return;
+  }
+
+  CobaltSlotManagement cobalt_slot_management;
+  std::string slot_path = storage_path_;
+  slot_path += kSbFileSepString;
+  slot_path += "installation_1";
+
+  // If there is is non-expired drain file from
+  // different app the current app should bail out.
+  ASSERT_TRUE(DrainFileTryDrain(slot_path.c_str(), kTestAppKey2));
+  ASSERT_TRUE(cobalt_slot_management.Init(api_));
+
+  base::FilePath dir;
+  ASSERT_FALSE(cobalt_slot_management.SelectSlot(&dir));
+}
+
+TEST_F(CobaltSlotManagementTest, SelectMinVersionSlot) {
+  if (!storage_path_implemented_) {
+    return;
+  }
+
+  // In slot 2 create manifest v1.
+  CreateManifest("installation_2", kManifestV1, SbStringGetLength(kManifestV1));
+
+  // In slot 1 create manifest v2.
+  CreateManifest("installation_1", kManifestV2, SbStringGetLength(kManifestV2));
+
+  CobaltSlotManagement cobalt_slot_management;
+  ASSERT_TRUE(cobalt_slot_management.Init(api_));
+  base::FilePath dir;
+  cobalt_slot_management.SelectSlot(&dir);
+  ASSERT_TRUE(DrainFileDraining(dir.value().c_str(), kTestAppKey1));
+  SB_LOG(INFO) << "dir=" << dir;
+
+  ASSERT_TRUE(base::EndsWith(dir.value(), "installation_2",
+                             base::CompareCase::SENSITIVE));
+}
+
+TEST_F(CobaltSlotManagementTest, ConfirmSlot) {
+  if (!storage_path_implemented_) {
+    return;
+  }
+
+  ImRollForward(1);
+  ImDecrementInstallationNumTries(1);
+  ASSERT_LE(ImGetInstallationNumTriesLeft(1), IM_MAX_NUM_TRIES);
+  ImMarkInstallationSuccessful(1);
+  ASSERT_EQ(IM_INSTALLATION_STATUS_SUCCESS, ImGetInstallationStatus(1));
+  CobaltSlotManagement cobalt_slot_management;
+  ASSERT_TRUE(cobalt_slot_management.Init(api_));
+  base::FilePath dir;
+  ASSERT_TRUE(cobalt_slot_management.SelectSlot(&dir));
+  SB_LOG(INFO) << "dir=" << dir;
+
+  ASSERT_TRUE(base::EndsWith(dir.value(), "installation_1",
+                             base::CompareCase::SENSITIVE));
+
+  ASSERT_TRUE(DrainFileDraining(dir.value().c_str(), kTestAppKey1));
+
+  ASSERT_TRUE(cobalt_slot_management.ConfirmSlot(dir));
+
+  ASSERT_EQ(IM_INSTALLATION_STATUS_NOT_SUCCESS, ImGetInstallationStatus(1));
+  ASSERT_EQ(IM_MAX_NUM_TRIES, ImGetInstallationNumTriesLeft(1));
+}
+
+TEST_F(CobaltSlotManagementTest, CobaltFinishInstallation) {
+  std::string slot_path = storage_path_;
+  slot_path += kSbFileSepString;
+  slot_path += "installation_1";
+  std::string good_file_path =
+      starboard::loader_app::GetGoodAppKeyFilePath(slot_path, kTestAppKey1);
+
+  ImRollForward(2);
+
+  // Cleanup pending requests for roll forward.
+  ASSERT_EQ(IM_SUCCESS, ImRollForwardIfNeeded());
+
+  ASSERT_EQ(2, ImGetCurrentInstallationIndex());
+  ASSERT_FALSE(SbFileExists(good_file_path.c_str()));
+  ASSERT_TRUE(CobaltFinishInstallation(api_, 1, slot_path, kTestAppKey1));
+  ASSERT_TRUE(SbFileExists(good_file_path.c_str()));
+  ASSERT_EQ(IM_SUCCESS, ImRollForwardIfNeeded());
+  ASSERT_EQ(1, ImGetCurrentInstallationIndex());
+}
+
+TEST_F(CobaltSlotManagementTest, GoodCobaltQuickUpdate) {
+  // In slot 1 create manifest v1.
+  CreateManifest("installation_1", kManifestV1, SbStringGetLength(kManifestV1));
+
+  // In slot 2 create manifest v2.
+  CreateManifest("installation_2", kManifestV2, SbStringGetLength(kManifestV2));
+
+  // Mark slot 2 good for app 2.
+  std::string slot_path = storage_path_;
+  slot_path += kSbFileSepString;
+  slot_path += "installation_2";
+  std::string good_file_path =
+      starboard::loader_app::GetGoodAppKeyFilePath(slot_path, kTestAppKey2);
+  starboard::loader_app::CreateAppKeyFile(good_file_path);
+  base::Version version("1.1.0");
+  ASSERT_TRUE(CobaltQuickUpdate(api_, version));
+}
+
+TEST_F(CobaltSlotManagementTest, NegativeCobaltQuickUpdateBadVersion) {
+  base::Version version;
+  ASSERT_FALSE(CobaltQuickUpdate(api_, version));
+}
+
+TEST_F(CobaltSlotManagementTest, NegativeCobaltQuickUpdate) {
+  base::Version version("1.0.0");
+  ASSERT_FALSE(CobaltQuickUpdate(api_, version));
+}
+}  // namespace
+
+}  // namespace update_client
+#endif  // SB_API_VERSION >= 12
diff --git a/src/components/update_client/component.cc b/src/components/update_client/component.cc
index 6613a93..df190d0 100644
--- a/src/components/update_client/component.cc
+++ b/src/components/update_client/component.cc
@@ -18,6 +18,11 @@
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/values.h"
 #include "components/update_client/action_runner.h"
+
+#if defined(OS_STARBOARD)
+#include "components/update_client/cobalt_slot_management.h"
+#endif
+
 #include "components/update_client/component_unpacker.h"
 #include "components/update_client/configurator.h"
 #include "components/update_client/network.h"
@@ -32,11 +37,6 @@
 #include "components/update_client/update_engine.h"
 #include "components/update_client/utils.h"
 
-#if defined(OS_STARBOARD)
-#include "starboard/loader_app/app_key_files.h"
-#include "starboard/loader_app/drain_file.h"
-#endif
-
 // The state machine representing how a CRX component changes during an update.
 //
 //     +------------------------- kNew
@@ -155,18 +155,8 @@
       // TODO: add correct error code.
       install_error = InstallError::GENERIC_ERROR;
     } else {
-      std::string good_app_key_file_path =
-          starboard::loader_app::GetGoodAppKeyFilePath(unpack_path.value(),
-                                                       app_key);
-      SB_CHECK(!good_app_key_file_path.empty());
-      if (!starboard::loader_app::CreateAppKeyFile(good_app_key_file_path)) {
-        SB_LOG(WARNING) << "Failed to create good app key file";
-      }
-      DrainFileRemove(unpack_path.value().c_str(), app_key);
-      int ret = installation_api->RequestRollForwardToInstallation(
-          installation_index);
-      if (ret == IM_EXT_ERROR) {
-        SB_LOG(ERROR) << "Failed to request roll forward.";
+      if (!CobaltFinishInstallation(installation_api, installation_index,
+                                    unpack_path.value(), app_key)) {
         // TODO: add correct error code.
         install_error = InstallError::GENERIC_ERROR;
       }
diff --git a/src/components/update_client/crx_downloader.cc b/src/components/update_client/crx_downloader.cc
index 15d1f2a..abe1e3e 100644
--- a/src/components/update_client/crx_downloader.cc
+++ b/src/components/update_client/crx_downloader.cc
@@ -185,7 +185,7 @@
   download_metrics_.push_back(download_metrics);
 
 #if defined(OS_STARBOARD)
-  if (result.error != Error::CRX_DOWNLOADER_ABORT) {
+  if (result.error != static_cast<int>(CrxDownloaderError::SLOT_UNAVAILABLE)) {
 #endif
 
     // If an error has occured, try the next url if there is any,
diff --git a/src/components/update_client/crx_downloader.h b/src/components/update_client/crx_downloader.h
index 621766f..966ee82 100644
--- a/src/components/update_client/crx_downloader.h
+++ b/src/components/update_client/crx_downloader.h
@@ -39,19 +39,6 @@
 // The members of this class expect to be called from the main thread only.
 class CrxDownloader {
  public:
-#if defined(OS_STARBOARD)
-  enum Error {
-    // The download succeeded.
-    CRX_DOWNLOADER_OK = 0,
-
-    // The download failed and should be retried.
-    CRX_DOWNLOADER_RETRY = -1,
-
-    // The download failed and should be aborted.
-    CRX_DOWNLOADER_ABORT = -2,
-  };
-#endif
-
   struct DownloadMetrics {
     enum Downloader { kNone = 0, kUrlFetcher, kBits };
 
diff --git a/src/components/update_client/update_checker.cc b/src/components/update_client/update_checker.cc
index a904a17..c4045f0 100644
--- a/src/components/update_client/update_checker.cc
+++ b/src/components/update_client/update_checker.cc
@@ -25,9 +25,7 @@
 #if defined(OS_STARBOARD)
 #include "cobalt/extension/installation_manager.h"
 #include "cobalt/updater/utils.h"
-#include "starboard/file.h"
-#include "starboard/loader_app/app_key_files.h"
-#include "starboard/loader_app/drain_file.h"
+#include "components/update_client/cobalt_slot_management.h"
 #endif
 #include "components/update_client/component.h"
 #include "components/update_client/configurator.h"
@@ -70,20 +68,6 @@
   return false;
 }
 
-#if defined(OS_STARBOARD)
-
-bool CheckBadFileExists(const char* installation_path, const char* app_key) {
-  std::string bad_app_key_file_path =
-      starboard::loader_app::GetBadAppKeyFilePath(installation_path, app_key);
-  SB_DCHECK(!bad_app_key_file_path.empty());
-  SB_LOG(INFO) << "bad_app_key_file_path: " << bad_app_key_file_path;
-  SB_LOG(INFO) << "bad_app_key_file_path SbFileExists: "
-               << SbFileExists(bad_app_key_file_path.c_str());
-  return !bad_app_key_file_path.empty() &&
-         SbFileExists(bad_app_key_file_path.c_str());
-}
-#endif
-
 // Filters invalid attributes from |installer_attributes|.
 using InstallerAttributesFlatMap = base::flat_map<std::string, std::string>;
 InstallerAttributesFlatMap SanitizeInstallerAttributes(
@@ -247,80 +231,10 @@
       return;
     }
 
-    char app_key[IM_EXT_MAX_APP_KEY_LENGTH];
-    if (installation_api->GetAppKey(app_key, IM_EXT_MAX_APP_KEY_LENGTH) ==
-        IM_EXT_ERROR) {
-      SB_LOG(ERROR) << "Failed to get app key.";
+    if (CobaltQuickUpdate(installation_api, current_version)) {
       return;
     }
 
-    int max_slots = installation_api->GetMaxNumberInstallations();
-    if (max_slots == IM_EXT_ERROR) {
-      SB_LOG(ERROR) << "Failed to get max number of slots.";
-      return;
-    }
-
-    // We'll find the newest version of the installation that satisfies the
-    // requirements as the final candidate slot.
-    base::Version slot_candidate_version("1.0.1");
-    int slot_candidate = -1;
-
-    // Iterate over all writeable slots - index >= 1.
-    for (int i = 1; i < max_slots; i++) {
-      SB_LOG(INFO) << "UpdateCheckerImpl::CheckForUpdatesHelper iterating slot="
-                   << i;
-      // Get the path to new installation.
-      std::vector<char> installation_path(kSbFileMaxPath);
-      if (installation_api->GetInstallationPath(i, installation_path.data(),
-                                                installation_path.size()) ==
-          IM_EXT_ERROR) {
-        SB_LOG(ERROR)
-            << "UpdateCheckerImpl::CheckForUpdatesHelper: Failed to get "
-               "installation path for slot="
-            << i;
-        continue;
-      }
-
-      SB_DLOG(INFO)
-          << "UpdateCheckerImpl::CheckForUpdatesHelper installation_path = "
-          << installation_path.data();
-
-      base::FilePath installation_dir = base::FilePath(
-          std::string(installation_path.begin(), installation_path.end()));
-
-      base::Version installed_version =
-          cobalt::updater::ReadEvergreenVersion(installation_dir);
-
-      if (!installed_version.IsValid()) {
-        continue;
-      } else if (slot_candidate_version < installed_version &&
-                 current_version < installed_version &&
-                 !DrainFileDraining(installation_dir.value().c_str(), "") &&
-                 !CheckBadFileExists(installation_dir.value().c_str(),
-                                     app_key) &&
-                 starboard::loader_app::AnyGoodAppKeyFile(
-                     installation_dir.value().c_str())) {
-        // Found a slot with newer version than the current version that's not
-        // draining, and no bad file of current app exists, and a good file
-        // exists. The final candidate is the newest version of the valid
-        // candidates.
-        SB_LOG(INFO)
-            << "UpdateCheckerImpl::CheckForUpdatesHelper slot candidate: " << i;
-        slot_candidate_version = installed_version;
-        slot_candidate = i;
-      }
-    }
-
-    if (slot_candidate != -1) {
-      if (installation_api->RequestRollForwardToInstallation(slot_candidate) !=
-          IM_EXT_ERROR) {
-        SB_LOG(INFO) << "UpdateCheckerImpl::CheckForUpdatesHelper: quick "
-                        "update succeeded.";
-        return;
-      }
-      SB_LOG(WARNING)
-          << "UpdateCheckerImpl::CheckForUpdatesHelper: quick update failed.";
-    }
 // If the quick roll forward update slot candidate doesn't exist, continue
 // with update check.
 #endif
diff --git a/src/components/update_client/update_client.gyp b/src/components/update_client/update_client.gyp
index c54c314..123932b 100644
--- a/src/components/update_client/update_client.gyp
+++ b/src/components/update_client/update_client.gyp
@@ -21,6 +21,8 @@
         'action_runner.cc',
         'action_runner.h',
         'activity_data_service.h',
+        'cobalt_slot_management.cc',
+        'cobalt_slot_management.h',
         'command_line_config_policy.cc',
         'command_line_config_policy.h',
         'component.cc',
@@ -83,11 +85,13 @@
         'utils.h',
       ],
       'dependencies': [
-        '<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
         '<(DEPTH)/components/crx_file/crx_file.gyp:crx_file',
         '<(DEPTH)/components/client_update_protocol/client_update_protocol.gyp:client_update_protocol',
         '<(DEPTH)/components/prefs/prefs.gyp:prefs',
         '<(DEPTH)/crypto/crypto.gyp:crypto',
+        '<(DEPTH)/starboard/loader_app/app_key_files.gyp:app_key_files',
+        '<(DEPTH)/starboard/loader_app/drain_file.gyp:drain_file',
+        '<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
         '<(DEPTH)/url/url.gyp:url',
       ],
       'defines': [
@@ -181,5 +185,37 @@
       },
       'includes': [ '<(DEPTH)/starboard/build/deploy.gypi' ],
     },
+    {
+      'target_name': 'cobalt_slot_management_test',
+      'type': '<(gtest_target_type)',
+      'sources': [
+        'cobalt_slot_management_test.cc',
+        '<(DEPTH)/cobalt/updater/utils.cc',
+        '<(DEPTH)/starboard/common/test_main.cc',
+        '<(DEPTH)/starboard/loader_app/system_get_extension_shim.cc',
+      ],
+      'dependencies': [
+        ':update_client',
+        '<(DEPTH)/cobalt/base/base.gyp:base',
+        '<(DEPTH)/components/prefs/prefs.gyp:prefs',
+        '<(DEPTH)/components/prefs/prefs.gyp:test_support',
+        '<(DEPTH)/components/crx_file/crx_file.gyp:crx_file',
+        '<(DEPTH)/net/net.gyp:test_support',
+        '<(DEPTH)/starboard/loader_app/installation_manager.gyp:installation_manager',
+        '<(DEPTH)/testing/gmock.gyp:gmock',
+        '<(DEPTH)/testing/gtest.gyp:gtest',
+      ],
+    },
+    {
+      'target_name': 'cobalt_slot_management_test_deploy',
+      'type': 'none',
+      'dependencies': [
+        'cobalt_slot_management_test',
+      ],
+      'variables': {
+        'executable_name': 'cobalt_slot_management_test',
+      },
+      'includes': [ '<(DEPTH)/starboard/build/deploy.gypi' ],
+    },
   ]
 }
diff --git a/src/components/update_client/update_client_errors.h b/src/components/update_client/update_client_errors.h
index 3ee0509..cf2d0db 100644
--- a/src/components/update_client/update_client_errors.h
+++ b/src/components/update_client/update_client_errors.h
@@ -37,6 +37,9 @@
 // the Chrome net stack.
 enum class CrxDownloaderError {
   NONE = 0,
+#if defined(OS_STARBOARD)
+  SLOT_UNAVAILABLE = 9,
+#endif
   NO_URL = 10,
   NO_HASH = 11,
   BAD_HASH = 12,  // The downloaded file fails the hash verification.
diff --git a/src/components/update_client/url_fetcher_downloader.cc b/src/components/update_client/url_fetcher_downloader.cc
index 5ad6863..0890c63 100644
--- a/src/components/update_client/url_fetcher_downloader.cc
+++ b/src/components/update_client/url_fetcher_downloader.cc
@@ -22,11 +22,6 @@
 #include "components/update_client/network.h"
 #include "components/update_client/utils.h"
 
-#if defined(OS_STARBOARD)
-#include "cobalt/updater/utils.h"
-#include "starboard/configuration_constants.h"
-#include "starboard/loader_app/drain_file.h"
-#endif
 
 #include "url/gurl.h"
 
@@ -69,10 +64,6 @@
     scoped_refptr<NetworkFetcherFactory> network_fetcher_factory)
     : CrxDownloader(std::move(successor)),
       network_fetcher_factory_(network_fetcher_factory) {
-#if defined(OS_STARBOARD)
-  installation_api_ = static_cast<const CobaltExtensionInstallationManagerApi*>(
-      SbSystemGetExtension(kCobaltExtensionInstallationManagerName));
-#endif
 }
 
 UrlFetcherDownloader::~UrlFetcherDownloader() {
@@ -81,121 +72,30 @@
 
 #if defined(OS_STARBOARD)
 void UrlFetcherDownloader::ConfirmSlot(const GURL& url) {
-  SB_LOG(INFO) << "UrlFetcherDownloader::ConfirmSlot " << url;
-  if (!DrainFileRankAndCheck(download_dir_.value().c_str(), app_key_.c_str())) {
-    SB_LOG(INFO) << "UrlFetcherDownloader::ConfirmSlot: failed to lock slot ";
-    ReportDownloadFailure(url, CrxDownloader::Error::CRX_DOWNLOADER_ABORT);
+  SB_LOG(INFO) << "UrlFetcherDownloader::ConfirmSlot: url=" << url;
+  if (!cobalt_slot_management_.ConfirmSlot(download_dir_)) {
+    ReportDownloadFailure(url, CrxDownloaderError::SLOT_UNAVAILABLE);
     return;
   }
 
-  // TODO: Double check the installed_version.
-
-  // Use the installation slot
-  if (installation_api_->ResetInstallation(installation_index_) ==
-      IM_EXT_ERROR) {
-    SB_LOG(INFO) << "UrlFetcherDownloader::ConfirmSlot: failed to reset slot ";
-    ReportDownloadFailure(url);
-    return;
-  }
-  // Remove all files and directories except for our ranking drain file.
-  DrainFilePrepareDirectory(download_dir_.value().c_str(), app_key_.c_str());
-
   base::SequencedTaskRunnerHandle::Get()->PostTask(
       FROM_HERE, base::BindOnce(&UrlFetcherDownloader::StartURLFetch,
                                 base::Unretained(this), url));
 }
 
 void UrlFetcherDownloader::SelectSlot(const GURL& url) {
-  SB_LOG(INFO) << "UrlFetcherDownloader::SelectSlot url=" << url;
-  int max_slots = installation_api_->GetMaxNumberInstallations();
-  if (max_slots == IM_EXT_ERROR) {
-    SB_LOG(ERROR) << "Failed to get max number of slots";
-    ReportDownloadFailure(url);
+  SB_LOG(INFO) << "UrlFetcherDownloader::SelectSlot: url=" << url;
+  if (!cobalt_slot_management_.SelectSlot(&download_dir_)) {
+    ReportDownloadFailure(url, CrxDownloaderError::SLOT_UNAVAILABLE);
     return;
   }
 
-  // default invalid version
-  base::Version slot_candidate_version;
-  int slot_candidate = -1;
-  base::FilePath slot_candidate_path;
-
-  // Iterate over all writeable slots - index >= 1.
-  for (int i = 1; i < max_slots; i++) {
-    SB_LOG(INFO) << "UrlFetcherDownloader::SelectSlot iterating slot=" << i;
-    std::vector<char> installation_path(kSbFileMaxPath);
-    if (installation_api_->GetInstallationPath(i, installation_path.data(),
-                                               installation_path.size()) ==
-        IM_EXT_ERROR) {
-      SB_LOG(ERROR) << "UrlFetcherDownloader::SelectSlot: Failed to get "
-                       "installation path for slot="
-                    << i;
-      continue;
-    }
-
-    SB_DLOG(INFO) << "UrlFetcherDownloader::SelectSlot: installation_path = "
-                  << installation_path.data();
-
-    base::FilePath installation_dir(
-        std::string(installation_path.begin(), installation_path.end()));
-
-    // Cleanup expired drain files.
-    DrainFileClear(installation_dir.value().c_str(), app_key_.c_str(), true);
-
-    // Cleanup all drain files from the current app.
-    DrainFileRemove(installation_dir.value().c_str(), app_key_.c_str());
-    base::Version version =
-        cobalt::updater::ReadEvergreenVersion(installation_dir);
-    if (!version.IsValid()) {
-      SB_LOG(INFO)
-          << "UrlFetcherDownloader::SelectSlot installed version invalid";
-      if (!DrainFileDraining(installation_dir.value().c_str(), "")) {
-        SB_LOG(INFO) << "UrlFetcherDownloader::SelectSlot not draining";
-        // found empty slot
-        slot_candidate = i;
-        slot_candidate_path = installation_dir;
-        break;
-      } else {
-        // There is active draining from another updater so bail out.
-        SB_LOG(ERROR) << "UrlFetcherDownloader::SelectSlot bailing out";
-        ReportDownloadFailure(url, CrxDownloader::Error::CRX_DOWNLOADER_ABORT);
-        return;
-      }
-    } else if ((!slot_candidate_version.IsValid() ||
-                slot_candidate_version > version)) {
-      if (!DrainFileDraining(installation_dir.value().c_str(), "")) {
-        // found a slot with older version that's not draining.
-        SB_LOG(INFO) << "UrlFetcherDownloader::SelectSlot slot candidate: "
-                     << i;
-        slot_candidate_version = version;
-        slot_candidate = i;
-        slot_candidate_path = installation_dir;
-      } else {
-        SB_LOG(ERROR) << "UrlFetcherDownloader::SelectSlot bailing out";
-        // There is active draining from another updater so bail out.
-        ReportDownloadFailure(url, CrxDownloader::Error::CRX_DOWNLOADER_ABORT);
-        return;
-      }
-    }
-  }
-
-  installation_index_ = slot_candidate;
-  download_dir_ = slot_candidate_path;
-
-  if (installation_index_ == -1 ||
-      !DrainFileTryDrain(download_dir_.value().c_str(), app_key_.c_str())) {
-    SB_LOG(ERROR)
-        << "UrlFetcherDownloader::SelectSlot unable to find a slot, candidate="
-        << installation_index_;
-    ReportDownloadFailure(url);
-    return;
-  } else {
-    // Use 15 sec delay to allow for other updaters/loaders to settle down.
-    base::SequencedTaskRunnerHandle::Get()->PostDelayedTask(
-        FROM_HERE,
-        base::BindOnce(&UrlFetcherDownloader::ConfirmSlot,
-                       base::Unretained(this), url),
-        base::TimeDelta::FromSeconds(15));
-  }
+  // Use 15 sec delay to allow for other updaters/loaders to settle down.
+  base::SequencedTaskRunnerHandle::Get()->PostDelayedTask(
+      FROM_HERE,
+      base::BindOnce(&UrlFetcherDownloader::ConfirmSlot, base::Unretained(this),
+                     url),
+      base::TimeDelta::FromSeconds(15));
 }
 #endif
 
@@ -203,27 +103,21 @@
   DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
 
 #if defined(OS_STARBOARD)
-  SB_LOG(INFO) << "UrlFetcherDownloader::DoStartDownload url=" << url;
-  // Make sure the index is reset
-  installation_index_ = IM_EXT_INVALID_INDEX;
-  if (!installation_api_) {
+  const CobaltExtensionInstallationManagerApi* installation_api =
+      static_cast<const CobaltExtensionInstallationManagerApi*>(
+          SbSystemGetExtension(kCobaltExtensionInstallationManagerName));
+  if (!installation_api) {
     SB_LOG(ERROR) << "Failed to get installation manager";
     ReportDownloadFailure(url);
     return;
   }
-
-  char app_key[IM_EXT_MAX_APP_KEY_LENGTH];
-  if (installation_api_->GetAppKey(app_key, IM_EXT_MAX_APP_KEY_LENGTH) ==
-      IM_EXT_ERROR) {
-    SB_LOG(ERROR) << "Failed to get app key.";
+  if (!cobalt_slot_management_.Init(installation_api)) {
     ReportDownloadFailure(url);
     return;
   }
-  app_key_ = app_key;
   base::SequencedTaskRunnerHandle::Get()->PostTask(
       FROM_HERE, base::BindOnce(&UrlFetcherDownloader::SelectSlot,
                                 base::Unretained(this), url));
-
 #else
   base::PostTaskWithTraitsAndReply(
       FROM_HERE, kTaskTraits,
@@ -241,24 +135,21 @@
 
 #if defined(OS_STARBOARD)
 void UrlFetcherDownloader::ReportDownloadFailure(const GURL& url) {
-  ReportDownloadFailure(url, CrxDownloader::Error::CRX_DOWNLOADER_RETRY);
+  ReportDownloadFailure(url, CrxDownloaderError::GENERIC_ERROR);
 }
 
 void UrlFetcherDownloader::ReportDownloadFailure(const GURL& url,
-                                                 CrxDownloader::Error error) {
+                                                 CrxDownloaderError error) {
 #else
 void UrlFetcherDownloader::ReportDownloadFailure(const GURL& url) {
 #endif
   DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
 #if defined(OS_STARBOARD)
-  if (!download_dir_.empty() && !app_key_.empty()) {
-    // Cleanup all drain files of the current app.
-    DrainFileRemove(download_dir_.value().c_str(), app_key_.c_str());
-  }
+  cobalt_slot_management_.CleanupAllDrainFiles(download_dir_);
 #endif
   Result result;
 #if defined(OS_STARBOARD)
-  result.error = error;
+  result.error = static_cast<int>(error);
 #else
   result.error = -1;
 #endif
@@ -339,7 +230,7 @@
   if (!error) {
     result.response = file_path;
 #if defined(OS_STARBOARD)
-    result.installation_index = installation_index_;
+    result.installation_index = cobalt_slot_management_.GetInstallationIndex();
 #endif
   }
 
diff --git a/src/components/update_client/url_fetcher_downloader.h b/src/components/update_client/url_fetcher_downloader.h
index 6955711..1f335e9 100644
--- a/src/components/update_client/url_fetcher_downloader.h
+++ b/src/components/update_client/url_fetcher_downloader.h
@@ -15,9 +15,10 @@
 #include "base/threading/thread_checker.h"
 #include "base/time/time.h"
 #include "components/update_client/crx_downloader.h"
+#include "components/update_client/update_client_errors.h"
 
 #if defined(OS_STARBOARD)
-#include "cobalt/extension/installation_manager.h"
+#include "components/update_client/cobalt_slot_management.h"
 #endif
 
 namespace update_client {
@@ -53,7 +54,7 @@
   void OnDownloadProgress(int64_t content_length);
   void ReportDownloadFailure(const GURL& url);
 #if defined(OS_STARBOARD)
-  void ReportDownloadFailure(const GURL& url, CrxDownloader::Error error);
+  void ReportDownloadFailure(const GURL& url, CrxDownloaderError error);
 #endif
 
   THREAD_CHECKER(thread_checker_);
@@ -71,9 +72,7 @@
   int64_t total_bytes_ = -1;
 
 #if defined(OS_STARBOARD)
-  int installation_index_ = IM_EXT_INVALID_INDEX;
-  const CobaltExtensionInstallationManagerApi* installation_api_;
-  std::string app_key_;
+  CobaltSlotManagement cobalt_slot_management_;
 #endif
 
   DISALLOW_COPY_AND_ASSIGN(UrlFetcherDownloader);
diff --git a/src/net/cert/multi_threaded_cert_verifier.cc b/src/net/cert/multi_threaded_cert_verifier.cc
index a513f01..c8fd6fc 100644
--- a/src/net/cert/multi_threaded_cert_verifier.cc
+++ b/src/net/cert/multi_threaded_cert_verifier.cc
@@ -21,6 +21,7 @@
 #include "base/time/time.h"
 #include "base/trace_event/trace_event.h"
 #include "base/values.h"
+#include "nb/memory_scope.h"
 #include "net/base/hash_value.h"
 #include "net/base/net_errors.h"
 #include "net/base/trace_constants.h"
@@ -202,6 +203,7 @@
     int flags,
     const scoped_refptr<CRLSet>& crl_set,
     const CertificateList& additional_trust_anchors) {
+  TRACK_MEMORY_SCOPE("Net");
   TRACE_EVENT0(kNetTracingCategory, "DoVerifyOnWorkerThread");
   auto verify_result = std::make_unique<ResultHelper>();
   MultiThreadedCertVerifierScopedAllowBaseSyncPrimitives
diff --git a/src/starboard/android/apk/build.id b/src/starboard/android/apk/build.id
new file mode 100644
index 0000000..20ae2c6
--- /dev/null
+++ b/src/starboard/android/apk/build.id
@@ -0,0 +1 @@
+277473
\ No newline at end of file
diff --git a/src/starboard/android/shared/audio_sink_min_required_frames_tester.cc b/src/starboard/android/shared/audio_sink_min_required_frames_tester.cc
index ac5815e..a5a77a7 100644
--- a/src/starboard/android/shared/audio_sink_min_required_frames_tester.cc
+++ b/src/starboard/android/shared/audio_sink_min_required_frames_tester.cc
@@ -131,7 +131,6 @@
 
     if (wait_timeout) {
       SB_LOG(ERROR) << "Audio sink min required frames tester timeout.";
-      SB_NOTREACHED();
     }
 
     delete audio_sink_;
diff --git a/src/starboard/doc/evergreen/cobalt_evergreen_overview.md b/src/starboard/doc/evergreen/cobalt_evergreen_overview.md
index 50537e0..dff2965 100644
--- a/src/starboard/doc/evergreen/cobalt_evergreen_overview.md
+++ b/src/starboard/doc/evergreen/cobalt_evergreen_overview.md
@@ -219,6 +219,42 @@
     `PROT_EXEC`) for loading in-memory and performing relocations for Cobalt
     Evergreen binaries
 
+## Building and Running Tests
+
+The `elf_loader_sandbox` binary can be used to run tests in Evergreen mode. This
+is much more lightweight than the `loader_app`, and does not have any knowledge
+about installations or downloading updates.
+
+The `elf_loader_sandbox` is run using two command line switches:
+`--evergreen_library` and `--evergreen_content`. These switches are the path to
+the shared library to be run and the path to that shared library's content.
+These paths should be *relative to the content of the elf_loader_sandbox*.
+
+For example, if we wanted to run the NPLB set of tests and had the following
+directory tree,
+
+```
+.../elf_loader_sandbox
+.../content/app/nplb/lib/libnplb.so
+.../content/app/nplb/content
+```
+
+we would use the following command to run NPLB:
+
+```
+.../elf_loader_sandbox --evergreen_library=app/nplb/lib/libcobalt.so
+                       --evergreen_content=app/nplb/content
+```
+
+Building tests is identical to how they are already built except that a
+different platform configuration must be used. The platform configuration should
+be an Evergreen platform configuration, and have a Starboard ABI file that
+matches the file used by the platform configuration used to build the
+`elf_loader_sandbox`.
+
+For example, building these targets for the Raspberry Pi 2 would use the
+`raspi-2` and `evergreen-arm-hardfp` platform configurations.
+
 ## Verifying Platform Requirements
 
 In order to verify the platform requirements you should run the
@@ -377,6 +413,7 @@
 ```
 .
 ├── content <--(kSbSystemPathContentDirectory)
+│   └── fonts <--(kSbSystemPathFontDirectory, to be explained below)
 │   └── app
 │       └── cobalt <--(SLOT_0)
 │           ├── content <--(relative path defined in kSystemImageContentPath)
@@ -431,8 +468,9 @@
 ### Fonts
 The system font directory `kSbSystemPathFontDirectory` should be configured to
 point to the `standard` (23MB) or the `limited` (3.1MB) cobalt font packages. An
-easy way to do that is to use the `loader_app/content` directory and setting the
-`cobalt_font_package` to `standard` or `limited` in your port.
+easy way to do that is to use the `kSbSystemPathContentDirectory` to contain
+the system font directory and setting the `cobalt_font_package` to `standard` or
+`limited` in your port.
 
 Cobalt Evergreen (built by Google), will by default use the `minimal` font
 package which is around 16KB to minimize storage requirements. A separate
@@ -442,12 +480,12 @@
 
 `minimal` set of fonts under:
 ```
-<kSbSystemPathContentDirectory>/fonts/
+<kSbSystemPathContentDirectory>/app/cobalt/content/fonts
 ```
 
 `standard` or `limited` set of fonts under:
 ```
-loader_app/content/fonts
+<kSbSystemPathContentDirectory>/fonts
 ```
 
 ### ICU Tables
@@ -468,6 +506,16 @@
 <SLOT_#>/content/icu
 ```
 
+### Handling Pending Updates
+Pending updates will be picked up on the next application start, which means
+that on platforms that support suspending the platform should check
+`loader_app::IsPendingRestart` and call `SbSystemRequestStop` instead of
+ suspending if there is a pending restart.
+
+Please see
+[`suspend_signals.cc`](https://cobalt.googlesource.com/cobalt/+/refs/heads/master/src/starboard/shared/signal/suspend_signals.cc)
+for an example.
+
 ### Multi-App Support
 Evergreen can support multiple apps that share a Cobalt binary. This is a very
 common way to save space and keep all your Cobalt apps using the latest version
diff --git a/src/starboard/evergreen/shared/gyp_configuration.py b/src/starboard/evergreen/shared/gyp_configuration.py
index ead5082..71c24c4 100644
--- a/src/starboard/evergreen/shared/gyp_configuration.py
+++ b/src/starboard/evergreen/shared/gyp_configuration.py
@@ -102,6 +102,7 @@
 
   def GetTestTargets(self):
     tests = super(EvergreenConfiguration, self).GetTestTargets()
+    tests.append('cobalt_slot_management_test')
     return [test for test in tests if test not in self.__FORBIDDEN_TESTS]
 
   __FORBIDDEN_TESTS = [  # pylint: disable=invalid-name
diff --git a/src/starboard/evergreen/shared/launcher.py b/src/starboard/evergreen/shared/launcher.py
index 41f46c7..7b981fa 100644
--- a/src/starboard/evergreen/shared/launcher.py
+++ b/src/starboard/evergreen/shared/launcher.py
@@ -23,6 +23,7 @@
 from starboard.tools import port_symlink
 
 _BASE_STAGING_DIRECTORY = 'evergreen_staging'
+_CRASHPAD_TARGET = 'crashpad_handler'
 _LOADER_TARGET = 'elf_loader_sandbox'
 
 
@@ -162,6 +163,9 @@
     shutil.copytree(
         os.path.join(self.loader_out_directory, 'deploy', _LOADER_TARGET),
         staging_directory_loader)
+    shutil.copy(
+        os.path.join(self.loader_out_directory, 'deploy', _CRASHPAD_TARGET,
+                     _CRASHPAD_TARGET), staging_directory_loader)
 
     port_symlink.MakeSymLink(
         os.path.join(self.out_directory, 'deploy', self.target_name),
@@ -173,6 +177,9 @@
         os.path.join(staging_directory_loader, _LOADER_TARGET),
         os.path.join(self.staging_directory, _LOADER_TARGET))
     port_symlink.MakeSymLink(
+        os.path.join(staging_directory_loader, _CRASHPAD_TARGET),
+        os.path.join(self.staging_directory, _CRASHPAD_TARGET))
+    port_symlink.MakeSymLink(
         os.path.join(staging_directory_loader, 'content'),
         os.path.join(self.staging_directory, 'content'))
 
diff --git a/src/starboard/linux/shared/starboard_platform.gypi b/src/starboard/linux/shared/starboard_platform.gypi
index 406d495..dee26cf 100644
--- a/src/starboard/linux/shared/starboard_platform.gypi
+++ b/src/starboard/linux/shared/starboard_platform.gypi
@@ -456,6 +456,7 @@
       ['sb_evergreen_compatible == 1', {
         'starboard_platform_dependencies': [
           '<(DEPTH)/starboard/elf_loader/evergreen_config.gyp:evergreen_config',
+          '<(DEPTH)/starboard/loader_app/pending_restart.gyp:pending_restart',
           '<(DEPTH)/third_party/llvm-project/libunwind/libunwind.gyp:unwind_starboard',
        ]},
       ],
diff --git a/src/starboard/linux/x64x11/main.cc b/src/starboard/linux/x64x11/main.cc
index cdb21c5..0c7dcfb 100644
--- a/src/starboard/linux/x64x11/main.cc
+++ b/src/starboard/linux/x64x11/main.cc
@@ -20,11 +20,17 @@
 #include "starboard/shared/starboard/link_receiver.h"
 #include "starboard/shared/x11/application_x11.h"
 
+#include "third_party/crashpad/wrapper/wrapper.h"
+
 extern "C" SB_EXPORT_PLATFORM int main(int argc, char** argv) {
   tzset();
   starboard::shared::signal::InstallCrashSignalHandlers();
   starboard::shared::signal::InstallSuspendSignalHandlers();
 
+#if SB_IS(EVERGREEN_COMPATIBLE)
+  third_party::crashpad::wrapper::InstallCrashpadHandler();
+#endif
+
 #if SB_HAS_QUIRK(BACKTRACE_DLOPEN_BUG)
   // Call backtrace() once to work around potential
   // crash bugs in glibc, in dlopen()
diff --git a/src/starboard/loader_app/installation_manager.cc b/src/starboard/loader_app/installation_manager.cc
index 2e1cd50..9325c94 100644
--- a/src/starboard/loader_app/installation_manager.cc
+++ b/src/starboard/loader_app/installation_manager.cc
@@ -26,6 +26,7 @@
 #include "starboard/directory.h"
 #include "starboard/file.h"
 #include "starboard/loader_app/installation_store.pb.h"
+#include "starboard/loader_app/pending_restart.h"
 #include "starboard/once.h"
 #include "starboard/string.h"
 
@@ -579,6 +580,10 @@
                   << installation_store_.ByteSize();
     return false;
   }
+
+  loader_app::SetPendingRestart(
+      installation_store_.roll_forward_to_installation() != -1);
+
   installation_store_.SerializeToArray(buf, installation_store_.ByteSize());
 
 #if SB_API_VERSION >= 12
diff --git a/src/starboard/loader_app/installation_manager.gyp b/src/starboard/loader_app/installation_manager.gyp
index 6e8af54..93dba9b 100644
--- a/src/starboard/loader_app/installation_manager.gyp
+++ b/src/starboard/loader_app/installation_manager.gyp
@@ -35,6 +35,7 @@
       'dependencies': [
         ':installation_store_proto',
         '<(DEPTH)/starboard/starboard.gyp:starboard',
+        '<(DEPTH)/starboard/loader_app/pending_restart.gyp:pending_restart',
       ],
       'include_dirs': [
         # Get protobuf headers from the chromium tree.
@@ -46,6 +47,7 @@
       'type': '<(gtest_target_type)',
       'sources': [
         'installation_manager_test.cc',
+        'pending_restart_test.cc',
         '<(DEPTH)/starboard/common/test_main.cc',
       ],
       'dependencies': [
diff --git a/src/starboard/loader_app/installation_manager_test.cc b/src/starboard/loader_app/installation_manager_test.cc
index 519586c..168241c 100644
--- a/src/starboard/loader_app/installation_manager_test.cc
+++ b/src/starboard/loader_app/installation_manager_test.cc
@@ -21,7 +21,7 @@
 #include "starboard/loader_app/installation_store.pb.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if SB_API_VERSION >= 12
+#if SB_IS(EVERGREEN_COMPATIBLE)
 
 #define NUMBER_INSTALLS_PARAMS ::testing::Values(2, 3, 4, 5, 6)
 
@@ -629,4 +629,4 @@
 }  // namespace loader_app
 }  // namespace starboard
 
-#endif  // SB_API_VERSION >= 12
+#endif  // SB_IS(EVERGREEN_COMPATIBLE)
diff --git a/src/starboard/loader_app/pending_restart.cc b/src/starboard/loader_app/pending_restart.cc
new file mode 100644
index 0000000..2e48954
--- /dev/null
+++ b/src/starboard/loader_app/pending_restart.cc
@@ -0,0 +1,35 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "starboard/loader_app/pending_restart.h"
+
+#include "starboard/atomic.h"
+
+namespace starboard {
+namespace loader_app {
+
+namespace {
+SbAtomic32 g_pending_restart = 0;
+}  // namesapce
+
+bool IsPendingRestart() {
+  return SbAtomicNoBarrier_Load(&g_pending_restart) == 1;
+}
+
+void SetPendingRestart(bool value) {
+  SbAtomicNoBarrier_Store(&g_pending_restart, value ? 1 : 0);
+}
+
+}  // namespace loader_app
+}  // namespace starboard
diff --git a/src/starboard/loader_app/pending_restart.gyp b/src/starboard/loader_app/pending_restart.gyp
new file mode 100644
index 0000000..090e61d
--- /dev/null
+++ b/src/starboard/loader_app/pending_restart.gyp
@@ -0,0 +1,26 @@
+# Copyright 2020 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{
+  'targets': [
+    {
+      'target_name': 'pending_restart',
+      'type': 'static_library',
+      'sources': [
+        'pending_restart.h',
+        'pending_restart.cc',
+       ],
+    },
+  ],
+}
diff --git a/src/starboard/loader_app/pending_restart.h b/src/starboard/loader_app/pending_restart.h
new file mode 100644
index 0000000..40eac67
--- /dev/null
+++ b/src/starboard/loader_app/pending_restart.h
@@ -0,0 +1,31 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef STARBOARD_LOADER_APP_PENDING_RESTART_H_
+#define STARBOARD_LOADER_APP_PENDING_RESTART_H_
+
+namespace starboard {
+namespace loader_app {
+
+// Checks whether there is a pending restart.
+// The function is signal-safe to call.
+bool IsPendingRestart();
+
+// Set the pending restart flag.
+void SetPendingRestart(bool value);
+
+}  // namespace loader_app
+}  // namespace starboard
+
+#endif  // STARBOARD_LOADER_APP_PENDING_RESTART_H_
diff --git a/src/starboard/loader_app/pending_restart_test.cc b/src/starboard/loader_app/pending_restart_test.cc
new file mode 100644
index 0000000..1a07dff
--- /dev/null
+++ b/src/starboard/loader_app/pending_restart_test.cc
@@ -0,0 +1,52 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "starboard/loader_app/pending_restart.h"
+
+#include "starboard/loader_app/installation_manager.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+#if SB_IS(EVERGREEN_COMPATIBLE)
+namespace starboard {
+namespace loader_app {
+namespace {
+
+class PendingRestartTest : public testing::Test {
+ protected:
+  void SetUp() override { ImInitialize(3, "app_key"); }
+
+  void TearDown() override { ImUninitialize(); }
+};
+
+TEST_F(PendingRestartTest, PendingRestartIfNeeded) {
+  ASSERT_FALSE(IsPendingRestart());
+  ImRequestRollForwardToInstallation(1);
+  ASSERT_TRUE(IsPendingRestart());
+  ImRollForwardIfNeeded();
+  ASSERT_FALSE(IsPendingRestart());
+}
+
+TEST_F(PendingRestartTest, PendingRestart) {
+  ASSERT_FALSE(IsPendingRestart());
+  ImRequestRollForwardToInstallation(1);
+  ASSERT_TRUE(IsPendingRestart());
+  ImRollForward(2);
+  ASSERT_FALSE(IsPendingRestart());
+}
+
+}  // namespace
+
+}  // namespace loader_app
+}  // namespace starboard
+#endif  //  SB_IS(EVERGREEN_COMPATIBLE)
diff --git a/src/starboard/loader_app/slot_management.cc b/src/starboard/loader_app/slot_management.cc
index 3b576ab..9e1eadd 100644
--- a/src/starboard/loader_app/slot_management.cc
+++ b/src/starboard/loader_app/slot_management.cc
@@ -24,6 +24,7 @@
 #include "starboard/loader_app/drain_file.h"
 #include "starboard/loader_app/installation_manager.h"
 #include "starboard/string.h"
+#include "third_party/crashpad/wrapper/wrapper.h"
 
 namespace starboard {
 namespace loader_app {
@@ -232,6 +233,16 @@
       }
     }
 
+    EvergreenInfo evergreen_info;
+    GetEvergreenInfo(&evergreen_info);
+    if (!third_party::crashpad::wrapper::AddEvergreenInfoToCrashpad(
+            evergreen_info)) {
+      SB_LOG(ERROR)
+          << "Could not send Cobalt library information into Crashapd.";
+    } else {
+      SB_LOG(INFO) << "Loaded Cobalt library information into Crashpad.";
+    }
+
     SB_DLOG(INFO) << "Successfully loaded Cobalt!\n";
     void* p = library_loader->Resolve("SbEventHandle");
     if (p != NULL) {
diff --git a/src/starboard/loader_app/slot_management_test.cc b/src/starboard/loader_app/slot_management_test.cc
index 4b7ea49..0eeb83c 100644
--- a/src/starboard/loader_app/slot_management_test.cc
+++ b/src/starboard/loader_app/slot_management_test.cc
@@ -26,7 +26,7 @@
 #include "starboard/loader_app/installation_store.pb.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if SB_API_VERSION >= 12
+#if SB_IS(EVERGREEN_COMPATIBLE)
 
 namespace starboard {
 namespace loader_app {
@@ -270,4 +270,4 @@
 }  // namespace
 }  // namespace loader_app
 }  // namespace starboard
-#endif  // #if SB_API_VERSION >= 12
+#endif  // #if SB_IS(EVERGREEN_COMPATIBLE)
diff --git a/src/starboard/raspi/shared/main.cc b/src/starboard/raspi/shared/main.cc
index 385071f..41d52da 100644
--- a/src/starboard/raspi/shared/main.cc
+++ b/src/starboard/raspi/shared/main.cc
@@ -19,10 +19,17 @@
 #include "starboard/shared/signal/crash_signals.h"
 #include "starboard/shared/signal/suspend_signals.h"
 
+#include "third_party/crashpad/wrapper/wrapper.h"
+
 int main(int argc, char** argv) {
   tzset();
+
   starboard::shared::signal::InstallCrashSignalHandlers();
   starboard::shared::signal::InstallSuspendSignalHandlers();
+
+#if SB_IS(EVERGREEN_COMPATIBLE)
+  third_party::crashpad::wrapper::InstallCrashpadHandler();
+#endif
   starboard::raspi::shared::ApplicationDispmanx application;
   int result = application.Run(argc, argv);
   starboard::shared::signal::UninstallSuspendSignalHandlers();
diff --git a/src/starboard/raspi/shared/starboard_platform.gypi b/src/starboard/raspi/shared/starboard_platform.gypi
index 220c8fa..b59ef51 100644
--- a/src/starboard/raspi/shared/starboard_platform.gypi
+++ b/src/starboard/raspi/shared/starboard_platform.gypi
@@ -425,6 +425,7 @@
         ['sb_evergreen_compatible == 1', {
           'dependencies': [
             '<(DEPTH)/starboard/elf_loader/evergreen_config.gyp:evergreen_config',
+            '<(DEPTH)/starboard/loader_app/pending_restart.gyp:pending_restart',
             '<(DEPTH)/third_party/llvm-project/libunwind/libunwind.gyp:unwind_starboard',
           ],},
         ],
diff --git a/src/starboard/shared/signal/suspend_signals.cc b/src/starboard/shared/signal/suspend_signals.cc
index d5a0ace..e58e065 100644
--- a/src/starboard/shared/signal/suspend_signals.cc
+++ b/src/starboard/shared/signal/suspend_signals.cc
@@ -25,6 +25,10 @@
 #include "starboard/shared/starboard/application.h"
 #include "starboard/system.h"
 
+#if SB_IS(EVERGREEN_COMPATIBLE)
+#include "starboard/loader_app/pending_restart.h"
+#endif
+
 namespace starboard {
 namespace shared {
 namespace signal {
@@ -54,10 +58,26 @@
   ::sigaction(signal_id, &action, NULL);
 }
 
+#if SB_IS(EVERGREEN_COMPATIBLE)
+void RequestSuspendOrStop() {
+  if (loader_app::IsPendingRestart()) {
+    SbLogRawFormatF("\nPending update restart . Stopping.\n");
+    SbLogFlush();
+    SbSystemRequestStop(0);
+  } else {
+    SbSystemRequestSuspend();
+  }
+}
+#endif
+
 void Suspend(int signal_id) {
   SignalMask(kAllSignals, SIG_BLOCK);
   LogSignalCaught(signal_id);
+#if SB_IS(EVERGREEN_COMPATIBLE)
+  RequestSuspendOrStop();
+#else
   SbSystemRequestSuspend();
+#endif
   SignalMask(kAllSignals, SIG_UNBLOCK);
 }
 
diff --git a/src/starboard/shared/starboard/player/filter/testing/video_decoder_test.cc b/src/starboard/shared/starboard/player/filter/testing/video_decoder_test.cc
index 570ec86..c15eab4 100644
--- a/src/starboard/shared/starboard/player/filter/testing/video_decoder_test.cc
+++ b/src/starboard/shared/starboard/player/filter/testing/video_decoder_test.cc
@@ -343,6 +343,10 @@
           *continue_process = false;
           return;
         }
+        if (fixture_.GetDecodedFramesCount() >=
+            fixture_.video_decoder()->GetMaxNumberOfCachedFrames()) {
+          fixture_.PopDecodedFrame();
+        }
         *continue_process = event.status != Status::kBufferFull;
       });
   ASSERT_FALSE(error_occurred);
@@ -363,6 +367,10 @@
             *continue_process = false;
             return;
           }
+          if (fixture_.GetDecodedFramesCount() >=
+              fixture_.video_decoder()->GetMaxNumberOfCachedFrames()) {
+            fixture_.PopDecodedFrame();
+          }
           *continue_process = event.status != Status::kBufferFull;
         });
     ASSERT_FALSE(error_occurred);
diff --git a/src/starboard/tools/testing/test_runner.py b/src/starboard/tools/testing/test_runner.py
index 2336438..e6ca771 100755
--- a/src/starboard/tools/testing/test_runner.py
+++ b/src/starboard/tools/testing/test_runner.py
@@ -43,6 +43,7 @@
 _TESTS_FAILED_REGEX = re.compile(r"^\[  FAILED  \] (.*) tests?, listed below:")
 _SINGLE_TEST_FAILED_REGEX = re.compile(r"^\[  FAILED  \] (.*)")
 
+_CRASHPAD_TARGET = "crashpad_handler"
 _LOADER_TARGET = "elf_loader_sandbox"
 
 
@@ -706,7 +707,7 @@
       # tests so we need to build it separately.
       if self.loader_platform:
         build_tests.BuildTargets(
-            [_LOADER_TARGET], self.loader_out_directory, self.dry_run,
+            [_LOADER_TARGET, _CRASHPAD_TARGET], self.loader_out_directory, self.dry_run,
             extra_flags + [os.getenv('TEST_RUNNER_PLATFORM_BUILD_FLAGS', '')])
       build_tests.BuildTargets(
           self.test_targets, self.out_directory, self.dry_run,
diff --git a/src/third_party/aom_includes/METATDATA b/src/third_party/aom_includes/METATDATA
new file mode 100644
index 0000000..8bf729a
--- /dev/null
+++ b/src/third_party/aom_includes/METATDATA
@@ -0,0 +1,16 @@
+name: "aom_includes"
+description:
+  "libaom is an AV1 codec library. aom_includes contains the header files "
+  "necessary for the library to be dynamically linked into crosstool builds."
+third_party {
+  url {
+    type: GIT
+    value: "https://aomedia.googlesource.com/aom"
+  }
+  version: "d14c5bb4f336ef1842046089849dee4a301fbbf0"
+  last_upgrade_date {
+    year: 2018
+    month: 6
+    day: 25
+  }
+}
diff --git a/src/third_party/blink/METADATA b/src/third_party/blink/METADATA
new file mode 100644
index 0000000..a84f45f
--- /dev/null
+++ b/src/third_party/blink/METADATA
@@ -0,0 +1,20 @@
+name: "blink"
+description:
+  "Blink is a browser engine used by Chromium. Cobalt uses Blink for its IDL "
+  "parser and bindings generation."
+third_party {
+  url {
+    type: GIT
+    value: "https://chromium.googlesource.com/chromium/blink"
+  }
+  # When Blink was initially added to Cobalt, its version was not specified.
+  # The information below was determined by manually tracking down the point
+  # where the initial state of Cobalt's blink Source/bindings and Tools/Scripts
+  # directories had no diffs from those of Chromium's.
+  version: "dcb6aa9bef3b496069e234ed4dc52d1e8c636776"
+  last_upgrade_date {
+    year: 2014
+    month: 11
+    day: 4
+  }
+}
diff --git a/src/third_party/crashpad/handler/crash_report_upload_thread.cc b/src/third_party/crashpad/handler/crash_report_upload_thread.cc
index e144bdd..ac0f7c1 100644
--- a/src/third_party/crashpad/handler/crash_report_upload_thread.cc
+++ b/src/third_party/crashpad/handler/crash_report_upload_thread.cc
@@ -241,6 +241,9 @@
                                   Metrics::CrashSkippedReason::kUploadFailed);
       break;
   }
+#if defined(STARBOARD)
+  database_->DeleteReport(report.uuid);
+#endif
 }
 
 CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport(
diff --git a/src/third_party/crashpad/handler/handler.gyp b/src/third_party/crashpad/handler/handler.gyp
index 2080d97..effe9e1 100644
--- a/src/third_party/crashpad/handler/handler.gyp
+++ b/src/third_party/crashpad/handler/handler.gyp
@@ -100,6 +100,17 @@
         }],
       ],
     },
+    {
+      'target_name': 'crashpad_handler_deploy',
+      'type': 'none',
+      'dependencies': [
+        'crashpad_handler',
+      ],
+      'variables': {
+        'executable_name': 'crashpad_handler',
+      },
+      'includes': ['<(DEPTH)/starboard/build/deploy.gypi'],
+    },
   ],
   'conditions': [
     ['OS=="win"', {
diff --git a/src/third_party/crashpad/util/net/http_transport_socket.cc b/src/third_party/crashpad/util/net/http_transport_socket.cc
index eda3451..5a88ccd 100644
--- a/src/third_party/crashpad/util/net/http_transport_socket.cc
+++ b/src/third_party/crashpad/util/net/http_transport_socket.cc
@@ -19,6 +19,8 @@
 #include <poll.h>
 #include <sys/socket.h>
 
+#include <vector>
+
 #include "base/logging.h"
 #include "base/macros.h"
 #include "base/numerics/safe_conversions.h"
@@ -38,6 +40,11 @@
 #include <openssl/ssl.h>
 #endif
 
+#if defined(STARBOARD)
+#include "starboard/configuration_constants.h"
+#include "starboard/system.h"
+#endif
+
 namespace crashpad {
 
 namespace {
@@ -123,7 +130,27 @@
         return false;
       }
     } else {
-#if defined(OS_LINUX)
+#if defined(STARBOARD)
+      std::vector<char> buffer(kSbFileMaxPath);
+      bool result = SbSystemGetPath(
+          kSbSystemPathContentDirectory, buffer.data(), buffer.size());
+      if (!result) {
+        LOG(ERROR) << "SSL_CTX_load_verify_locations";
+        return false;
+      }
+
+      std::string cert_location(buffer.data());
+      cert_location.append(std::string(kSbFileSepString) + "app" +
+                           kSbFileSepString + "cobalt" + kSbFileSepString +
+                           "content" + kSbFileSepString + "ssl" +
+                           kSbFileSepString + "certs");
+
+      if (SSL_CTX_load_verify_locations(
+              ctx_.get(), nullptr, cert_location.c_str()) <= 0) {
+        LOG(ERROR) << "SSL_CTX_load_verify_locations";
+        return false;
+      }
+#elif defined(OS_LINUX)
       if (SSL_CTX_load_verify_locations(
               ctx_.get(), nullptr, "/etc/ssl/certs") <= 0) {
         LOG(ERROR) << "SSL_CTX_load_verify_locations";
diff --git a/src/third_party/crashpad/wrapper/wrapper.cc b/src/third_party/crashpad/wrapper/wrapper.cc
index 6cd90d6..8b8a18d 100644
--- a/src/third_party/crashpad/wrapper/wrapper.cc
+++ b/src/third_party/crashpad/wrapper/wrapper.cc
@@ -14,10 +14,12 @@
 
 #include "third_party/crashpad/wrapper/wrapper.h"
 
+#include <map>
 #include <vector>
 
 #include "base/files/file_path.h"
 #include "base/logging.h"
+#include "base/strings/stringprintf.h"
 #include "client/crash_report_database.h"
 #include "client/crashpad_client.h"
 #include "client/settings.h"
@@ -59,15 +61,15 @@
 }
 
 base::FilePath GetDatabasePath() {
-  std::vector<char> temp_directory_path(kSbFileMaxPath);
-  if (!SbSystemGetPath(kSbSystemPathTempDirectory,
-                       temp_directory_path.data(),
+  std::vector<char> cache_directory_path(kSbFileMaxPath);
+  if (!SbSystemGetPath(kSbSystemPathCacheDirectory,
+                       cache_directory_path.data(),
                        kSbFileMaxPath)) {
     LOG(ERROR) << "Couldn't retrieve path to database directory";
     return base::FilePath("");
   }
 
-  std::string crashpad_directory_path(temp_directory_path.data());
+  std::string crashpad_directory_path(cache_directory_path.data());
   crashpad_directory_path.push_back(kSbFileSepChar);
   crashpad_directory_path.append("crashpad_database");
   if (!SbDirectoryCreate(crashpad_directory_path.c_str())) {
@@ -93,6 +95,84 @@
 #endif
 }
 
+std::map<std::string, std::string> GetPlatformInfo() {
+  std::map<std::string, std::string> platform_info;
+
+  platform_info.insert({"starboard_version",
+                        base::StringPrintf("Starboard/%d", SB_API_VERSION)});
+
+  const size_t kSystemPropertyMaxLength = 1024;
+  std::vector<char> value(kSystemPropertyMaxLength);
+  bool result;
+
+#if SB_API_VERSION >= 12
+  result = SbSystemGetProperty(kSbSystemPropertySystemIntegratorName,
+                               value.data(),
+                               kSystemPropertyMaxLength);
+#elif SB_API_VERSION == 11
+  result = SbSystemGetProperty(kSbSystemPropertyOriginalDesignManufacturerName,
+                               value.data(),
+                               kSystemPropertyMaxLength);
+#else
+  result = SbSystemGetProperty(kSbSystemPropertyNetworkOperatorName,
+                               value.data(),
+                               kSystemPropertyMaxLength);
+#endif
+  if (result) {
+    platform_info.insert({"system_integrator_name", value.data()});
+  }
+
+#if defined(STARBOARD_BUILD_TYPE_DEBUG)
+  platform_info.insert({"build_configuration", "debug"});
+#elif defined(STARBOARD_BUILD_TYPE_DEVEL)
+  platform_info.insert({"build_configuration", "devel"});
+#elif defined(STARBOARD_BUILD_TYPE_QA)
+  platform_info.insert({"build_configuration", "qa"});
+#elif defined(STARBOARD_BUILD_TYPE_GOLD)
+  platform_info.insert({"build_configuration", "gold"});
+#endif
+
+  result = SbSystemGetProperty(kSbSystemPropertyUserAgentAuxField,
+                               value.data(),
+                               kSystemPropertyMaxLength);
+  if (result) {
+    platform_info.insert({"aux_field", value.data()});
+  }
+
+  result = SbSystemGetProperty(kSbSystemPropertyChipsetModelNumber,
+                               value.data(),
+                               kSystemPropertyMaxLength);
+  if (result) {
+    platform_info.insert({"chipset_model_number", value.data()});
+  }
+
+  result = SbSystemGetProperty(
+      kSbSystemPropertyModelYear, value.data(), kSystemPropertyMaxLength);
+  if (result) {
+    platform_info.insert({"model_year", value.data()});
+  }
+
+  result = SbSystemGetProperty(
+      kSbSystemPropertyFirmwareVersion, value.data(), kSystemPropertyMaxLength);
+  if (result) {
+    platform_info.insert({"firmware_version", value.data()});
+  }
+
+  result = SbSystemGetProperty(
+      kSbSystemPropertyBrandName, value.data(), kSystemPropertyMaxLength);
+  if (result) {
+    platform_info.insert({"brand", value.data()});
+  }
+
+  result = SbSystemGetProperty(
+      kSbSystemPropertyModelName, value.data(), kSystemPropertyMaxLength);
+  if (result) {
+    platform_info.insert({"model", value.data()});
+  }
+
+  return platform_info;
+}
+
 }  // namespace
 
 void InstallCrashpadHandler() {
@@ -102,10 +182,13 @@
   const base::FilePath database_directory_path = GetDatabasePath();
   const base::FilePath default_metrics_dir;
   const std::string product_name = GetProductName();
-  const std::map<std::string, std::string> default_annotations = {
+  std::map<std::string, std::string> default_annotations = {
       {"ver", kCrashpadVersion}, {"prod", product_name}};
   const std::vector<std::string> default_arguments = {};
 
+  const std::map<std::string, std::string> platform_info = GetPlatformInfo();
+  default_annotations.insert(platform_info.begin(), platform_info.end());
+
   InitializeCrashpadDatabase(database_directory_path);
   client->SetUnhandledSignals({});
   client->StartHandler(handler_path,
diff --git a/src/third_party/de265_includes/METADATA b/src/third_party/de265_includes/METADATA
new file mode 100644
index 0000000..9a85eed
--- /dev/null
+++ b/src/third_party/de265_includes/METADATA
@@ -0,0 +1,17 @@
+name: "de265_includes"
+description:
+  "libde265 is an h.265 video codec library; it adds HEVC support to Cobalt. "
+  "This directory contains the necessary header files; the include files come "
+  "from the installed package."
+third_party {
+  url {
+    type: GIT
+    value: "https://github.com/strukturag/libde265"
+  }
+  version: "7f848e2e257d7a29e2a73c7f4950ef596804789d"
+  last_upgrade_date {
+    year: 2018
+    month: 4
+    day: 18
+  }
+}
diff --git a/src/third_party/ffmpeg_includes/METADATA b/src/third_party/ffmpeg_includes/METADATA
new file mode 100644
index 0000000..77aaba5
--- /dev/null
+++ b/src/third_party/ffmpeg_includes/METADATA
@@ -0,0 +1,27 @@
+name: "ffmpeg_includes"
+description:
+  "ffmpeg is a software project consisting of various libraries and programs "
+  "for recording, converting, and streaming audio and video. libav, not to be "
+  "confused with a software system of the same name that underlies ffmpeg "
+  "itself, is a project that was forked from ffmpeg in 2011, and also provides "
+  "cross-platform tools and libraries to convert and manipulate a range of "
+  "multimedia formats and protocols. "
+  "Not all systems build Cobalt binaries with the same version of libavcodec, "
+  "which causes issues when building a binary on one system but running on "
+  "another. ffmpeg_includes contains the header files of the different "
+  "versions required, so that there are no unresolved dependencies."
+third_party {
+  # url for ffmpeg
+  url {
+    type: GIT
+    value: "https://git.ffmpeg.org/ffmpeg.git"
+  }
+  # url for libav
+  url {
+    type: GIT
+    value: "git://git.libav.org/libav"
+  }
+  # Note: "version" and "last_upgrade_date" for the version contained in each
+  # sub-directory is unknown. The version specified in the sub-directory name
+  # corresponds to the version of libavcodec, not the version of ffmpeg/libav.
+}
diff --git a/src/third_party/google_benchmark/METADATA b/src/third_party/google_benchmark/METADATA
new file mode 100644
index 0000000..be8140a
--- /dev/null
+++ b/src/third_party/google_benchmark/METADATA
@@ -0,0 +1,21 @@
+name: "google_benchmark"
+description:
+  "Benchmark is a Google library that benchmarks code snippets, similar to "
+  "unit tests. Cobalt currently enables Benchmark on Linux and Android to "
+  "benchmark memory and thread usage."
+third_party {
+  url {
+    type: LOCAL_SOURCE
+    value: "/third_party/google_benchmark_mirror"
+  }
+  url {
+    type: GIT
+    value: "https://github.com/google/benchmark"
+  }
+  version: "367119482ff4abc3d73e4a109b410090fc281337"
+  last_upgrade_date {
+    year: 2019
+    month: 12
+    day: 2
+  }
+}
diff --git a/src/third_party/googletest/METADATA b/src/third_party/googletest/METADATA
new file mode 100644
index 0000000..5f4faaa
--- /dev/null
+++ b/src/third_party/googletest/METADATA
@@ -0,0 +1,13 @@
+name: "googletest"
+description:
+  "Google Test is Google's C++ test framework. The code in this directory is "
+  "currently only a header file used to redirect Chromium gtest_prod consumer "
+  "code to where Cobalt puts it, and is only used by V8."
+third_party {
+  # Note: Because this directory only includes a header file that simply
+  # redirects code, there is no "version" or "last_upgrade_date" available.
+  url {
+    type: GIT
+    value: "https://github.com/google/googletest"
+  }
+}
diff --git a/src/third_party/harfbuzz-ng/METADATA b/src/third_party/harfbuzz-ng/METADATA
new file mode 100644
index 0000000..edbbd96
--- /dev/null
+++ b/src/third_party/harfbuzz-ng/METADATA
@@ -0,0 +1,18 @@
+name: "harfbuzz-ng"
+description:
+  "HarfBuzz (also formerly known as harfbuzz-ng) is a text shaping library and "
+  "a dependency of Cobalt's layout engine."
+third_party {
+  # Note: This library was added to Cobalt from Chromium, but the information
+  # below reflects that of the original source code.
+  url {
+    type: GIT
+    value: "https://github.com/harfbuzz/harfbuzz"
+  }
+  version: "b24e93e3a4d98111c4684fa08e9080b471881d5c"
+  last_upgrade_date {
+    year: 2015
+    month: 11
+    day: 24
+  }
+}
diff --git a/src/third_party/jinja2/METADATA b/src/third_party/jinja2/METADATA
new file mode 100644
index 0000000..b84b654
--- /dev/null
+++ b/src/third_party/jinja2/METADATA
@@ -0,0 +1,17 @@
+name: "jinja2"
+description:
+  "jinja is a templating language for Python. It is a dependency for Cobalt's "
+  "IDL parser."
+third_party {
+  # Note: This library was added to Cobalt from Chromium, but the information
+  # below reflects that of the original source code.
+  url {
+    type: ARCHIVE
+    value: "https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.1.tar.gz"
+  }
+  last_upgrade_date {
+    year: 2013
+    month: 8
+    day: 7
+  }
+}
diff --git a/src/third_party/libdav1d/METATDATA b/src/third_party/libdav1d/METATDATA
new file mode 100644
index 0000000..02d0cea
--- /dev/null
+++ b/src/third_party/libdav1d/METATDATA
@@ -0,0 +1,20 @@
+name: "libdav1d"
+description:
+  "Subtree at third_party/libdav1d."
+  "dav1d is an AV1 cross-platform decoder focused on speed and correctness."
+third_party {
+  url {
+    type: LOCAL_SOURCE
+    value: "/third_party/libdav1d_mirror"
+  }
+  url {
+    type: GIT
+    value: "https://code.videolan.org/videolan/dav1d"
+  }
+  version: "39667c751d427e447cbe8be783cfecd296659e24"
+  last_upgrade_date {
+    year: 2019
+    month: 12
+    day: 2
+  }
+}
diff --git a/src/third_party/libevent/METADATA b/src/third_party/libevent/METADATA
new file mode 100644
index 0000000..4662aab
--- /dev/null
+++ b/src/third_party/libevent/METADATA
@@ -0,0 +1,18 @@
+name: "libevent"
+description:
+  "libevent is a library that is used for asynchronous event notification "
+  "in Cobalt."
+third_party {
+  # Note: This library was added to Cobalt from Chromium, but the information
+  # below reflects that of the original source code.
+  url {
+    type: GIT
+    value: "https://github.com/libevent/libevent.git"
+  }
+  version: "3e9aad72214519ac2ad6f5f023af48136d0dd50d"
+  last_upgrade_date {
+    year: 2015
+    month: 1
+    day: 5
+  }
+}
diff --git a/src/third_party/libjpeg-turbo/METADATA b/src/third_party/libjpeg-turbo/METADATA
new file mode 100644
index 0000000..3c7d44e
--- /dev/null
+++ b/src/third_party/libjpeg-turbo/METADATA
@@ -0,0 +1,20 @@
+name: "libjpeg-turbo"
+description:
+  "libjpeg-turbo is a SIMD-accelerated libjpeg-compatible JPEG codec library. "
+  "It was added to Cobalt to eventually enable screencasting for DevTools."
+third_party {
+  url {
+    type: GIT
+    value: "https://github.com/libjpeg-turbo/libjpeg-turbo"
+  }
+  # Note: We initially added a version of libjpeg-turbo that was in between
+  # versions 2.0.0 and 1.5.91. The version and last upgrade date below should
+  # reflect the point in between those two versions when the library was first
+  # brought into Cobalt.
+  version: "1a85fc497db85e1bf8b026d51cf6e5dec391d224"
+  last_upgrade_date {
+    year: 2018
+    month: 5
+    day: 21
+  }
+}
diff --git a/src/third_party/libpng/METADATA b/src/third_party/libpng/METADATA
new file mode 100644
index 0000000..fc75d8c
--- /dev/null
+++ b/src/third_party/libpng/METADATA
@@ -0,0 +1,16 @@
+name: "libpng"
+description:
+  "libpng is the official PNG reference library. Cobalt uses libpng for "
+  "encoding and decoding PNG images."
+third_party {
+  url {
+    type: GIT
+    value: "git://git.code.sf.net/p/libpng/code"
+  }
+  version: "3341f519f40bc1309367e3c543303a0a518f5c5d"
+  last_upgrade_date {
+    year: 2011
+    month: 7
+    day: 7
+  }
+}
diff --git a/src/third_party/libvpx/.mailmap b/src/third_party/libvpx/.mailmap
deleted file mode 100644
index 4672e5c..0000000
--- a/src/third_party/libvpx/.mailmap
+++ /dev/null
@@ -1,32 +0,0 @@
-Adrian Grange <agrange@google.com>
-Aℓex Converse <aconverse@google.com>
-Aℓex Converse <aconverse@google.com> <alex.converse@gmail.com>
-Alexis Ballier <aballier@gentoo.org> <alexis.ballier@gmail.com>
-Alpha Lam <hclam@google.com> <hclam@chromium.org>
-Deb Mukherjee <debargha@google.com>
-Erik Niemeyer <erik.a.niemeyer@intel.com> <erik.a.niemeyer@gmail.com>
-Guillaume Martres <gmartres@google.com> <smarter3@gmail.com>
-Hangyu Kuang <hkuang@google.com>
-Hui Su <huisu@google.com>
-Jacky Chen <jackychen@google.com>
-Jim Bankoski <jimbankoski@google.com>
-Johann Koenig <johannkoenig@google.com>
-Johann Koenig <johannkoenig@google.com> <johann.koenig@duck.com>
-Johann Koenig <johannkoenig@google.com> <johann.koenig@gmail.com>
-John Koleszar <jkoleszar@google.com>
-Joshua Litt <joshualitt@google.com> <joshualitt@chromium.org>
-Marco Paniconi <marpan@google.com>
-Marco Paniconi <marpan@google.com> <marpan@chromium.org>
-Pascal Massimino <pascal.massimino@gmail.com>
-Paul Wilkins <paulwilkins@google.com>
-Ralph Giles <giles@xiph.org> <giles@entropywave.com>
-Ralph Giles <giles@xiph.org> <giles@mozilla.com>
-Ronald S. Bultje <rsbultje@gmail.com> <rbultje@google.com>
-Sami Pietilä <samipietila@google.com>
-Tamar Levy <tamar.levy@intel.com>
-Tamar Levy <tamar.levy@intel.com> <levytamar82@gmail.com>
-Tero Rintaluoma <teror@google.com> <tero.rintaluoma@on2.com>
-Timothy B. Terriberry <tterribe@xiph.org> Tim Terriberry <tterriberry@mozilla.com>
-Tom Finegan <tomfinegan@google.com>
-Tom Finegan <tomfinegan@google.com> <tomfinegan@chromium.org>
-Yaowu Xu <yaowu@google.com> <yaowu@xuyaowu.com>
diff --git a/src/third_party/libvpx/AUTHORS b/src/third_party/libvpx/AUTHORS
deleted file mode 100644
index f89b677..0000000
--- a/src/third_party/libvpx/AUTHORS
+++ /dev/null
@@ -1,134 +0,0 @@
-# This file is automatically generated from the git commit history
-# by tools/gen_authors.sh.
-
-Aaron Watry <awatry@gmail.com>
-Abo Talib Mahfoodh <ab.mahfoodh@gmail.com>
-Adam Xu <adam@xuyaowu.com>
-Adrian Grange <agrange@google.com>
-Aℓex Converse <aconverse@google.com>
-Ahmad Sharif <asharif@google.com>
-Alexander Voronov <avoronov@graphics.cs.msu.ru>
-Alexis Ballier <aballier@gentoo.org>
-Alok Ahuja <waveletcoeff@gmail.com>
-Alpha Lam <hclam@google.com>
-A.Mahfoodh <ab.mahfoodh@gmail.com>
-Ami Fischman <fischman@chromium.org>
-Andoni Morales Alastruey <ylatuya@gmail.com>
-Andres Mejia <mcitadel@gmail.com>
-Andrew Russell <anrussell@google.com>
-Angie Chiang <angiebird@google.com>
-Aron Rosenberg <arosenberg@logitech.com>
-Attila Nagy <attilanagy@google.com>
-Brion Vibber <bvibber@wikimedia.org>
-changjun.yang <changjun.yang@intel.com>
-Charles 'Buck' Krasic <ckrasic@google.com>
-chm <chm@rock-chips.com>
-Christian Duvivier <cduvivier@google.com>
-Daniel Kang <ddkang@google.com>
-Deb Mukherjee <debargha@google.com>
-Dim Temp <dimtemp0@gmail.com>
-Dmitry Kovalev <dkovalev@google.com>
-Dragan Mrdjan <dmrdjan@mips.com>
-Ed Baker <edward.baker@intel.com>
-Ehsan Akhgari <ehsan.akhgari@gmail.com>
-Erik Niemeyer <erik.a.niemeyer@intel.com>
-Fabio Pedretti <fabio.ped@libero.it>
-Frank Galligan <fgalligan@google.com>
-Fredrik Söderquist <fs@opera.com>
-Fritz Koenig <frkoenig@google.com>
-Gaute Strokkenes <gaute.strokkenes@broadcom.com>
-Geza Lore <gezalore@gmail.com>
-Ghislain MARY <ghislainmary2@gmail.com>
-Giuseppe Scrivano <gscrivano@gnu.org>
-Gordana Cmiljanovic <gordana.cmiljanovic@imgtec.com>
-Guillaume Martres <gmartres@google.com>
-Guillermo Ballester Valor <gbvalor@gmail.com>
-Hangyu Kuang <hkuang@google.com>
-Hanno Böck <hanno@hboeck.de>
-Henrik Lundin <hlundin@google.com>
-Hui Su <huisu@google.com>
-Ivan Maltz <ivanmaltz@google.com>
-Jacek Caban <cjacek@gmail.com>
-Jacky Chen <jackychen@google.com>
-James Berry <jamesberry@google.com>
-James Yu <james.yu@linaro.org>
-James Zern <jzern@google.com>
-Jan Gerber <j@mailb.org>
-Jan Kratochvil <jan.kratochvil@redhat.com>
-Janne Salonen <jsalonen@google.com>
-Jeff Faust <jfaust@google.com>
-Jeff Muizelaar <jmuizelaar@mozilla.com>
-Jeff Petkau <jpet@chromium.org>
-Jia Jia <jia.jia@linaro.org>
-Jim Bankoski <jimbankoski@google.com>
-Jingning Han <jingning@google.com>
-Joey Parrish <joeyparrish@google.com>
-Johann Koenig <johannkoenig@google.com>
-John Koleszar <jkoleszar@google.com>
-Johnny Klonaris <google@jawknee.com>
-John Stark <jhnstrk@gmail.com>
-Joshua Bleecher Snyder <josh@treelinelabs.com>
-Joshua Litt <joshualitt@google.com>
-Julia Robson <juliamrobson@gmail.com>
-Justin Clift <justin@salasaga.org>
-Justin Lebar <justin.lebar@gmail.com>
-KO Myung-Hun <komh@chollian.net>
-Lawrence Velázquez <larryv@macports.org>
-Lou Quillio <louquillio@google.com>
-Luca Barbato <lu_zero@gentoo.org>
-Makoto Kato <makoto.kt@gmail.com>
-Mans Rullgard <mans@mansr.com>
-Marco Paniconi <marpan@google.com>
-Mark Mentovai <mark@chromium.org>
-Martin Ettl <ettl.martin78@googlemail.com>
-Martin Storsjo <martin@martin.st>
-Matthew Heaney <matthewjheaney@chromium.org>
-Michael Kohler <michaelkohler@live.com>
-Mike Frysinger <vapier@chromium.org>
-Mike Hommey <mhommey@mozilla.com>
-Mikhal Shemer <mikhal@google.com>
-Minghai Shang <minghai@google.com>
-Morton Jonuschat <yabawock@gmail.com>
-Nico Weber <thakis@chromium.org>
-Parag Salasakar <img.mips1@gmail.com>
-Pascal Massimino <pascal.massimino@gmail.com>
-Patrik Westin <patrik.westin@gmail.com>
-Paul Wilkins <paulwilkins@google.com>
-Pavol Rusnak <stick@gk2.sk>
-Paweł Hajdan <phajdan@google.com>
-Pengchong Jin <pengchong@google.com>
-Peter de Rivaz <peter.derivaz@gmail.com>
-Philip Jägenstedt <philipj@opera.com>
-Priit Laes <plaes@plaes.org>
-Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
-Rafaël Carré <funman@videolan.org>
-Ralph Giles <giles@xiph.org>
-Rob Bradford <rob@linux.intel.com>
-Ronald S. Bultje <rsbultje@gmail.com>
-Rui Ueyama <ruiu@google.com>
-Sami Pietilä <samipietila@google.com>
-Scott Graham <scottmg@chromium.org>
-Scott LaVarnway <slavarnway@google.com>
-Sean McGovern <gseanmcg@gmail.com>
-Sergey Ulanov <sergeyu@chromium.org>
-Shimon Doodkin <helpmepro1@gmail.com>
-Shunyao Li <shunyaoli@google.com>
-Stefan Holmer <holmer@google.com>
-Suman Sunkara <sunkaras@google.com>
-Taekhyun Kim <takim@nvidia.com>
-Takanori MATSUURA <t.matsuu@gmail.com>
-Tamar Levy <tamar.levy@intel.com>
-Tao Bai <michaelbai@chromium.org>
-Tero Rintaluoma <teror@google.com>
-Thijs Vermeir <thijsvermeir@gmail.com>
-Tim Kopp <tkopp@google.com>
-Timothy B. Terriberry <tterribe@xiph.org>
-Tom Finegan <tomfinegan@google.com>
-Vignesh Venkatasubramanian <vigneshv@google.com>
-Yaowu Xu <yaowu@google.com>
-Yongzhe Wang <yongzhe@google.com>
-Yunqing Wang <yunqingwang@google.com>
-Zoe Liu <zoeliu@google.com>
-Google Inc.
-The Mozilla Foundation
-The Xiph.Org Foundation
diff --git a/src/third_party/libvpx/BUILD.gn b/src/third_party/libvpx/BUILD.gn
deleted file mode 100644
index 2e8535a..0000000
--- a/src/third_party/libvpx/BUILD.gn
+++ /dev/null
@@ -1,163 +0,0 @@
-# Copyright 2017 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-libvpx_source = "//third_party/libvpx"
-
-static_library("libvpx") {
-  # This list was generated by running configure and then
-  # make libvpx_srcs.txt
-  sources = [
-    "platforms/linux-x64/vp9_rtcd.h",
-    "platforms/linux-x64/vpx_config.c",
-    "platforms/linux-x64/vpx_config.h",
-    "platforms/linux-x64/vpx_dsp_rtcd.h",
-    "platforms/linux-x64/vpx_scale_rtcd.h",
-    "platforms/linux-x64/vpx_version.h",
-    "vp9/common/vp9_alloccommon.c",
-    "vp9/common/vp9_alloccommon.h",
-    "vp9/common/vp9_blockd.c",
-    "vp9/common/vp9_blockd.h",
-    "vp9/common/vp9_common.h",
-    "vp9/common/vp9_common_data.c",
-    "vp9/common/vp9_common_data.h",
-    "vp9/common/vp9_debugmodes.c",
-    "vp9/common/vp9_entropy.c",
-    "vp9/common/vp9_entropy.h",
-    "vp9/common/vp9_entropymode.c",
-    "vp9/common/vp9_entropymode.h",
-    "vp9/common/vp9_entropymv.c",
-    "vp9/common/vp9_entropymv.h",
-    "vp9/common/vp9_enums.h",
-    "vp9/common/vp9_filter.c",
-    "vp9/common/vp9_filter.h",
-    "vp9/common/vp9_frame_buffers.c",
-    "vp9/common/vp9_frame_buffers.h",
-    "vp9/common/vp9_idct.c",
-    "vp9/common/vp9_idct.h",
-    "vp9/common/vp9_loopfilter.c",
-    "vp9/common/vp9_loopfilter.h",
-    "vp9/common/vp9_mv.h",
-    "vp9/common/vp9_mvref_common.c",
-    "vp9/common/vp9_mvref_common.h",
-    "vp9/common/vp9_onyxc_int.h",
-    "vp9/common/vp9_ppflags.h",
-    "vp9/common/vp9_pred_common.c",
-    "vp9/common/vp9_pred_common.h",
-    "vp9/common/vp9_quant_common.c",
-    "vp9/common/vp9_quant_common.h",
-    "vp9/common/vp9_reconinter.c",
-    "vp9/common/vp9_reconinter.h",
-    "vp9/common/vp9_reconintra.c",
-    "vp9/common/vp9_reconintra.h",
-    "vp9/common/vp9_rtcd.c",
-    "vp9/common/vp9_scale.c",
-    "vp9/common/vp9_scale.h",
-    "vp9/common/vp9_scan.c",
-    "vp9/common/vp9_scan.h",
-    "vp9/common/vp9_seg_common.c",
-    "vp9/common/vp9_seg_common.h",
-    "vp9/common/vp9_textblit.h",
-    "vp9/common/vp9_thread_common.c",
-    "vp9/common/vp9_thread_common.h",
-    "vp9/common/vp9_tile_common.c",
-    "vp9/common/vp9_tile_common.h",
-    "vp9/common/x86/vp9_idct_intrin_sse2.c",
-    "vp9/decoder/vp9_decodeframe.c",
-    "vp9/decoder/vp9_decodeframe.h",
-    "vp9/decoder/vp9_decodemv.c",
-    "vp9/decoder/vp9_decodemv.h",
-    "vp9/decoder/vp9_decoder.c",
-    "vp9/decoder/vp9_decoder.h",
-    "vp9/decoder/vp9_detokenize.c",
-    "vp9/decoder/vp9_detokenize.h",
-    "vp9/decoder/vp9_dsubexp.c",
-    "vp9/decoder/vp9_dsubexp.h",
-    "vp9/decoder/vp9_dthread.c",
-    "vp9/decoder/vp9_dthread.h",
-    "vp9/vp9_dx_iface.c",
-    "vp9/vp9_dx_iface.h",
-    "vp9/vp9_iface_common.h",
-    "vpx/internal/vpx_codec_internal.h",
-    "vpx/internal/vpx_psnr.h",
-    "vpx/src/vpx_codec.c",
-    "vpx/src/vpx_decoder.c",
-    "vpx/src/vpx_encoder.c",
-    "vpx/src/vpx_image.c",
-    "vpx/src/vpx_psnr.c",
-    "vpx/vp8.h",
-    "vpx/vp8dx.h",
-    "vpx/vpx_codec.h",
-    "vpx/vpx_decoder.h",
-    "vpx/vpx_encoder.h",
-    "vpx/vpx_frame_buffer.h",
-    "vpx/vpx_image.h",
-    "vpx/vpx_integer.h",
-    "vpx_dsp/add_noise.c",
-    "vpx_dsp/bitreader.c",
-    "vpx_dsp/bitreader.h",
-    "vpx_dsp/bitreader_buffer.c",
-    "vpx_dsp/bitreader_buffer.h",
-    "vpx_dsp/intrapred.c",
-    "vpx_dsp/inv_txfm.c",
-    "vpx_dsp/inv_txfm.h",
-    "vpx_dsp/loopfilter.c",
-    "vpx_dsp/prob.c",
-    "vpx_dsp/prob.h",
-    "vpx_dsp/txfm_common.h",
-    "vpx_dsp/variance.c",
-    "vpx_dsp/variance.h",
-    "vpx_dsp/vpx_convolve.c",
-    "vpx_dsp/vpx_convolve.h",
-    "vpx_dsp/vpx_dsp_common.h",
-    "vpx_dsp/vpx_dsp_rtcd.c",
-    "vpx_dsp/vpx_filter.h",
-    "vpx_dsp/x86/convolve.h",
-    "vpx_dsp/x86/loopfilter_sse2.c",
-    "vpx_dsp/x86/vpx_asm_stubs.c",
-    "vpx_mem/include/vpx_mem_intrnl.h",
-    "vpx_mem/vpx_mem.c",
-    "vpx_mem/vpx_mem.h",
-    "vpx_ports/bitops.h",
-    "vpx_ports/emmintrin_compat.h",
-    "vpx_ports/mem.h",
-    "vpx_ports/mem_ops.h",
-    "vpx_ports/mem_ops_aligned.h",
-    "vpx_ports/msvc.h",
-    "vpx_ports/system_state.h",
-    "vpx_ports/vpx_once.h",
-    "vpx_ports/vpx_timer.h",
-    "vpx_ports/x86.h",
-    "vpx_scale/generic/gen_scalers.c",
-    "vpx_scale/generic/vpx_scale.c",
-    "vpx_scale/generic/yv12config.c",
-    "vpx_scale/generic/yv12extend.c",
-    "vpx_scale/vpx_scale.h",
-    "vpx_scale/vpx_scale_rtcd.c",
-    "vpx_scale/yv12config.h",
-    "vpx_util/endian_inl.h",
-    "vpx_util/vpx_thread.c",
-    "vpx_util/vpx_thread.h",
-  ]
-
-  include_dirs = [
-    "$libvpx_source",
-    "$libvpx_source/platforms/linux-x64",
-    "$libvpx_source/vpx_mem/memory_manager/include/",
-  ]
-
-  # Always optimize libvpx at max optimization.
-  # Debug performance is too slow.
-  configs -= [ "//starboard/build/config:default_optimizations" ]
-  configs += [ "//starboard/build/config:full_optimizations" ]
-}
diff --git a/src/third_party/libvpx/CHANGELOG b/src/third_party/libvpx/CHANGELOG
deleted file mode 100644
index 7db420e..0000000
--- a/src/third_party/libvpx/CHANGELOG
+++ /dev/null
@@ -1,628 +0,0 @@
-Next Release
-  - Incompatible changes:
-    The VP9 encoder's default keyframe interval changed to 128 from 9999.
-
-2015-11-09 v1.5.0 "Javan Whistling Duck"
-  This release improves upon the VP9 encoder and speeds up the encoding and
-  decoding processes.
-
-  - Upgrading:
-    This release is ABI incompatible with 1.4.0. It drops deprecated VP8
-    controls and adds a variety of VP9 controls for testing.
-
-    The vpxenc utility now prefers VP9 by default.
-
-  - Enhancements:
-    Faster VP9 encoding and decoding
-    Smaller library size by combining functions used by VP8 and VP9
-
-  - Bug Fixes:
-    A variety of fuzzing issues
-
-2015-04-03 v1.4.0 "Indian Runner Duck"
-  This release includes significant improvements to the VP9 codec.
-
-  - Upgrading:
-    This release is ABI incompatible with 1.3.0. It drops the compatibility
-    layer, requiring VPX_IMG_FMT_* instead of IMG_FMT_*, and adds several codec
-    controls for VP9.
-
-  - Enhancements:
-    Faster VP9 encoding and decoding
-    Multithreaded VP9 decoding (tile and frame-based)
-    Multithreaded VP9 encoding - on by default
-    YUV 4:2:2 and 4:4:4 support in VP9
-    10 and 12bit support in VP9
-    64bit ARM support by replacing ARM assembly with intrinsics
-
-  - Bug Fixes:
-    Fixes a VP9 bitstream issue in Profile 1. This only affected non-YUV 4:2:0
-    files.
-
-  - Known Issues:
-    Frame Parallel decoding fails for segmented and non-420 files.
-
-2013-11-15 v1.3.0 "Forest"
-  This release introduces the VP9 codec in a backward-compatible way.
-  All existing users of VP8 can continue to use the library without
-  modification. However, some VP8 options do not map to VP9 in the same manner.
-
-  The VP9 encoder in this release is not feature complete. Users interested in
-  the encoder are advised to use the git master branch and discuss issues on
-  libvpx mailing lists.
-
-  - Upgrading:
-    This release is ABI and API compatible with Duclair (v1.0.0). Users
-    of older releases should refer to the Upgrading notes in this document
-    for that release.
-
-  - Enhancements:
-      Get rid of bashisms in the main build scripts
-      Added usage info on command line options
-      Add lossless compression mode
-      Dll build of libvpx
-      Add additional Mac OS X targets: 10.7, 10.8 and 10.9 (darwin11-13)
-      Add option to disable documentation
-      configure: add --enable-external-build support
-      make: support V=1 as short form of verbose=yes
-      configure: support mingw-w64
-      configure: support hardfloat armv7 CHOSTS
-      configure: add support for android x86
-      Add estimated completion time to vpxenc
-      Don't exit on decode errors in vpxenc
-      vpxenc: support scaling prior to encoding
-      vpxdec: support scaling output
-      vpxenc: improve progress indicators with --skip
-      msvs: Don't link to winmm.lib
-      Add a new script for producing vcxproj files
-      Produce Visual Studio 10 and 11 project files
-      Produce Windows Phone project files
-      msvs-build: use msbuild for vs >= 2005
-      configure: default configure log to config.log
-      Add encoding option --static-thresh
-
-  - Speed:
-      Miscellaneous speed optimizations for VP8 and VP9.
-
-  - Quality:
-      In general, quality is consistent with the Eider release.
-
-  - Bug Fixes:
-      This release represents approximately a year of engineering effort,
-      and contains multiple bug fixes. Please refer to git history for details.
-
-
-2012-12-21 v1.2.0
-  This release acts as a checkpoint for a large amount of internal refactoring
-  and testing. It also contains a number of small bugfixes, so all users are
-  encouraged to upgrade.
-
-  - Upgrading:
-    This release is ABI and API compatible with Duclair (v1.0.0). Users
-    of older releases should refer to the Upgrading notes in this
-    document for that release.
-
-  - Enhancements:
-      VP8 optimizations for MIPS dspr2
-      vpxenc: add -quiet option
-
-  - Speed:
-      Encoder and decoder speed is consistent with the Eider release.
-
-  - Quality:
-      In general, quality is consistent with the Eider release.
-
-      Minor tweaks to ARNR filtering
-      Minor improvements to real time encoding with multiple temporal layers
-
-  - Bug Fixes:
-      Fixes multithreaded encoder race condition in loopfilter
-      Fixes multi-resolution threaded encoding
-      Fix potential encoder dead-lock after picture resize
-
-
-2012-05-09 v1.1.0 "Eider"
-  This introduces a number of enhancements, mostly focused on real-time
-  encoding. In addition, it fixes a decoder bug (first introduced in
-  Duclair) so all users of that release are encouraged to upgrade.
-
-  - Upgrading:
-    This release is ABI and API compatible with Duclair (v1.0.0). Users
-    of older releases should refer to the Upgrading notes in this
-    document for that release.
-
-    This release introduces a new temporal denoiser, controlled by the
-    VP8E_SET_NOISE_SENSITIVITY control. The temporal denoiser does not
-    currently take a strength parameter, so the control is effectively
-    a boolean - zero (off) or non-zero (on). For compatibility with
-    existing applications, the values accepted are the same as those
-    for the spatial denoiser (0-6). The temporal denoiser is enabled
-    by default, and the older spatial denoiser may be restored by
-    configuring with --disable-temporal-denoising. The temporal denoiser
-    is more computationally intensive than the spatial one.
-
-    This release removes support for a legacy, decode only API that was
-    supported, but deprecated, at the initial release of libvpx
-    (v0.9.0). This is not expected to have any impact. If you are
-    impacted, you can apply a reversion to commit 2bf8fb58 locally.
-    Please update to the latest libvpx API if you are affected.
-
-  - Enhancements:
-      Adds a motion compensated temporal denoiser to the encoder, which
-      gives higher quality than the older spatial denoiser. (See above
-      for notes on upgrading).
-
-      In addition, support for new compilers and platforms were added,
-      including:
-        improved support for XCode
-        Android x86 NDK build
-        OS/2 support
-        SunCC support
-
-      Changing resolution with vpx_codec_enc_config_set() is now
-      supported. Previously, reinitializing the codec was required to
-      change the input resolution.
-
-      The vpxenc application has initial support for producing multiple
-      encodes from the same input in one call. Resizing is not yet
-      supported, but varying other codec parameters is. Use -- to
-      delineate output streams. Options persist from one stream to the
-      next.
-
-      Also, the vpxenc application will now use a keyframe interval of
-      5 seconds by default. Use the --kf-max-dist option to override.
-
-  - Speed:
-      Decoder performance improved 2.5% versus Duclair. Encoder speed is
-      consistent with Duclair for most material. Two pass encoding of
-      slideshow-like material will see significant improvements.
-
-      Large realtime encoding speed gains at a small quality expense are
-      possible by configuring the on-the-fly bitpacking experiment with
-      --enable-onthefly-bitpacking. Realtime encoder can be up to 13%
-      faster (ARM) depending on the number of threads and bitrate
-      settings. This technique sees constant gain over the 5-16 speed
-      range. For VC style input the loss seen is up to 0.2dB. See commit
-      52cf4dca for further details.
-
-  - Quality:
-      On the whole, quality is consistent with the Duclair release. Some
-      tweaks:
-
-        Reduced blockiness in easy sections by applying a penalty to
-        intra modes.
-
-        Improved quality of static sections (like slideshows) with
-        two pass encoding.
-
-        Improved keyframe sizing with multiple temporal layers
-
-  - Bug Fixes:
-      Corrected alt-ref contribution to frame rate for visible updates
-      to the alt-ref buffer. This affected applications making manual
-      usage of the frame reference flags, or temporal layers.
-
-      Additional constraints were added to disable multi-frame quality
-      enhancement (MFQE) in sections of the frame where there is motion.
-      (#392)
-
-      Fixed corruption issues when vpx_codec_enc_config_set() was called
-      with spatial resampling enabled.
-
-      Fixed a decoder error introduced in Duclair where the segmentation
-      map was not being reinitialized on keyframes (#378)
-
-
-2012-01-27 v1.0.0 "Duclair"
-  Our fourth named release, focused on performance and features related to
-  real-time encoding. It also fixes a decoder crash bug introduced in
-  v0.9.7, so all users of that release are encouraged to upgrade.
-
-  - Upgrading:
-      This release is ABI incompatible with prior releases of libvpx, so the
-      "major" version number has been bumped to 1. You must recompile your
-      applications against the latest version of the libvpx headers. The
-      API remains compatible, and this should not require code changes in most
-      applications.
-
-  - Enhancements:
-      This release introduces several substantial new features to the encoder,
-      of particular interest to real time streaming applications.
-
-      Temporal scalability allows the encoder to produce a stream that can
-      be decimated to different frame rates, with independent rate targetting
-      for each substream.
-
-      Multiframe quality enhancement postprocessing can make visual quality
-      more consistent in the presence of frames that are substantially
-      different quality than the surrounding frames, as in the temporal
-      scalability case and in some forced keyframe scenarios.
-
-      Multiple-resolution encoding support allows the encoding of the
-      same content at different resolutions faster than encoding them
-      separately.
-
-  - Speed:
-      Optimization targets for this release included the decoder and the real-
-      time modes of the encoder. Decoder speed on x86 has improved 10.5% with
-      this release. Encoder improvements followed a curve where speeds 1-3
-      improved 4.0%-1.5%, speeds 4-8 improved <1%, and speeds 9-16 improved
-      1.5% to 10.5%, respectively. "Best" mode speed is consistent with the
-      Cayuga release.
-
-  - Quality:
-      Encoder quality in the single stream case is consistent with the Cayuga
-      release.
-
-  - Bug Fixes:
-      This release fixes an OOB read decoder crash bug present in v0.9.7
-      related to the clamping of motion vectors in SPLITMV blocks. This
-      behavior could be triggered by corrupt input or by starting
-      decoding from a P-frame.
-
-
-2011-08-15 v0.9.7-p1 "Cayuga" patch 1
-  This is an incremental bugfix release against Cayuga. All users of that
-  release are strongly encouraged to upgrade.
-
-    - Fix potential OOB reads (cdae03a)
-
-          An unbounded out of bounds read was discovered when the
-          decoder was requested to perform error concealment (new in
-          Cayuga) given a frame with corrupt partition sizes.
-
-          A bounded out of bounds read was discovered affecting all
-          versions of libvpx. Given an multipartition input frame that
-          is truncated between the mode/mv partition and the first
-          residiual paritition (in the block of partition offsets), up
-          to 3 extra bytes could have been read from the source buffer.
-          The code will not take any action regardless of the contents
-          of these undefined bytes, as the truncated buffer is detected
-          immediately following the read based on the calculated
-          starting position of the coefficient partition.
-
-    - Fix potential error concealment crash when the very first frame
-      is missing or corrupt (a609be5)
-
-    - Fix significant artifacts in error concealment (a4c2211, 99d870a)
-
-    - Revert 1-pass CBR rate control changes (e961317)
-      Further testing showed this change produced undesirable visual
-      artifacts, rolling back for now.
-
-
-2011-08-02 v0.9.7 "Cayuga"
-  Our third named release, focused on a faster, higher quality, encoder.
-
-  - Upgrading:
-    This release is backwards compatible with Aylesbury (v0.9.5) and
-    Bali (v0.9.6). Users of older releases should refer to the Upgrading
-    notes in this document for that release.
-
-  - Enhancements:
-          Stereo 3D format support for vpxenc
-          Runtime detection of available processor cores.
-          Allow specifying --end-usage by enum name
-          vpxdec: test for frame corruption
-          vpxenc: add quantizer histogram display
-          vpxenc: add rate histogram display
-          Set VPX_FRAME_IS_DROPPABLE
-          update configure for ios sdk 4.3
-          Avoid text relocations in ARM vp8 decoder
-          Generate a vpx.pc file for pkg-config.
-          New ways of passing encoded data between encoder and decoder.
-
-  - Speed:
-      This release includes across-the-board speed improvements to the
-      encoder. On x86, these measure at approximately 11.5% in Best mode,
-      21.5% in Good mode (speed 0), and 22.5% in Realtime mode (speed 6).
-      On ARM Cortex A9 with Neon extensions, real-time encoding of video
-      telephony content is 35% faster than Bali on single core and 48%
-      faster on multi-core. On the NVidia Tegra2 platform, real time
-      encoding is 40% faster than Bali.
-
-      Decoder speed was not a priority for this release, but improved
-      approximately 8.4% on x86.
-
-          Reduce motion vector search on alt-ref frame.
-          Encoder loopfilter running in its own thread
-          Reworked loopfilter to precalculate more parameters
-          SSE2/SSSE3 optimizations for build_predictors_mbuv{,_s}().
-          Make hor UV predict ~2x faster (73 vs 132 cycles) using SSSE3.
-          Removed redundant checks
-          Reduced structure sizes
-          utilize preload in ARMv6 MC/LPF/Copy routines
-          ARM optimized quantization, dfct, variance, subtract
-          Increase chrow row alignment to 16 bytes.
-          disable trellis optimization for first pass
-          Write SSSE3 sub-pixel filter function
-          Improve SSE2 half-pixel filter funtions
-          Add vp8_sub_pixel_variance16x8_ssse3 function
-          Reduce unnecessary distortion computation
-          Use diamond search to replace full search
-          Preload reference area in sub-pixel motion search (real-time mode)
-
-  - Quality:
-      This release focused primarily on one-pass use cases, including
-      video conferencing. Low latency data rate control was significantly
-      improved, improving streamability over bandwidth constrained links.
-      Added support for error concealment, allowing frames to maintain
-      visual quality in the presence of substantial packet loss.
-
-          Add rc_max_intra_bitrate_pct control
-          Limit size of initial keyframe in one-pass.
-          Improve framerate adaptation
-          Improved 1-pass CBR rate control
-          Improved KF insertion after fades to still.
-          Improved key frame detection.
-          Improved activity masking (lower PSNR impact for same SSIM boost)
-          Improved interaction between GF and ARFs
-          Adding error-concealment to the decoder.
-          Adding support for independent partitions
-          Adjusted rate-distortion constants
-
-
-  - Bug Fixes:
-          Removed firstpass motion map
-          Fix parallel make install
-          Fix multithreaded encoding for 1 MB wide frame
-          Fixed iwalsh_neon build problems with RVDS4.1
-          Fix semaphore emulation, spin-wait intrinsics on Windows
-          Fix build with xcode4 and simplify GLOBAL.
-          Mark ARM asm objects as allowing a non-executable stack.
-          Fix vpxenc encoding incorrect webm file header on big endian
-
-
-2011-03-07 v0.9.6 "Bali"
-  Our second named release, focused on a faster, higher quality, encoder.
-
-  - Upgrading:
-    This release is backwards compatible with Aylesbury (v0.9.5). Users
-    of older releases should refer to the Upgrading notes in this
-    document for that release.
-
-  - Enhancements:
-      vpxenc --psnr shows a summary when encode completes
-      --tune=ssim option to enable activity masking
-      improved postproc visualizations for development
-      updated support for Apple iOS to SDK 4.2
-      query decoder to determine which reference frames were updated
-      implemented error tracking in the decoder
-      fix pipe support on windows
-
-  - Speed:
-      Primary focus was on good quality mode, speed 0. Average improvement
-      on x86 about 40%, up to 100% on user-generated content at that speed.
-      Best quality mode speed improved 35%, and realtime speed 10-20%. This
-      release also saw significant improvement in realtime encoding speed
-      on ARM platforms.
-
-        Improved encoder threading
-        Dont pick encoder filter level when loopfilter is disabled.
-        Avoid double copying of key frames into alt and golden buffer
-        FDCT optimizations.
-        x86 sse2 temporal filter
-        SSSE3 version of fast quantizer
-        vp8_rd_pick_best_mbsegmentation code restructure
-        Adjusted breakout RD for SPLITMV
-        Changed segmentation check order
-        Improved rd_pick_intra4x4block
-        Adds armv6 optimized variance calculation
-        ARMv6 optimized sad16x16
-        ARMv6 optimized half pixel variance calculations
-        Full search SAD function optimization in SSE4.1
-        Improve MV prediction accuracy to achieve performance gain
-        Improve MV prediction in vp8_pick_inter_mode() for speed>3
-
-  - Quality:
-      Best quality mode improved PSNR 6.3%, and SSIM 6.1%. This release
-      also includes support for "activity masking," which greatly improves
-      SSIM at the expense of PSNR. For now, this feature is available with
-      the --tune=ssim option. Further experimentation in this area
-      is ongoing. This release also introduces a new rate control mode
-      called "CQ," which changes the allocation of bits within a clip to
-      the sections where they will have the most visual impact.
-
-        Tuning for the more exact quantizer.
-        Relax rate control for last few frames
-        CQ Mode
-        Limit key frame quantizer for forced key frames.
-        KF/GF Pulsing
-        Add simple version of activity masking.
-        make rdmult adaptive for intra in quantizer RDO
-        cap the best quantizer for 2nd order DC
-        change the threshold of DC check for encode breakout
-
-  - Bug Fixes:
-      Fix crash on Sparc Solaris.
-      Fix counter of fixed keyframe distance
-      ARNR filter pointer update bug fix
-      Fixed use of motion percentage in KF/GF group calc
-      Changed condition for using RD in Intra Mode
-      Fix encoder real-time only configuration.
-      Fix ARM encoder crash with multiple token partitions
-      Fixed bug first cluster timecode of webm file is wrong.
-      Fixed various encoder bugs with odd-sized images
-      vp8e_get_preview fixed when spatial resampling enabled
-      quantizer: fix assertion in fast quantizer path
-      Allocate source buffers to be multiples of 16
-      Fix for manual Golden frame frequency
-      Fix drastic undershoot in long form content
-
-
-2010-10-28 v0.9.5 "Aylesbury"
-  Our first named release, focused on a faster decoder, and a better encoder.
-
-  - Upgrading:
-    This release incorporates backwards-incompatible changes to the
-    ivfenc and ivfdec tools. These tools are now called vpxenc and vpxdec.
-
-    vpxdec
-      * the -q (quiet) option has been removed, and replaced with
-        -v (verbose). the output is quiet by default. Use -v to see
-        the version number of the binary.
-
-      * The default behavior is now to write output to a single file
-        instead of individual frames. The -y option has been removed.
-        Y4M output is the default.
-
-      * For raw I420/YV12 output instead of Y4M, the --i420 or --yv12
-        options must be specified.
-
-          $ ivfdec -o OUTPUT INPUT
-          $ vpxdec --i420 -o OUTPUT INPUT
-
-      * If an output file is not specified, the default is to write
-        Y4M to stdout. This makes piping more natural.
-
-          $ ivfdec -y -o - INPUT | ...
-          $ vpxdec INPUT | ...
-
-      * The output file has additional flexibility for formatting the
-        filename. It supports escape characters for constructing a
-        filename from the width, height, and sequence number. This
-        replaces the -p option. To get the equivalent:
-
-          $ ivfdec -p frame INPUT
-          $ vpxdec --i420 -o frame-%wx%h-%4.i420 INPUT
-
-    vpxenc
-      * The output file must be specified with -o, rather than as the
-        last argument.
-
-          $ ivfenc <options> INPUT OUTPUT
-          $ vpxenc <options> -o OUTPUT INPUT
-
-      * The output defaults to webm. To get IVF output, use the --ivf
-        option.
-
-          $ ivfenc <options> INPUT OUTPUT.ivf
-          $ vpxenc <options> -o OUTPUT.ivf --ivf INPUT
-
-
-  - Enhancements:
-      ivfenc and ivfdec have been renamed to vpxenc, vpxdec.
-      vpxdec supports .webm input
-      vpxdec writes .y4m by default
-      vpxenc writes .webm output by default
-      vpxenc --psnr now shows the average/overall PSNR at the end
-      ARM platforms now support runtime cpu detection
-      vpxdec visualizations added for motion vectors, block modes, references
-      vpxdec now silent by default
-      vpxdec --progress shows frame-by-frame timing information
-      vpxenc supports the distinction between --fps and --timebase
-      NASM is now a supported assembler
-      configure: enable PIC for shared libs by default
-      configure: add --enable-small
-      configure: support for ppc32-linux-gcc
-      configure: support for sparc-solaris-gcc
-
-  - Bugs:
-      Improve handling of invalid frames
-      Fix valgrind errors in the NEON loop filters.
-      Fix loopfilter delta zero transitions
-      Fix valgrind errors in vp8_sixtap_predict8x4_armv6().
-      Build fixes for darwin-icc
-
-  - Speed:
-      20-40% (average 28%) improvement in libvpx decoder speed,
-      including:
-        Rewrite vp8_short_walsh4x4_sse2()
-        Optimizations on the loopfilters.
-        Miscellaneous improvements for Atom
-        Add 4-tap version of 2nd-pass ARMv6 MC filter.
-        Improved multithread utilization
-        Better instruction choices on x86
-        reorder data to use wider instructions
-        Update NEON wide idcts
-        Make block access to frame buffer sequential
-        Improved subset block search
-        Bilinear subpixel optimizations for ssse3.
-        Decrease memory footprint
-
-      Encoder speed improvements (percentage gain not measured):
-        Skip unnecessary search of identical frames
-        Add SSE2 subtract functions
-        Improve bounds checking in vp8_diamond_search_sadx4()
-        Added vp8_fast_quantize_b_sse2
-
-  - Quality:
-      Over 7% overall PSNR improvement (6.3% SSIM) in "best" quality
-      encoding mode, and up to 60% improvement on very noisy, still
-      or slow moving source video
-
-        Motion compensated temporal filter for Alt-Ref Noise Reduction
-        Improved use of trellis quantization on 2nd order Y blocks
-        Tune effect of motion on KF/GF boost in two pass
-        Allow coefficient optimization for good quality speed 0.
-        Improved control of active min quantizer for two pass.
-        Enable ARFs for non-lagged compress
-
-2010-09-02 v0.9.2
-  - Enhancements:
-      Disable frame dropping by default
-      Improved multithreaded performance
-      Improved Force Key Frame Behaviour
-      Increased rate control buffer level precision
-      Fix bug in 1st pass motion compensation
-      ivfenc: correct fixed kf interval, --disable-kf
-  - Speed:
-      Changed above and left context data layout
-      Rework idct calling structure.
-      Removed unnecessary MB_MODE_INFO copies
-      x86: SSSE3 sixtap prediction
-      Reworked IDCT to include reconstruction (add) step
-      Swap alt/gold/new/last frame buffer ptrs instead of copying.
-      Improve SSE2 loopfilter functions
-      Change bitreader to use a larger window.
-      Avoid loopfilter reinitialization when possible
-  - Quality:
-      Normalize quantizer's zero bin and rounding factors
-      Add trellis quantization.
-      Make the quantizer exact.
-      Updates to ARNR filtering algorithm
-      Fix breakout thresh computation for golden & AltRef frames
-      Redo the forward 4x4 dct
-      Improve the accuracy of forward walsh-hadamard transform
-      Further adjustment of RD behaviour with Q and Zbin.
-  - Build System:
-      Allow linking of libs built with MinGW to MSVC
-      Fix target auto-detection on mingw32
-      Allow --cpu= to work for x86.
-      configure: pass original arguments through to make dist
-      Fix builds without runtime CPU detection
-      msvs: fix install of codec sources
-      msvs: Change devenv.com command line for better msys support
-      msvs: Add vs9 targets.
-      Add x86_64-linux-icc target
-  - Bugs:
-      Potential crashes on older MinGW builds
-      Fix two-pass framrate for Y4M input.
-      Fixed simple loop filter, other crashes on ARM v6
-      arm: fix missing dependency with --enable-shared
-      configure: support directories containing .o
-      Replace pinsrw (SSE) with MMX instructions
-      apple: include proper mach primatives
-      Fixed rate control bug with long key frame interval.
-      Fix DSO link errors on x86-64 when not using a version script
-      Fixed buffer selection for UV in AltRef filtering
-
-
-2010-06-17 v0.9.1
-  - Enhancements:
-      * ivfenc/ivfdec now support YUV4MPEG2 input and pipe I/O
-      * Speed optimizations
-  - Bugfixes:
-      * Rate control
-      * Prevent out-of-bounds accesses on invalid data
-  - Build system updates:
-      * Detect toolchain to be used automatically for native builds
-      * Support building shared libraries
-      * Better autotools emulation (--prefix, --libdir, DESTDIR)
-  - Updated LICENSE
-      * http://webmproject.blogspot.com/2010/06/changes-to-webm-open-source-license.html
-
-
-2010-05-18 v0.9.0
-  - Initial open source release. Welcome to WebM and VP8!
-
diff --git a/src/third_party/libvpx/LICENSE b/src/third_party/libvpx/LICENSE
deleted file mode 100644
index 1ce4434..0000000
--- a/src/third_party/libvpx/LICENSE
+++ /dev/null
@@ -1,31 +0,0 @@
-Copyright (c) 2010, The WebM Project authors. 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 Google, nor the WebM 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 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.
-
diff --git a/src/third_party/libvpx/METADATA b/src/third_party/libvpx/METADATA
deleted file mode 100644
index 7ec0383..0000000
--- a/src/third_party/libvpx/METADATA
+++ /dev/null
@@ -1,20 +0,0 @@
-name: "libvpx"
-description:
-  "Subtree at third_party/libvpx."
-
-third_party {
-  url {
-    type: LOCAL_SOURCE
-    value: "/third_party/libvpx_mirror"
-  }
-  url {
-    type: GIT
-    value: "https://chromium.googlesource.com/webm/libvpx"
-  }
-  version: "b8ec5dcdf8f5bc40a137b988437ef5ff3931b03a"
-  last_upgrade_date {
-    year: 2016
-    month: 6
-    day: 21
-  }
-}
diff --git a/src/third_party/libvpx/PATENTS b/src/third_party/libvpx/PATENTS
deleted file mode 100644
index caedf60..0000000
--- a/src/third_party/libvpx/PATENTS
+++ /dev/null
@@ -1,23 +0,0 @@
-Additional IP Rights Grant (Patents)
-------------------------------------
-
-"These implementations" means the copyrightable works that implement the WebM
-codecs distributed by Google as part of the WebM Project.
-
-Google hereby grants to you a perpetual, worldwide, non-exclusive, no-charge,
-royalty-free, irrevocable (except as stated in this section) patent license to
-make, have made, use, offer to sell, sell, import, transfer, and otherwise
-run, modify and propagate the contents of these implementations of WebM, where
-such license applies only to those patent claims, both currently owned by
-Google and acquired in the future, licensable by Google that are necessarily
-infringed by these implementations of WebM. This grant does not include claims
-that would be infringed only as a consequence of further modification of these
-implementations. If you or your agent or exclusive licensee institute or order
-or agree to the institution of patent litigation or any other patent
-enforcement activity against any entity (including a cross-claim or
-counterclaim in a lawsuit) alleging that any of these implementations of WebM
-or any code incorporated within any of these implementations of WebM
-constitute direct or contributory patent infringement, or inducement of
-patent infringement, then any patent rights granted to you under this License
-for these implementations of WebM shall terminate as of the date such
-litigation is filed.
diff --git a/src/third_party/libvpx/README b/src/third_party/libvpx/README
deleted file mode 100644
index 29072b9..0000000
--- a/src/third_party/libvpx/README
+++ /dev/null
@@ -1,138 +0,0 @@
-README - 23 March 2015
-
-Welcome to the WebM VP8/VP9 Codec SDK!
-
-COMPILING THE APPLICATIONS/LIBRARIES:
-  The build system used is similar to autotools. Building generally consists of
-  "configuring" with your desired build options, then using GNU make to build
-  the application.
-
-  1. Prerequisites
-
-    * All x86 targets require the Yasm[1] assembler be installed.
-    * All Windows builds require that Cygwin[2] be installed.
-    * Building the documentation requires Doxygen[3]. If you do not
-      have this package, the install-docs option will be disabled.
-    * Downloading the data for the unit tests requires curl[4] and sha1sum.
-      sha1sum is provided via the GNU coreutils, installed by default on
-      many *nix platforms, as well as MinGW and Cygwin. If coreutils is not
-      available, a compatible version of sha1sum can be built from
-      source[5]. These requirements are optional if not running the unit
-      tests.
-
-    [1]: http://www.tortall.net/projects/yasm
-    [2]: http://www.cygwin.com
-    [3]: http://www.doxygen.org
-    [4]: http://curl.haxx.se
-    [5]: http://www.microbrew.org/tools/md5sha1sum/
-
-  2. Out-of-tree builds
-  Out of tree builds are a supported method of building the application. For
-  an out of tree build, the source tree is kept separate from the object
-  files produced during compilation. For instance:
-
-    $ mkdir build
-    $ cd build
-    $ ../libvpx/configure <options>
-    $ make
-
-  3. Configuration options
-  The 'configure' script supports a number of options. The --help option can be
-  used to get a list of supported options:
-    $ ../libvpx/configure --help
-
-  4. Cross development
-  For cross development, the most notable option is the --target option. The
-  most up-to-date list of supported targets can be found at the bottom of the
-  --help output of the configure script. As of this writing, the list of
-  available targets is:
-
-    armv6-linux-rvct
-    armv6-linux-gcc
-    armv6-none-rvct
-    arm64-darwin-gcc
-    armv7-android-gcc
-    armv7-darwin-gcc
-    armv7-linux-rvct
-    armv7-linux-gcc
-    armv7-none-rvct
-    armv7-win32-vs11
-    armv7-win32-vs12
-    armv7-win32-vs14
-    armv7s-darwin-gcc
-    mips32-linux-gcc
-    mips64-linux-gcc
-    sparc-solaris-gcc
-    x86-android-gcc
-    x86-darwin8-gcc
-    x86-darwin8-icc
-    x86-darwin9-gcc
-    x86-darwin9-icc
-    x86-darwin10-gcc
-    x86-darwin11-gcc
-    x86-darwin12-gcc
-    x86-darwin13-gcc
-    x86-darwin14-gcc
-    x86-iphonesimulator-gcc
-    x86-linux-gcc
-    x86-linux-icc
-    x86-os2-gcc
-    x86-solaris-gcc
-    x86-win32-gcc
-    x86-win32-vs7
-    x86-win32-vs8
-    x86-win32-vs9
-    x86-win32-vs10
-    x86-win32-vs11
-    x86-win32-vs12
-    x86-win32-vs14
-    x86_64-android-gcc
-    x86_64-darwin9-gcc
-    x86_64-darwin10-gcc
-    x86_64-darwin11-gcc
-    x86_64-darwin12-gcc
-    x86_64-darwin13-gcc
-    x86_64-darwin14-gcc
-    x86_64-iphonesimulator-gcc
-    x86_64-linux-gcc
-    x86_64-linux-icc
-    x86_64-solaris-gcc
-    x86_64-win64-gcc
-    x86_64-win64-vs8
-    x86_64-win64-vs9
-    x86_64-win64-vs10
-    x86_64-win64-vs11
-    x86_64-win64-vs12
-    x86_64-win64-vs14
-    generic-gnu
-
-  The generic-gnu target, in conjunction with the CROSS environment variable,
-  can be used to cross compile architectures that aren't explicitly listed, if
-  the toolchain is a cross GNU (gcc/binutils) toolchain. Other POSIX toolchains
-  will likely work as well. For instance, to build using the mipsel-linux-uclibc
-  toolchain, the following command could be used (note, POSIX SH syntax, adapt
-  to your shell as necessary):
-
-    $ CROSS=mipsel-linux-uclibc- ../libvpx/configure
-
-  In addition, the executables to be invoked can be overridden by specifying the
-  environment variables: CC, AR, LD, AS, STRIP, NM. Additional flags can be
-  passed to these executables with CFLAGS, LDFLAGS, and ASFLAGS.
-
-  5. Configuration errors
-  If the configuration step fails, the first step is to look in the error log.
-  This defaults to config.log. This should give a good indication of what went
-  wrong. If not, contact us for support.
-
-VP8/VP9 TEST VECTORS:
-  The test vectors can be downloaded and verified using the build system after
-  running configure. To specify an alternate directory the
-  LIBVPX_TEST_DATA_PATH environment variable can be used.
-
-  $ ./configure --enable-unit-tests
-  $ LIBVPX_TEST_DATA_PATH=../libvpx-test-data make testdata
-
-SUPPORT
-  This library is an open source project supported by its community. Please
-  please email webm-discuss@webmproject.org for help.
-
diff --git a/src/third_party/libvpx/README.lbshell b/src/third_party/libvpx/README.lbshell
deleted file mode 100644
index 9e83ef4..0000000
--- a/src/third_party/libvpx/README.lbshell
+++ /dev/null
@@ -1,15 +0,0 @@
-Name: libvpx
-URL: http://www.webmproject.org
-Version: v1.3.0
-License: BSD
-License File: source/libvpx/LICENSE
-Security Critical: yes
-
-Date: Fri Jan 9 2015
-Branch: master
-Commit: ccffe318ffc90ae584c33e254b3a35e9142ecc20
-
-This is the version used in the public Chrome release.
-See: [chromium] //src/third_party/libvpx/README.chromium
-
-See platforms/ps4 for Steel-specific details.
diff --git a/src/third_party/libvpx/ads2gas.gypi b/src/third_party/libvpx/ads2gas.gypi
deleted file mode 100644
index 3a96faa..0000000
--- a/src/third_party/libvpx/ads2gas.gypi
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright (c) 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file is meant to be included into a target to provide a rule
-# for translating .asm files to .S files using ads2gas.
-#
-# To use this, create a gyp target with the following form:
-# {
-#   'target_name': 'my_lib',
-#   'sources': [
-#     'foo.asm',
-#     'bar.c',
-#   ],
-#   'includes': [ 'ads2gas.gypi' ],
-# }
-{
-  'variables': {
-    # Location of the intermediate output.
-    'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/libvpx',
-    'variables': {
-      'libvpx_source%': '<(DEPTH)/third_party/libvpx',
-      'conditions': [
-        ['OS=="ios"', {
-          'ads2gas_script%': 'ads2gas_apple.pl',
-        }, {
-          'ads2gas_script%': 'ads2gas.pl',
-        }],
-      ],
-    },
-    'ads2gas_script%': '<(ads2gas_script)',
-    'ads2gas_script_dir': '<(libvpx_source)/build/make',
-  },
-  'rules': [
-    {
-      'rule_name': 'convert_asm',
-      'extension': 'asm',
-      'inputs': [
-        '<(ads2gas_script_dir)/<(ads2gas_script)',
-        '<(ads2gas_script_dir)/thumb.pm',
-      ],
-      'outputs': [
-        '<(shared_generated_dir)/<(RULE_INPUT_ROOT).asm.S',
-      ],
-      'action': [
-        'bash',
-        '-c',
-        'cat <(RULE_INPUT_PATH) | perl <(ads2gas_script_dir)/<(ads2gas_script) -chromium > <(shared_generated_dir)/<(RULE_INPUT_ROOT).asm.S',
-      ],
-      'process_outputs_as_sources': 1,
-      'message': 'Convert libvpx asm file for ARM <(RULE_INPUT_PATH)',
-    },
-  ],
-}
diff --git a/src/third_party/libvpx/args.c b/src/third_party/libvpx/args.c
deleted file mode 100644
index 14b0310..0000000
--- a/src/third_party/libvpx/args.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include "args.h"
-
-#include "vpx_ports/msvc.h"
-
-#if defined(__GNUC__) && __GNUC__
-extern void die(const char *fmt, ...) __attribute__((noreturn));
-#else
-extern void die(const char *fmt, ...);
-#endif
-
-
-struct arg arg_init(char **argv) {
-  struct arg a;
-
-  a.argv      = argv;
-  a.argv_step = 1;
-  a.name      = NULL;
-  a.val       = NULL;
-  a.def       = NULL;
-  return a;
-}
-
-int arg_match(struct arg *arg_, const struct arg_def *def, char **argv) {
-  struct arg arg;
-
-  if (!argv[0] || argv[0][0] != '-')
-    return 0;
-
-  arg = arg_init(argv);
-
-  if (def->short_name
-      && strlen(arg.argv[0]) == strlen(def->short_name) + 1
-      && !strcmp(arg.argv[0] + 1, def->short_name)) {
-
-    arg.name = arg.argv[0] + 1;
-    arg.val = def->has_val ? arg.argv[1] : NULL;
-    arg.argv_step = def->has_val ? 2 : 1;
-  } else if (def->long_name) {
-    const size_t name_len = strlen(def->long_name);
-
-    if (strlen(arg.argv[0]) >= name_len + 2
-        && arg.argv[0][1] == '-'
-        && !strncmp(arg.argv[0] + 2, def->long_name, name_len)
-        && (arg.argv[0][name_len + 2] == '='
-            || arg.argv[0][name_len + 2] == '\0')) {
-
-      arg.name = arg.argv[0] + 2;
-      arg.val = arg.name[name_len] == '=' ? arg.name + name_len + 1 : NULL;
-      arg.argv_step = 1;
-    }
-  }
-
-  if (arg.name && !arg.val && def->has_val)
-    die("Error: option %s requires argument.\n", arg.name);
-
-  if (arg.name && arg.val && !def->has_val)
-    die("Error: option %s requires no argument.\n", arg.name);
-
-  if (arg.name
-      && (arg.val || !def->has_val)) {
-    arg.def = def;
-    *arg_ = arg;
-    return 1;
-  }
-
-  return 0;
-}
-
-
-const char *arg_next(struct arg *arg) {
-  if (arg->argv[0])
-    arg->argv += arg->argv_step;
-
-  return *arg->argv;
-}
-
-
-char **argv_dup(int argc, const char **argv) {
-  char **new_argv = malloc((argc + 1) * sizeof(*argv));
-
-  memcpy(new_argv, argv, argc * sizeof(*argv));
-  new_argv[argc] = NULL;
-  return new_argv;
-}
-
-
-void arg_show_usage(FILE *fp, const struct arg_def *const *defs) {
-  char option_text[40] = {0};
-
-  for (; *defs; defs++) {
-    const struct arg_def *def = *defs;
-    char *short_val = def->has_val ? " <arg>" : "";
-    char *long_val = def->has_val ? "=<arg>" : "";
-
-    if (def->short_name && def->long_name) {
-      char *comma = def->has_val ? "," : ",      ";
-
-      snprintf(option_text, 37, "-%s%s%s --%s%6s",
-               def->short_name, short_val, comma,
-               def->long_name, long_val);
-    } else if (def->short_name)
-      snprintf(option_text, 37, "-%s%s",
-               def->short_name, short_val);
-    else if (def->long_name)
-      snprintf(option_text, 37, "          --%s%s",
-               def->long_name, long_val);
-
-    fprintf(fp, "  %-37s\t%s\n", option_text, def->desc);
-
-    if (def->enums) {
-      const struct arg_enum_list *listptr;
-
-      fprintf(fp, "  %-37s\t  ", "");
-
-      for (listptr = def->enums; listptr->name; listptr++)
-        fprintf(fp, "%s%s", listptr->name,
-                listptr[1].name ? ", " : "\n");
-    }
-  }
-}
-
-
-unsigned int arg_parse_uint(const struct arg *arg) {
-  long int   rawval;
-  char      *endptr;
-
-  rawval = strtol(arg->val, &endptr, 10);
-
-  if (arg->val[0] != '\0' && endptr[0] == '\0') {
-    if (rawval >= 0 && rawval <= UINT_MAX)
-      return rawval;
-
-    die("Option %s: Value %ld out of range for unsigned int\n",
-        arg->name, rawval);
-  }
-
-  die("Option %s: Invalid character '%c'\n", arg->name, *endptr);
-  return 0;
-}
-
-
-int arg_parse_int(const struct arg *arg) {
-  long int   rawval;
-  char      *endptr;
-
-  rawval = strtol(arg->val, &endptr, 10);
-
-  if (arg->val[0] != '\0' && endptr[0] == '\0') {
-    if (rawval >= INT_MIN && rawval <= INT_MAX)
-      return rawval;
-
-    die("Option %s: Value %ld out of range for signed int\n",
-        arg->name, rawval);
-  }
-
-  die("Option %s: Invalid character '%c'\n", arg->name, *endptr);
-  return 0;
-}
-
-
-struct vpx_rational {
-  int num; /**< fraction numerator */
-  int den; /**< fraction denominator */
-};
-struct vpx_rational arg_parse_rational(const struct arg *arg) {
-  long int             rawval;
-  char                *endptr;
-  struct vpx_rational  rat;
-
-  /* parse numerator */
-  rawval = strtol(arg->val, &endptr, 10);
-
-  if (arg->val[0] != '\0' && endptr[0] == '/') {
-    if (rawval >= INT_MIN && rawval <= INT_MAX)
-      rat.num = rawval;
-    else die("Option %s: Value %ld out of range for signed int\n",
-               arg->name, rawval);
-  } else die("Option %s: Expected / at '%c'\n", arg->name, *endptr);
-
-  /* parse denominator */
-  rawval = strtol(endptr + 1, &endptr, 10);
-
-  if (arg->val[0] != '\0' && endptr[0] == '\0') {
-    if (rawval >= INT_MIN && rawval <= INT_MAX)
-      rat.den = rawval;
-    else die("Option %s: Value %ld out of range for signed int\n",
-               arg->name, rawval);
-  } else die("Option %s: Invalid character '%c'\n", arg->name, *endptr);
-
-  return rat;
-}
-
-
-int arg_parse_enum(const struct arg *arg) {
-  const struct arg_enum_list *listptr;
-  long int                    rawval;
-  char                       *endptr;
-
-  /* First see if the value can be parsed as a raw value */
-  rawval = strtol(arg->val, &endptr, 10);
-  if (arg->val[0] != '\0' && endptr[0] == '\0') {
-    /* Got a raw value, make sure it's valid */
-    for (listptr = arg->def->enums; listptr->name; listptr++)
-      if (listptr->val == rawval)
-        return rawval;
-  }
-
-  /* Next see if it can be parsed as a string */
-  for (listptr = arg->def->enums; listptr->name; listptr++)
-    if (!strcmp(arg->val, listptr->name))
-      return listptr->val;
-
-  die("Option %s: Invalid value '%s'\n", arg->name, arg->val);
-  return 0;
-}
-
-
-int arg_parse_enum_or_int(const struct arg *arg) {
-  if (arg->def->enums)
-    return arg_parse_enum(arg);
-  return arg_parse_int(arg);
-}
diff --git a/src/third_party/libvpx/args.h b/src/third_party/libvpx/args.h
deleted file mode 100644
index 1f37151..0000000
--- a/src/third_party/libvpx/args.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#ifndef ARGS_H_
-#define ARGS_H_
-#include <stdio.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct arg {
-  char                 **argv;
-  const char            *name;
-  const char            *val;
-  unsigned int           argv_step;
-  const struct arg_def  *def;
-};
-
-struct arg_enum_list {
-  const char *name;
-  int         val;
-};
-#define ARG_ENUM_LIST_END {0}
-
-typedef struct arg_def {
-  const char *short_name;
-  const char *long_name;
-  int         has_val;
-  const char *desc;
-  const struct arg_enum_list *enums;
-} arg_def_t;
-#define ARG_DEF(s,l,v,d) {s,l,v,d, NULL}
-#define ARG_DEF_ENUM(s,l,v,d,e) {s,l,v,d,e}
-#define ARG_DEF_LIST_END {0}
-
-struct arg arg_init(char **argv);
-int arg_match(struct arg *arg_, const struct arg_def *def, char **argv);
-const char *arg_next(struct arg *arg);
-void arg_show_usage(FILE *fp, const struct arg_def *const *defs);
-char **argv_dup(int argc, const char **argv);
-
-unsigned int arg_parse_uint(const struct arg *arg);
-int arg_parse_int(const struct arg *arg);
-struct vpx_rational arg_parse_rational(const struct arg *arg);
-int arg_parse_enum(const struct arg *arg);
-int arg_parse_enum_or_int(const struct arg *arg);
-#ifdef __cplusplus
-}  // extern "C"
-#endif
-
-#endif  // ARGS_H_
diff --git a/src/third_party/libvpx/build/make/Android.mk b/src/third_party/libvpx/build/make/Android.mk
deleted file mode 100644
index df01dec..0000000
--- a/src/third_party/libvpx/build/make/Android.mk
+++ /dev/null
@@ -1,205 +0,0 @@
-##
-##  Copyright (c) 2012 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-#
-# This file is to be used for compiling libvpx for Android using the NDK.
-# In an Android project place a libvpx checkout in the jni directory.
-# Run the configure script from the jni directory.  Base libvpx
-# encoder/decoder configuration will look similar to:
-# ./libvpx/configure --target=armv7-android-gcc --disable-examples \
-#                    --sdk-path=/opt/android-ndk-r6b/
-#
-# When targeting Android, realtime-only is enabled by default.  This can
-# be overridden by adding the command line flag:
-#  --disable-realtime-only
-#
-# This will create .mk files that contain variables that contain the
-# source files to compile.
-#
-# Place an Android.mk file in the jni directory that references the
-# Android.mk file in the libvpx directory:
-# LOCAL_PATH := $(call my-dir)
-# include $(CLEAR_VARS)
-# include jni/libvpx/build/make/Android.mk
-#
-# There are currently two TARGET_ARCH_ABI targets for ARM.
-# armeabi and armeabi-v7a.  armeabi-v7a is selected by creating an
-# Application.mk in the jni directory that contains:
-# APP_ABI := armeabi-v7a
-#
-# By default libvpx will detect at runtime the existance of NEON extension.
-# For this we import the 'cpufeatures' module from the NDK sources.
-# libvpx can also be configured without this runtime detection method.
-# Configuring with --disable-runtime-cpu-detect will assume presence of NEON.
-# Configuring with --disable-runtime-cpu-detect --disable-neon \
-#     --disable-neon-asm
-# will remove any NEON dependency.
-
-# To change to building armeabi, run ./libvpx/configure again, but with
-# --target=armv6-android-gcc and modify the Application.mk file to
-# set APP_ABI := armeabi
-#
-# Running ndk-build will build libvpx and include it in your project.
-#
-
-CONFIG_DIR := $(LOCAL_PATH)/
-LIBVPX_PATH := $(LOCAL_PATH)/libvpx
-ASM_CNV_PATH_LOCAL := $(TARGET_ARCH_ABI)/ads2gas
-ASM_CNV_PATH := $(LOCAL_PATH)/$(ASM_CNV_PATH_LOCAL)
-
-# Use the makefiles generated by upstream configure to determine which files to
-# build. Also set any architecture-specific flags.
-ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
-  include $(CONFIG_DIR)libs-armv7-android-gcc.mk
-  LOCAL_ARM_MODE := arm
-else ifeq  ($(TARGET_ARCH_ABI),armeabi)
-  include $(CONFIG_DIR)libs-armv6-android-gcc.mk
-  LOCAL_ARM_MODE := arm
-else ifeq  ($(TARGET_ARCH_ABI),arm64-v8a)
-  include $(CONFIG_DIR)libs-armv8-android-gcc.mk
-  LOCAL_ARM_MODE := arm
-else ifeq ($(TARGET_ARCH_ABI),x86)
-  include $(CONFIG_DIR)libs-x86-android-gcc.mk
-else ifeq ($(TARGET_ARCH_ABI),x86_64)
-  include $(CONFIG_DIR)libs-x86_64-android-gcc.mk
-else ifeq ($(TARGET_ARCH_ABI),mips)
-  include $(CONFIG_DIR)libs-mips-android-gcc.mk
-else
-  $(error Not a supported TARGET_ARCH_ABI: $(TARGET_ARCH_ABI))
-endif
-
-# Rule that is normally in Makefile created by libvpx
-# configure.  Used to filter out source files based on configuration.
-enabled=$(filter-out $($(1)-no),$($(1)-yes))
-
-# Override the relative path that is defined by the libvpx
-# configure process
-SRC_PATH_BARE := $(LIBVPX_PATH)
-
-# Include the list of files to be built
-include $(LIBVPX_PATH)/libs.mk
-
-# Optimise the code. May want to revisit this setting in the future.
-LOCAL_CFLAGS := -O3
-
-# For x86, include the source code in the search path so it will find files
-# like x86inc.asm and x86_abi_support.asm
-LOCAL_ASMFLAGS := -I$(LIBVPX_PATH)
-
-.PRECIOUS: %.asm.s
-$(ASM_CNV_PATH)/libvpx/%.asm.s: $(LIBVPX_PATH)/%.asm
-	@mkdir -p $(dir $@)
-	@$(CONFIG_DIR)$(ASM_CONVERSION) <$< > $@
-
-# For building *_rtcd.h, which have rules in libs.mk
-TGT_ISA:=$(word 1, $(subst -, ,$(TOOLCHAIN)))
-target := libs
-
-LOCAL_SRC_FILES += vpx_config.c
-
-# Remove duplicate entries
-CODEC_SRCS_UNIQUE = $(sort $(CODEC_SRCS))
-
-# Pull out C files.  vpx_config.c is in the immediate directory and
-# so it does not need libvpx/ prefixed like the rest of the source files.
-# The neon files with intrinsics need to have .neon appended so the proper
-# flags are applied.
-CODEC_SRCS_C = $(filter %.c, $(CODEC_SRCS_UNIQUE))
-LOCAL_NEON_SRCS_C = $(filter %_neon.c, $(CODEC_SRCS_C))
-LOCAL_CODEC_SRCS_C = $(filter-out vpx_config.c %_neon.c, $(CODEC_SRCS_C))
-
-LOCAL_SRC_FILES += $(foreach file, $(LOCAL_CODEC_SRCS_C), libvpx/$(file))
-ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
-  LOCAL_SRC_FILES += $(foreach file, $(LOCAL_NEON_SRCS_C), libvpx/$(file).neon)
-else # If there are neon sources then we are building for arm64 and do not need to specify .neon
-  LOCAL_SRC_FILES += $(foreach file, $(LOCAL_NEON_SRCS_C), libvpx/$(file))
-endif
-
-# Pull out assembly files, splitting NEON from the rest.  This is
-# done to specify that the NEON assembly files use NEON assembler flags.
-# x86 assembly matches %.asm, arm matches %.asm.s
-
-# x86:
-
-CODEC_SRCS_ASM_X86 = $(filter %.asm, $(CODEC_SRCS_UNIQUE))
-LOCAL_SRC_FILES += $(foreach file, $(CODEC_SRCS_ASM_X86), libvpx/$(file))
-
-# arm:
-CODEC_SRCS_ASM_ARM_ALL = $(filter %.asm.s, $(CODEC_SRCS_UNIQUE))
-CODEC_SRCS_ASM_ARM = $(foreach v, \
-                     $(CODEC_SRCS_ASM_ARM_ALL), \
-                     $(if $(findstring neon,$(v)),,$(v)))
-CODEC_SRCS_ASM_ADS2GAS = $(patsubst %.s, \
-                         $(ASM_CNV_PATH_LOCAL)/libvpx/%.s, \
-                         $(CODEC_SRCS_ASM_ARM))
-LOCAL_SRC_FILES += $(CODEC_SRCS_ASM_ADS2GAS)
-
-ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
-  CODEC_SRCS_ASM_NEON = $(foreach v, \
-                        $(CODEC_SRCS_ASM_ARM_ALL),\
-                        $(if $(findstring neon,$(v)),$(v),))
-  CODEC_SRCS_ASM_NEON_ADS2GAS = $(patsubst %.s, \
-                                $(ASM_CNV_PATH_LOCAL)/libvpx/%.s, \
-                                $(CODEC_SRCS_ASM_NEON))
-  LOCAL_SRC_FILES += $(patsubst %.s, \
-                     %.s.neon, \
-                     $(CODEC_SRCS_ASM_NEON_ADS2GAS))
-endif
-
-LOCAL_CFLAGS += \
-    -DHAVE_CONFIG_H=vpx_config.h \
-    -I$(LIBVPX_PATH) \
-    -I$(ASM_CNV_PATH)
-
-LOCAL_MODULE := libvpx
-
-ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
-  LOCAL_STATIC_LIBRARIES := cpufeatures
-endif
-
-# Add a dependency to force generation of the RTCD files.
-define rtcd_dep_template
-rtcd_dep_template_SRCS := $(addprefix $(LOCAL_PATH)/, $(LOCAL_SRC_FILES))
-rtcd_dep_template_SRCS := $$(rtcd_dep_template_SRCS:.neon=)
-ifeq ($(CONFIG_VP8), yes)
-$$(rtcd_dep_template_SRCS): vp8_rtcd.h
-endif
-ifeq ($(CONFIG_VP9), yes)
-$$(rtcd_dep_template_SRCS): vp9_rtcd.h
-endif
-ifeq ($(CONFIG_VP10), yes)
-$$(rtcd_dep_template_SRCS): vp10_rtcd.h
-endif
-$$(rtcd_dep_template_SRCS): vpx_scale_rtcd.h
-$$(rtcd_dep_template_SRCS): vpx_dsp_rtcd.h
-
-ifneq ($(findstring $(TARGET_ARCH_ABI),x86 x86_64),)
-$$(rtcd_dep_template_SRCS): vpx_config.asm
-endif
-endef
-
-$(eval $(call rtcd_dep_template))
-
-.PHONY: clean
-clean:
-	@echo "Clean: ads2gas files [$(TARGET_ARCH_ABI)]"
-	@$(RM) $(CODEC_SRCS_ASM_ADS2GAS) $(CODEC_SRCS_ASM_NEON_ADS2GAS)
-	@$(RM) -r $(ASM_CNV_PATH)
-	@$(RM) $(CLEAN-OBJS)
-
-ifeq ($(ENABLE_SHARED),1)
-  include $(BUILD_SHARED_LIBRARY)
-else
-  include $(BUILD_STATIC_LIBRARY)
-endif
-
-ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
-$(call import-module,cpufeatures)
-endif
diff --git a/src/third_party/libvpx/build/make/Makefile b/src/third_party/libvpx/build/make/Makefile
deleted file mode 100644
index 3e8c0249..0000000
--- a/src/third_party/libvpx/build/make/Makefile
+++ /dev/null
@@ -1,451 +0,0 @@
-##
-##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-
-include config.mk
-quiet?=true
-ifeq ($(target),)
-# If a target wasn't specified, invoke for all enabled targets.
-.DEFAULT:
-	@for t in $(ALL_TARGETS); do \
-	     $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
-        done
-all: .DEFAULT
-clean:: .DEFAULT
-exampletest: .DEFAULT
-install:: .DEFAULT
-test:: .DEFAULT
-test-no-data-check:: .DEFAULT
-testdata:: .DEFAULT
-utiltest: .DEFAULT
-exampletest-no-data-check utiltest-no-data-check: .DEFAULT
-
-
-# Note: md5sum is not installed on OS X, but openssl is. Openssl may not be
-# installed on cygwin, so we need to autodetect here.
-md5sum := $(firstword $(wildcard \
-          $(foreach e,md5sum openssl,\
-          $(foreach p,$(subst :, ,$(PATH)),$(p)/$(e)*))\
-          ))
-md5sum := $(if $(filter %openssl,$(md5sum)),$(md5sum) dgst -md5,$(md5sum))
-
-TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
-dist:
-	@for t in $(ALL_TARGETS); do \
-	     $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
-        done
-        # Run configure for the user with the current toolchain.
-	@if [ -d "$(DIST_DIR)/src" ]; then \
-            mkdir -p "$(DIST_DIR)/build"; \
-            cd "$(DIST_DIR)/build"; \
-            echo "Rerunning configure $(CONFIGURE_ARGS)"; \
-            ../src/configure $(CONFIGURE_ARGS); \
-            $(if $(filter vs%,$(TGT_CC)),make NO_LAUNCH_DEVENV=1;) \
-        fi
-	@if [ -d "$(DIST_DIR)" ]; then \
-            echo "    [MD5SUM] $(DIST_DIR)"; \
-	    cd $(DIST_DIR) && \
-	    $(md5sum) `find . -name md5sums.txt -prune -o -type f -print` \
-                | sed -e 's/MD5(\(.*\))= \([0-9a-f]\{32\}\)/\2  \1/' \
-                > md5sums.txt;\
-        fi
-endif
-
-# Since we invoke make recursively for multiple targets we need to include the
-# .mk file for the correct target, but only when $(target) is non-empty.
-ifneq ($(target),)
-include $(target)-$(TOOLCHAIN).mk
-endif
-BUILD_ROOT?=.
-VPATH=$(SRC_PATH_BARE)
-CFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
-CXXFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
-ASFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT)/ -I$(SRC_PATH)/
-DIST_DIR?=dist
-HOSTCC?=gcc
-TGT_ISA:=$(word 1, $(subst -, ,$(TOOLCHAIN)))
-TGT_OS:=$(word 2, $(subst -, ,$(TOOLCHAIN)))
-TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
-quiet:=$(if $(or $(verbose), $(V)),, yes)
-qexec=$(if $(quiet),@)
-
-# Cancel built-in implicit rules
-%: %.o
-%.asm:
-%.a:
-%: %.cc
-
-#
-# Common rules"
-#
-.PHONY: all
-all:
-
-.PHONY: clean
-clean::
-	rm -f $(OBJS-yes) $(OBJS-yes:.o=.d) $(OBJS-yes:.asm.s.o=.asm.s)
-	rm -f $(CLEAN-OBJS)
-
-.PHONY: clean
-distclean: clean
-	if [ -z "$(target)" ]; then \
-      rm -f Makefile; \
-      rm -f config.log config.mk; \
-      rm -f vpx_config.[hc] vpx_config.asm; \
-    else \
-      rm -f $(target)-$(TOOLCHAIN).mk; \
-    fi
-
-.PHONY: dist
-dist:
-.PHONY: exampletest
-exampletest:
-.PHONY: install
-install::
-.PHONY: test
-test::
-.PHONY: testdata
-testdata::
-.PHONY: utiltest
-utiltest:
-.PHONY: test-no-data-check exampletest-no-data-check utiltest-no-data-check
-test-no-data-check::
-exampletest-no-data-check utiltest-no-data-check:
-
-# Force to realign stack always on OS/2
-ifeq ($(TOOLCHAIN), x86-os2-gcc)
-CFLAGS += -mstackrealign
-endif
-
-$(BUILD_PFX)%_mmx.c.d: CFLAGS += -mmmx
-$(BUILD_PFX)%_mmx.c.o: CFLAGS += -mmmx
-$(BUILD_PFX)%_sse2.c.d: CFLAGS += -msse2
-$(BUILD_PFX)%_sse2.c.o: CFLAGS += -msse2
-$(BUILD_PFX)%_sse3.c.d: CFLAGS += -msse3
-$(BUILD_PFX)%_sse3.c.o: CFLAGS += -msse3
-$(BUILD_PFX)%_ssse3.c.d: CFLAGS += -mssse3
-$(BUILD_PFX)%_ssse3.c.o: CFLAGS += -mssse3
-$(BUILD_PFX)%_sse4.c.d: CFLAGS += -msse4.1
-$(BUILD_PFX)%_sse4.c.o: CFLAGS += -msse4.1
-$(BUILD_PFX)%_avx.c.d: CFLAGS += -mavx
-$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx
-$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2
-$(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2
-
-$(BUILD_PFX)%.c.d: %.c
-	$(if $(quiet),@echo "    [DEP] $@")
-	$(qexec)mkdir -p $(dir $@)
-	$(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -M $< | $(fmt_deps) > $@
-
-$(BUILD_PFX)%.c.o: %.c
-	$(if $(quiet),@echo "    [CC] $@")
-	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
-	$(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -c -o $@ $<
-
-$(BUILD_PFX)%.cc.d: %.cc
-	$(if $(quiet),@echo "    [DEP] $@")
-	$(qexec)mkdir -p $(dir $@)
-	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@
-
-$(BUILD_PFX)%.cc.o: %.cc
-	$(if $(quiet),@echo "    [CXX] $@")
-	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
-	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $<
-
-$(BUILD_PFX)%.cpp.d: %.cpp
-	$(if $(quiet),@echo "    [DEP] $@")
-	$(qexec)mkdir -p $(dir $@)
-	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@
-
-$(BUILD_PFX)%.cpp.o: %.cpp
-	$(if $(quiet),@echo "    [CXX] $@")
-	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
-	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $<
-
-$(BUILD_PFX)%.asm.d: %.asm
-	$(if $(quiet),@echo "    [DEP] $@")
-	$(qexec)mkdir -p $(dir $@)
-	$(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \
-            --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@
-
-$(BUILD_PFX)%.asm.o: %.asm
-	$(if $(quiet),@echo "    [AS] $@")
-	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
-	$(qexec)$(AS) $(ASFLAGS) -o $@ $<
-
-$(BUILD_PFX)%.s.d: %.s
-	$(if $(quiet),@echo "    [DEP] $@")
-	$(qexec)mkdir -p $(dir $@)
-	$(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \
-            --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@
-
-$(BUILD_PFX)%.s.o: %.s
-	$(if $(quiet),@echo "    [AS] $@")
-	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
-	$(qexec)$(AS) $(ASFLAGS) -o $@ $<
-
-.PRECIOUS: %.c.S
-%.c.S: CFLAGS += -DINLINE_ASM
-$(BUILD_PFX)%.c.S: %.c
-	$(if $(quiet),@echo "    [GEN] $@")
-	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
-	$(qexec)$(CC) -S $(CFLAGS) -o $@ $<
-
-.PRECIOUS: %.asm.s
-$(BUILD_PFX)%.asm.s: %.asm
-	$(if $(quiet),@echo "    [ASM CONVERSION] $@")
-	$(qexec)mkdir -p $(dir $@)
-	$(qexec)$(ASM_CONVERSION) <$< >$@
-
-# If we're in debug mode, pretend we don't have GNU strip, to fall back to
-# the copy implementation
-HAVE_GNU_STRIP := $(if $(CONFIG_DEBUG),,$(HAVE_GNU_STRIP))
-ifeq ($(HAVE_GNU_STRIP),yes)
-# Older binutils strip global symbols not needed for relocation processing
-# when given --strip-unneeded. Using nm and awk to identify globals and
-# keep them caused command line length issues under mingw and segfaults in
-# test_libvpx were observed under OS/2: simply use --strip-debug.
-%.a: %_g.a
-	$(if $(quiet),@echo "    [STRIP] $@ < $<")
-	$(qexec)$(STRIP) --strip-debug \
-          -o $@ $<
-else
-%.a: %_g.a
-	$(if $(quiet),@echo "    [CP] $@ < $<")
-	$(qexec)cp $< $@
-endif
-
-#
-# Utility functions
-#
-pairmap=$(if $(strip $(2)),\
-    $(call $(1),$(word 1,$(2)),$(word 2,$(2)))\
-    $(call pairmap,$(1),$(wordlist 3,$(words $(2)),$(2)))\
-)
-
-enabled=$(filter-out $($(1)-no),$($(1)-yes))
-cond_enabled=$(if $(filter yes,$($(1))), $(call enabled,$(2)))
-
-find_file1=$(word 1,$(wildcard $(subst //,/,$(addsuffix /$(1),$(2)))))
-find_file=$(foreach f,$(1),$(call find_file1,$(strip $(f)),$(strip $(2))) )
-obj_pats=.c=.c.o $(AS_SFX)=$(AS_SFX).o .cc=.cc.o .cpp=.cpp.o
-objs=$(addprefix $(BUILD_PFX),$(foreach p,$(obj_pats),$(filter %.o,$(1:$(p))) ))
-
-install_map_templates=$(eval $(call install_map_template,$(1),$(2)))
-
-not=$(subst yes,no,$(1))
-
-ifeq ($(CONFIG_MSVS),yes)
-lib_file_name=$(1).lib
-else
-lib_file_name=lib$(1).a
-endif
-#
-# Rule Templates
-#
-define linker_template
-$(1): $(filter-out -%,$(2))
-$(1):
-	$(if $(quiet),@echo    "    [LD] $$@")
-	$(qexec)$$(LD) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
-endef
-define linkerxx_template
-$(1): $(filter-out -%,$(2))
-$(1):
-	$(if $(quiet),@echo    "    [LD] $$@")
-	$(qexec)$$(CXX) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
-endef
-# make-3.80 has a bug with expanding large input strings to the eval function,
-# which was triggered in some cases by the following component of
-# linker_template:
-#   $(1): $$(call find_file, $(patsubst -l%,lib%.a,$(filter -l%,$(2))),\
-#                           $$(patsubst -L%,%,$$(filter -L%,$$(LDFLAGS) $(2))))
-# This may be useful to revisit in the future (it tries to locate libraries
-# in a search path and add them as prerequisites
-
-define install_map_template
-$(DIST_DIR)/$(1): $(2)
-	$(if $(quiet),@echo "    [INSTALL] $$@")
-	$(qexec)mkdir -p $$(dir $$@)
-	$(qexec)cp -p $$< $$@
-endef
-
-define archive_template
-# Not using a pattern rule here because we don't want to generate empty
-# archives when they are listed as a dependency in files not responsible
-# for creating them.
-$(1):
-	$(if $(quiet),@echo "    [AR] $$@")
-	$(qexec)$$(AR) $$(ARFLAGS) $$@ $$^
-endef
-
-define so_template
-# Not using a pattern rule here because we don't want to generate empty
-# archives when they are listed as a dependency in files not responsible
-# for creating them.
-#
-# This needs further abstraction for dealing with non-GNU linkers.
-$(1):
-	$(if $(quiet),@echo "    [LD] $$@")
-	$(qexec)$$(LD) -shared $$(LDFLAGS) \
-            -Wl,--no-undefined -Wl,-soname,$$(SONAME) \
-            -Wl,--version-script,$$(EXPORTS_FILE) -o $$@ \
-            $$(filter %.o,$$^) $$(extralibs)
-endef
-
-define dl_template
-# Not using a pattern rule here because we don't want to generate empty
-# archives when they are listed as a dependency in files not responsible
-# for creating them.
-$(1):
-	$(if $(quiet),@echo "    [LD] $$@")
-	$(qexec)$$(LD) -dynamiclib $$(LDFLAGS) \
-	    -exported_symbols_list $$(EXPORTS_FILE) \
-        -Wl,-headerpad_max_install_names,-compatibility_version,1.0,-current_version,$$(VERSION_MAJOR) \
-        -o $$@ \
-        $$(filter %.o,$$^) $$(extralibs)
-endef
-
-define dll_template
-# Not using a pattern rule here because we don't want to generate empty
-# archives when they are listed as a dependency in files not responsible
-# for creating them.
-$(1):
-	$(if $(quiet),@echo "    [LD] $$@")
-	$(qexec)$$(LD) -Zdll $$(LDFLAGS) \
-        -o $$@ \
-        $$(filter %.o,$$^) $$(extralibs) $$(EXPORTS_FILE)
-endef
-
-
-#
-# Get current configuration
-#
-ifneq ($(target),)
-include $(SRC_PATH_BARE)/$(target:-$(TOOLCHAIN)=).mk
-endif
-
-skip_deps := $(filter %clean,$(MAKECMDGOALS))
-skip_deps += $(findstring testdata,$(MAKECMDGOALS))
-ifeq ($(strip $(skip_deps)),)
-  ifeq ($(CONFIG_DEPENDENCY_TRACKING),yes)
-    # Older versions of make don't like -include directives with no arguments
-    ifneq ($(filter %.d,$(OBJS-yes:.o=.d)),)
-      -include $(filter %.d,$(OBJS-yes:.o=.d))
-    endif
-  endif
-endif
-
-#
-# Configuration dependent rules
-#
-$(call pairmap,install_map_templates,$(INSTALL_MAPS))
-
-DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,DOCS)
-.docs: $(DOCS)
-	@touch $@
-
-INSTALL-DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,INSTALL-DOCS)
-ifeq ($(MAKECMDGOALS),dist)
-INSTALL-DOCS+=$(call cond_enabled,CONFIG_INSTALL_DOCS,DIST-DOCS)
-endif
-.install-docs: .docs $(addprefix $(DIST_DIR)/,$(INSTALL-DOCS))
-	@touch $@
-
-clean::
-	rm -f .docs .install-docs $(DOCS)
-
-BINS=$(call enabled,BINS)
-.bins: $(BINS)
-	@touch $@
-
-INSTALL-BINS=$(call cond_enabled,CONFIG_INSTALL_BINS,INSTALL-BINS)
-ifeq ($(MAKECMDGOALS),dist)
-INSTALL-BINS+=$(call cond_enabled,CONFIG_INSTALL_BINS,DIST-BINS)
-endif
-.install-bins: .bins $(addprefix $(DIST_DIR)/,$(INSTALL-BINS))
-	@touch $@
-
-clean::
-	rm -f .bins .install-bins $(BINS)
-
-LIBS=$(call enabled,LIBS)
-.libs: $(LIBS)
-	@touch $@
-$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib))))
-$(foreach lib,$(filter %so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib))))
-$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib))))
-$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dll,$(LIBS)),$(eval $(call dll_template,$(lib))))
-
-INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS)
-ifeq ($(MAKECMDGOALS),dist)
-INSTALL-LIBS+=$(call cond_enabled,CONFIG_INSTALL_LIBS,DIST-LIBS)
-endif
-.install-libs: .libs $(addprefix $(DIST_DIR)/,$(INSTALL-LIBS))
-	@touch $@
-
-clean::
-	rm -f .libs .install-libs $(LIBS)
-
-ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
-PROJECTS=$(call enabled,PROJECTS)
-.projects: $(PROJECTS)
-	@touch $@
-
-INSTALL-PROJECTS=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,INSTALL-PROJECTS)
-ifeq ($(MAKECMDGOALS),dist)
-INSTALL-PROJECTS+=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,DIST-PROJECTS)
-endif
-.install-projects: .projects $(addprefix $(DIST_DIR)/,$(INSTALL-PROJECTS))
-	@touch $@
-
-clean::
-	rm -f .projects .install-projects $(PROJECTS)
-endif
-
-# If there are any source files to be distributed, then include the build
-# system too.
-ifneq ($(call enabled,DIST-SRCS),)
-    DIST-SRCS-yes            += configure
-    DIST-SRCS-yes            += build/make/configure.sh
-    DIST-SRCS-yes            += build/make/gen_asm_deps.sh
-    DIST-SRCS-yes            += build/make/Makefile
-    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_def.sh
-    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_proj.sh
-    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_sln.sh
-    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_vcxproj.sh
-    DIST-SRCS-$(CONFIG_MSVS)  += build/make/msvs_common.sh
-    DIST-SRCS-$(CONFIG_RVCT) += build/make/armlink_adapter.sh
-    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2gas.pl
-    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2gas_apple.pl
-    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2armasm_ms.pl
-    DIST-SRCS-$(ARCH_ARM)    += build/make/thumb.pm
-    DIST-SRCS-yes            += $(target:-$(TOOLCHAIN)=).mk
-endif
-INSTALL-SRCS := $(call cond_enabled,CONFIG_INSTALL_SRCS,INSTALL-SRCS)
-ifeq ($(MAKECMDGOALS),dist)
-INSTALL-SRCS += $(call cond_enabled,CONFIG_INSTALL_SRCS,DIST-SRCS)
-endif
-.install-srcs: $(addprefix $(DIST_DIR)/src/,$(INSTALL-SRCS))
-	@touch $@
-
-clean::
-	rm -f .install-srcs
-
-ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
-    BUILD_TARGETS += .projects
-    INSTALL_TARGETS += .install-projects
-endif
-BUILD_TARGETS += .docs .libs .bins
-INSTALL_TARGETS += .install-docs .install-srcs .install-libs .install-bins
-all: $(BUILD_TARGETS)
-install:: $(INSTALL_TARGETS)
-dist: $(INSTALL_TARGETS)
-test::
diff --git a/src/third_party/libvpx/build/make/ads2armasm_ms.pl b/src/third_party/libvpx/build/make/ads2armasm_ms.pl
deleted file mode 100755
index 2a2c470..0000000
--- a/src/third_party/libvpx/build/make/ads2armasm_ms.pl
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env perl
-##
-##  Copyright (c) 2013 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-use FindBin;
-use lib $FindBin::Bin;
-use thumb;
-
-print "; This file was created from a .asm file\n";
-print ";  using the ads2armasm_ms.pl script.\n";
-
-while (<STDIN>)
-{
-    undef $comment;
-    undef $line;
-
-    s/REQUIRE8//;
-    s/PRESERVE8//;
-    s/^\s*ARM\s*$//;
-    s/AREA\s+\|\|(.*)\|\|/AREA |$1|/;
-    s/qsubaddx/qsax/i;
-    s/qaddsubx/qasx/i;
-
-    thumb::FixThumbInstructions($_, 1);
-
-    s/ldrneb/ldrbne/i;
-    s/ldrneh/ldrhne/i;
-    s/^(\s*)ENDP.*/$&\n$1ALIGN 4/;
-
-    print;
-}
-
diff --git a/src/third_party/libvpx/build/make/ads2gas.pl b/src/third_party/libvpx/build/make/ads2gas.pl
deleted file mode 100755
index 7272424..0000000
--- a/src/third_party/libvpx/build/make/ads2gas.pl
+++ /dev/null
@@ -1,236 +0,0 @@
-#!/usr/bin/env perl
-##
-##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-
-# ads2gas.pl
-# Author: Eric Fung (efung (at) acm.org)
-#
-# Convert ARM Developer Suite 1.0.1 syntax assembly source to GNU as format
-#
-# Usage: cat inputfile | perl ads2gas.pl > outputfile
-#
-
-use FindBin;
-use lib $FindBin::Bin;
-use thumb;
-
-my $thumb = 0;
-
-foreach my $arg (@ARGV) {
-    $thumb = 1 if ($arg eq "-thumb");
-}
-
-print "@ This file was created from a .asm file\n";
-print "@  using the ads2gas.pl script.\n";
-print "\t.equ DO1STROUNDING, 0\n";
-if ($thumb) {
-    print "\t.syntax unified\n";
-    print "\t.thumb\n";
-}
-
-# Stack of procedure names.
-@proc_stack = ();
-
-while (<STDIN>)
-{
-    undef $comment;
-    undef $line;
-    $comment_char = ";";
-    $comment_sub = "@";
-
-    # Handle comments.
-    if (/$comment_char/)
-    {
-      $comment = "";
-      ($line, $comment) = /(.*?)$comment_char(.*)/;
-      $_ = $line;
-    }
-
-    # Load and store alignment
-    s/@/,:/g;
-
-    # Hexadecimal constants prefaced by 0x
-    s/#&/#0x/g;
-
-    # Convert :OR: to |
-    s/:OR:/ | /g;
-
-    # Convert :AND: to &
-    s/:AND:/ & /g;
-
-    # Convert :NOT: to ~
-    s/:NOT:/ ~ /g;
-
-    # Convert :SHL: to <<
-    s/:SHL:/ << /g;
-
-    # Convert :SHR: to >>
-    s/:SHR:/ >> /g;
-
-    # Convert ELSE to .else
-    s/\bELSE\b/.else/g;
-
-    # Convert ENDIF to .endif
-    s/\bENDIF\b/.endif/g;
-
-    # Convert ELSEIF to .elseif
-    s/\bELSEIF\b/.elseif/g;
-
-    # Convert LTORG to .ltorg
-    s/\bLTORG\b/.ltorg/g;
-
-    # Convert endfunc to nothing.
-    s/\bendfunc\b//ig;
-
-    # Convert FUNCTION to nothing.
-    s/\bFUNCTION\b//g;
-    s/\bfunction\b//g;
-
-    s/\bENTRY\b//g;
-    s/\bMSARMASM\b/0/g;
-    s/^\s+end\s+$//g;
-
-    # Convert IF :DEF:to .if
-    # gcc doesn't have the ability to do a conditional
-    # if defined variable that is set by IF :DEF: on
-    # armasm, so convert it to a normal .if and then
-    # make sure to define a value elesewhere
-    if (s/\bIF :DEF:\b/.if /g)
-    {
-        s/=/==/g;
-    }
-
-    # Convert IF to .if
-    if (s/\bIF\b/.if/g)
-    {
-        s/=+/==/g;
-    }
-
-    # Convert INCLUDE to .INCLUDE "file"
-    s/INCLUDE(\s*)(.*)$/.include $1\"$2\"/;
-
-    # Code directive (ARM vs Thumb)
-    s/CODE([0-9][0-9])/.code $1/;
-
-    # No AREA required
-    # But ALIGNs in AREA must be obeyed
-    s/^\s*AREA.*ALIGN=([0-9])$/.text\n.p2align $1/;
-    # If no ALIGN, strip the AREA and align to 4 bytes
-    s/^\s*AREA.*$/.text\n.p2align 2/;
-
-    # DCD to .word
-    # This one is for incoming symbols
-    s/DCD\s+\|(\w*)\|/.long $1/;
-
-    # DCW to .short
-    s/DCW\s+\|(\w*)\|/.short $1/;
-    s/DCW(.*)/.short $1/;
-
-    # Constants defined in scope
-    s/DCD(.*)/.long $1/;
-    s/DCB(.*)/.byte $1/;
-
-    # RN to .req
-    if (s/RN\s+([Rr]\d+|lr)/.req $1/)
-    {
-        print;
-        print "$comment_sub$comment\n" if defined $comment;
-        next;
-    }
-
-    # Make function visible to linker, and make additional symbol with
-    # prepended underscore
-    s/EXPORT\s+\|([\$\w]*)\|/.global $1 \n\t.type $1, function/;
-    s/IMPORT\s+\|([\$\w]*)\|/.global $1/;
-
-    s/EXPORT\s+([\$\w]*)/.global $1/;
-    s/export\s+([\$\w]*)/.global $1/;
-
-    # No vertical bars required; make additional symbol with prepended
-    # underscore
-    s/^\|(\$?\w+)\|/_$1\n\t$1:/g;
-
-    # Labels need trailing colon
-#   s/^(\w+)/$1:/ if !/EQU/;
-    # put the colon at the end of the line in the macro
-    s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/;
-
-    # ALIGN directive
-    s/\bALIGN\b/.balign/g;
-
-    if ($thumb) {
-        # ARM code - we force everything to thumb with the declaration in the header
-        s/\sARM//g;
-    } else {
-        # ARM code
-        s/\sARM/.arm/g;
-    }
-
-    # push/pop
-    s/(push\s+)(r\d+)/stmdb sp\!, \{$2\}/g;
-    s/(pop\s+)(r\d+)/ldmia sp\!, \{$2\}/g;
-
-    # NEON code
-    s/(vld1.\d+\s+)(q\d+)/$1\{$2\}/g;
-    s/(vtbl.\d+\s+[^,]+),([^,]+)/$1,\{$2\}/g;
-
-    if ($thumb) {
-        thumb::FixThumbInstructions($_, 0);
-    }
-
-    # eabi_attributes numerical equivalents can be found in the
-    # "ARM IHI 0045C" document.
-
-    # REQUIRE8 Stack is required to be 8-byte aligned
-    s/\sREQUIRE8/.eabi_attribute 24, 1 \@Tag_ABI_align_needed/g;
-
-    # PRESERVE8 Stack 8-byte align is preserved
-    s/\sPRESERVE8/.eabi_attribute 25, 1 \@Tag_ABI_align_preserved/g;
-
-    # Use PROC and ENDP to give the symbols a .size directive.
-    # This makes them show up properly in debugging tools like gdb and valgrind.
-    if (/\bPROC\b/)
-    {
-        my $proc;
-        /^_([\.0-9A-Z_a-z]\w+)\b/;
-        $proc = $1;
-        push(@proc_stack, $proc) if ($proc);
-        s/\bPROC\b/@ $&/;
-    }
-    if (/\bENDP\b/)
-    {
-        my $proc;
-        s/\bENDP\b/@ $&/;
-        $proc = pop(@proc_stack);
-        $_ = "\t.size $proc, .-$proc".$_ if ($proc);
-    }
-
-    # EQU directive
-    s/(\S+\s+)EQU(\s+\S+)/.equ $1, $2/;
-
-    # Begin macro definition
-    if (/\bMACRO\b/) {
-        $_ = <STDIN>;
-        s/^/.macro/;
-        s/\$//g;                # remove formal param reference
-        s/;/@/g;                # change comment characters
-    }
-
-    # For macros, use \ to reference formal params
-    s/\$/\\/g;                  # End macro definition
-    s/\bMEND\b/.endm/;              # No need to tell it where to stop assembling
-    next if /^\s*END\s*$/;
-    print;
-    print "$comment_sub$comment\n" if defined $comment;
-}
-
-# Mark that this object doesn't need an executable stack.
-printf ("\t.section\t.note.GNU-stack,\"\",\%\%progbits\n");
diff --git a/src/third_party/libvpx/build/make/ads2gas_apple.pl b/src/third_party/libvpx/build/make/ads2gas_apple.pl
deleted file mode 100755
index a82f3eb..0000000
--- a/src/third_party/libvpx/build/make/ads2gas_apple.pl
+++ /dev/null
@@ -1,235 +0,0 @@
-#!/usr/bin/env perl
-##
-##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-
-# ads2gas_apple.pl
-# Author: Eric Fung (efung (at) acm.org)
-#
-# Convert ARM Developer Suite 1.0.1 syntax assembly source to GNU as format
-#
-# Usage: cat inputfile | perl ads2gas_apple.pl > outputfile
-#
-
-my $chromium = 0;
-
-foreach my $arg (@ARGV) {
-    $chromium = 1 if ($arg eq "-chromium");
-}
-
-print "@ This file was created from a .asm file\n";
-print "@  using the ads2gas_apple.pl script.\n\n";
-print "\t.set WIDE_REFERENCE, 0\n";
-print "\t.set ARCHITECTURE, 5\n";
-print "\t.set DO1STROUNDING, 0\n";
-
-my %register_aliases;
-my %macro_aliases;
-
-my @mapping_list = ("\$0", "\$1", "\$2", "\$3", "\$4", "\$5", "\$6", "\$7", "\$8", "\$9");
-
-my @incoming_array;
-
-my @imported_functions;
-
-# Perl trim function to remove whitespace from the start and end of the string
-sub trim($)
-{
-    my $string = shift;
-    $string =~ s/^\s+//;
-    $string =~ s/\s+$//;
-    return $string;
-}
-
-while (<STDIN>)
-{
-    # Load and store alignment
-    s/@/,:/g;
-
-    # Comment character
-    s/;/ @/g;
-
-    # Hexadecimal constants prefaced by 0x
-    s/#&/#0x/g;
-
-    # Convert :OR: to |
-    s/:OR:/ | /g;
-
-    # Convert :AND: to &
-    s/:AND:/ & /g;
-
-    # Convert :NOT: to ~
-    s/:NOT:/ ~ /g;
-
-    # Convert :SHL: to <<
-    s/:SHL:/ << /g;
-
-    # Convert :SHR: to >>
-    s/:SHR:/ >> /g;
-
-    # Convert ELSE to .else
-    s/\bELSE\b/.else/g;
-
-    # Convert ENDIF to .endif
-    s/\bENDIF\b/.endif/g;
-
-    # Convert ELSEIF to .elseif
-    s/\bELSEIF\b/.elseif/g;
-
-    # Convert LTORG to .ltorg
-    s/\bLTORG\b/.ltorg/g;
-
-    # Convert IF :DEF:to .if
-    # gcc doesn't have the ability to do a conditional
-    # if defined variable that is set by IF :DEF: on
-    # armasm, so convert it to a normal .if and then
-    # make sure to define a value elesewhere
-    if (s/\bIF :DEF:\b/.if /g)
-    {
-        s/=/==/g;
-    }
-
-    # Convert IF to .if
-    if (s/\bIF\b/.if/g)
-    {
-        s/=/==/g;
-    }
-
-    # Convert INCLUDE to .INCLUDE "file"
-    s/INCLUDE(\s*)(.*)$/.include $1\"$2\"/;
-
-    # Code directive (ARM vs Thumb)
-    s/CODE([0-9][0-9])/.code $1/;
-
-    # No AREA required
-    # But ALIGNs in AREA must be obeyed
-    s/^\s*AREA.*ALIGN=([0-9])$/.text\n.p2align $1/;
-    # If no ALIGN, strip the AREA and align to 4 bytes
-    s/^\s*AREA.*$/.text\n.p2align 2/;
-
-    # DCD to .word
-    # This one is for incoming symbols
-    s/DCD\s+\|(\w*)\|/.long $1/;
-
-    # DCW to .short
-    s/DCW\s+\|(\w*)\|/.short $1/;
-    s/DCW(.*)/.short $1/;
-
-    # Constants defined in scope
-    s/DCD(.*)/.long $1/;
-    s/DCB(.*)/.byte $1/;
-
-    # Build a hash of all the register - alias pairs.
-    if (s/(.*)RN(.*)/$1 .req $2/g)
-    {
-        $register_aliases{trim($1)} = trim($2);
-        next;
-    }
-
-    while (($key, $value) = each(%register_aliases))
-    {
-        s/\b$key\b/$value/g;
-    }
-
-    # Make function visible to linker, and make additional symbol with
-    # prepended underscore
-    s/EXPORT\s+\|([\$\w]*)\|/.globl _$1\n\t.globl $1/;
-
-    # Prepend imported functions with _
-    if (s/IMPORT\s+\|([\$\w]*)\|/.globl $1/)
-    {
-        $function = trim($1);
-        push(@imported_functions, $function);
-    }
-
-    foreach $function (@imported_functions)
-    {
-        s/$function/_$function/;
-    }
-
-    # No vertical bars required; make additional symbol with prepended
-    # underscore
-    s/^\|(\$?\w+)\|/_$1\n\t$1:/g;
-
-    # Labels need trailing colon
-#   s/^(\w+)/$1:/ if !/EQU/;
-    # put the colon at the end of the line in the macro
-    s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/;
-
-    # ALIGN directive
-    s/\bALIGN\b/.balign/g;
-
-    # Strip ARM
-    s/\sARM/@ ARM/g;
-
-    # Strip REQUIRE8
-    #s/\sREQUIRE8/@ REQUIRE8/g;
-    s/\sREQUIRE8/@ /g;
-
-    # Strip PRESERVE8
-    s/\sPRESERVE8/@ PRESERVE8/g;
-
-    # Strip PROC and ENDPROC
-    s/\bPROC\b/@/g;
-    s/\bENDP\b/@/g;
-
-    # EQU directive
-    s/(.*)EQU(.*)/.set $1, $2/;
-
-    # Begin macro definition
-    if (/\bMACRO\b/)
-    {
-        # Process next line down, which will be the macro definition
-        $_ = <STDIN>;
-
-        $trimmed = trim($_);
-
-        # remove commas that are separating list
-        $trimmed =~ s/,//g;
-
-        # string to array
-        @incoming_array = split(/\s+/, $trimmed);
-
-        print ".macro @incoming_array[0]\n";
-
-        # remove the first element, as that is the name of the macro
-        shift (@incoming_array);
-
-        @macro_aliases{@incoming_array} = @mapping_list;
-
-        next;
-    }
-
-    while (($key, $value) = each(%macro_aliases))
-    {
-        $key =~ s/\$/\\\$/;
-        s/$key\b/$value/g;
-    }
-
-    # For macros, use \ to reference formal params
-#   s/\$/\\/g;                  # End macro definition
-    s/\bMEND\b/.endm/;              # No need to tell it where to stop assembling
-    next if /^\s*END\s*$/;
-
-    # Clang used by Chromium differs slightly from clang in XCode in what it
-    # will accept in the assembly.
-    if ($chromium) {
-        s/qsubaddx/qsax/i;
-        s/qaddsubx/qasx/i;
-        s/ldrneb/ldrbne/i;
-        s/ldrneh/ldrhne/i;
-        s/(vqshrun\.s16 .*, \#)0$/${1}8/i;
-
-        # http://llvm.org/bugs/show_bug.cgi?id=16022
-        s/\.include/#include/;
-    }
-
-    print;
-}
diff --git a/src/third_party/libvpx/build/make/armlink_adapter.sh b/src/third_party/libvpx/build/make/armlink_adapter.sh
deleted file mode 100755
index 75c342e..0000000
--- a/src/third_party/libvpx/build/make/armlink_adapter.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-##
-##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-
-verbose=0
-set -- $*
-for i; do
-    if [ "$i" = "-o" ]; then
-        on_of=1
-    elif [ "$i" = "-v" ]; then
-        verbose=1
-    elif [ "$i" = "-g" ]; then
-        args="${args} --debug"
-    elif [ "$on_of" = "1" ]; then
-        outfile=$i
-        on_of=0
-    elif [ -f "$i" ]; then
-        infiles="$infiles $i"
-    elif [ "${i#-l}" != "$i" ]; then
-        libs="$libs ${i#-l}"
-    elif [ "${i#-L}" != "$i" ]; then
-        libpaths="${libpaths} ${i#-L}"
-    else
-        args="${args} ${i}"
-    fi
-    shift
-done
-
-# Absolutize library file names
-for f in $libs; do
-    found=0
-    for d in $libpaths; do
-        [ -f "$d/$f" ] && infiles="$infiles $d/$f" && found=1 && break
-        [ -f "$d/lib${f}.so" ] && infiles="$infiles $d/lib${f}.so" && found=1 && break
-        [ -f "$d/lib${f}.a" ] && infiles="$infiles $d/lib${f}.a" && found=1 && break
-    done
-    [ $found -eq 0 ] && infiles="$infiles $f"
-done
-for d in $libpaths; do
-    [ -n "$libsearchpath" ] && libsearchpath="${libsearchpath},"
-    libsearchpath="${libsearchpath}$d"
-done
-
-cmd="armlink $args --userlibpath=$libsearchpath --output=$outfile $infiles"
-[ $verbose -eq 1 ] && echo $cmd
-$cmd
diff --git a/src/third_party/libvpx/build/make/configure.sh b/src/third_party/libvpx/build/make/configure.sh
deleted file mode 100755
index a8140e5..0000000
--- a/src/third_party/libvpx/build/make/configure.sh
+++ /dev/null
@@ -1,1603 +0,0 @@
-#!/bin/sh
-##
-##  configure.sh
-##
-##  This script is sourced by the main configure script and contains
-##  utility functions and other common bits that aren't strictly libvpx
-##  related.
-##
-##  This build system is based in part on the FFmpeg configure script.
-##
-
-
-#
-# Logging / Output Functions
-#
-die_unknown(){
-  echo "Unknown option \"$1\"."
-  echo "See $0 --help for available options."
-  clean_temp_files
-  exit 1
-}
-
-die() {
-  echo "$@"
-  echo
-  echo "Configuration failed. This could reflect a misconfiguration of your"
-  echo "toolchains, improper options selected, or another problem. If you"
-  echo "don't see any useful error messages above, the next step is to look"
-  echo "at the configure error log file ($logfile) to determine what"
-  echo "configure was trying to do when it died."
-  clean_temp_files
-  exit 1
-}
-
-log(){
-  echo "$@" >>$logfile
-}
-
-log_file(){
-  log BEGIN $1
-  cat -n $1 >>$logfile
-  log END $1
-}
-
-log_echo() {
-  echo "$@"
-  log "$@"
-}
-
-fwrite () {
-  outfile=$1
-  shift
-  echo "$@" >> ${outfile}
-}
-
-show_help_pre(){
-  for opt in ${CMDLINE_SELECT}; do
-    opt2=`echo $opt | sed -e 's;_;-;g'`
-    if enabled $opt; then
-      eval "toggle_${opt}=\"--disable-${opt2}\""
-    else
-      eval "toggle_${opt}=\"--enable-${opt2} \""
-    fi
-  done
-
-  cat <<EOF
-Usage: configure [options]
-Options:
-
-Build options:
-  --help                      print this message
-  --log=yes|no|FILE           file configure log is written to [config.log]
-  --target=TARGET             target platform tuple [generic-gnu]
-  --cpu=CPU                   optimize for a specific cpu rather than a family
-  --extra-cflags=ECFLAGS      add ECFLAGS to CFLAGS [$CFLAGS]
-  --extra-cxxflags=ECXXFLAGS  add ECXXFLAGS to CXXFLAGS [$CXXFLAGS]
-  ${toggle_extra_warnings}    emit harmless warnings (always non-fatal)
-  ${toggle_werror}            treat warnings as errors, if possible
-                              (not available with all compilers)
-  ${toggle_optimizations}     turn on/off compiler optimization flags
-  ${toggle_pic}               turn on/off Position Independent Code
-  ${toggle_ccache}            turn on/off compiler cache
-  ${toggle_debug}             enable/disable debug mode
-  ${toggle_gprof}             enable/disable gprof profiling instrumentation
-  ${toggle_gcov}              enable/disable gcov coverage instrumentation
-  ${toggle_thumb}             enable/disable building arm assembly in thumb mode
-  ${toggle_dependency_tracking}
-                              disable to speed up one-time build
-
-Install options:
-  ${toggle_install_docs}      control whether docs are installed
-  ${toggle_install_bins}      control whether binaries are installed
-  ${toggle_install_libs}      control whether libraries are installed
-  ${toggle_install_srcs}      control whether sources are installed
-
-
-EOF
-}
-
-show_help_post(){
-  cat <<EOF
-
-
-NOTES:
-    Object files are built at the place where configure is launched.
-
-    All boolean options can be negated. The default value is the opposite
-    of that shown above. If the option --disable-foo is listed, then
-    the default value for foo is enabled.
-
-Supported targets:
-EOF
-  show_targets ${all_platforms}
-  echo
-  exit 1
-}
-
-show_targets() {
-  while [ -n "$*" ]; do
-    if [ "${1%%-*}" = "${2%%-*}" ]; then
-      if [ "${2%%-*}" = "${3%%-*}" ]; then
-        printf "    %-24s %-24s %-24s\n" "$1" "$2" "$3"
-        shift; shift; shift
-      else
-        printf "    %-24s %-24s\n" "$1" "$2"
-        shift; shift
-      fi
-    else
-      printf "    %-24s\n" "$1"
-      shift
-    fi
-  done
-}
-
-show_help() {
-  show_help_pre
-  show_help_post
-}
-
-#
-# List Processing Functions
-#
-set_all(){
-  value=$1
-  shift
-  for var in $*; do
-    eval $var=$value
-  done
-}
-
-is_in(){
-  value=$1
-  shift
-  for var in $*; do
-    [ $var = $value ] && return 0
-  done
-  return 1
-}
-
-add_cflags() {
-  CFLAGS="${CFLAGS} $@"
-  CXXFLAGS="${CXXFLAGS} $@"
-}
-
-add_cflags_only() {
-  CFLAGS="${CFLAGS} $@"
-}
-
-add_cxxflags_only() {
-  CXXFLAGS="${CXXFLAGS} $@"
-}
-
-add_ldflags() {
-  LDFLAGS="${LDFLAGS} $@"
-}
-
-add_asflags() {
-  ASFLAGS="${ASFLAGS} $@"
-}
-
-add_extralibs() {
-  extralibs="${extralibs} $@"
-}
-
-#
-# Boolean Manipulation Functions
-#
-
-enable_codec(){
-  enabled $1 || echo "  enabling $1"
-  set_all yes $1
-
-  is_in $1 vp8 vp9 vp10 && \
-    set_all yes $1_encoder && \
-    set_all yes $1_decoder
-}
-
-disable_codec(){
-  disabled $1 || echo "  disabling $1"
-  set_all no $1
-
-  is_in $1 vp8 vp9 vp10 && \
-    set_all no $1_encoder && \
-    set_all no $1_decoder
-}
-
-enable_feature(){
-  set_all yes $*
-}
-
-disable_feature(){
-  set_all no $*
-}
-
-enabled(){
-  eval test "x\$$1" = "xyes"
-}
-
-disabled(){
-  eval test "x\$$1" = "xno"
-}
-
-# Iterates through positional parameters, checks to confirm the parameter has
-# not been explicitly (force) disabled, and enables the setting controlled by
-# the parameter when the setting is not disabled.
-# Note: Does NOT alter RTCD generation options ($RTCD_OPTIONS).
-soft_enable() {
-  for var in $*; do
-    if ! disabled $var; then
-      enabled $var || log_echo "  enabling $var"
-      enable_feature $var
-    fi
-  done
-}
-
-# Iterates through positional parameters, checks to confirm the parameter has
-# not been explicitly (force) enabled, and disables the setting controlled by
-# the parameter when the setting is not enabled.
-# Note: Does NOT alter RTCD generation options ($RTCD_OPTIONS).
-soft_disable() {
-  for var in $*; do
-    if ! enabled $var; then
-      disabled $var || log_echo "  disabling $var"
-      disable_feature $var
-    fi
-  done
-}
-
-#
-# Text Processing Functions
-#
-toupper(){
-  echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
-}
-
-tolower(){
-  echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
-}
-
-#
-# Temporary File Functions
-#
-source_path=${0%/*}
-enable_feature source_path_used
-if [ -z "$source_path" ] || [ "$source_path" = "." ]; then
-  #source_path="`pwd`"
-  source_path='.'
-  disable_feature source_path_used
-fi
-
-if test ! -z "$TMPDIR" ; then
-  TMPDIRx="${TMPDIR}"
-elif test ! -z "$TEMPDIR" ; then
-  TMPDIRx="${TEMPDIR}"
-else
-  TMPDIRx="/tmp"
-fi
-RAND=$(awk 'BEGIN { srand(); printf "%d\n",(rand() * 32768)}')
-TMP_H="${TMPDIRx}/vpx-conf-$$-${RAND}.h"
-TMP_C="${TMPDIRx}/vpx-conf-$$-${RAND}.c"
-TMP_CC="${TMPDIRx}/vpx-conf-$$-${RAND}.cc"
-TMP_O="${TMPDIRx}/vpx-conf-$$-${RAND}.o"
-TMP_X="${TMPDIRx}/vpx-conf-$$-${RAND}.x"
-TMP_ASM="${TMPDIRx}/vpx-conf-$$-${RAND}.asm"
-
-clean_temp_files() {
-  rm -f ${TMP_C} ${TMP_CC} ${TMP_H} ${TMP_O} ${TMP_X} ${TMP_ASM}
-  enabled gcov && rm -f ${TMP_C%.c}.gcno ${TMP_CC%.cc}.gcno
-}
-
-#
-# Toolchain Check Functions
-#
-check_cmd() {
-  enabled external_build && return
-  log "$@"
-  "$@" >>${logfile} 2>&1
-}
-
-check_cc() {
-  log check_cc "$@"
-  cat >${TMP_C}
-  log_file ${TMP_C}
-  check_cmd ${CC} ${CFLAGS} "$@" -c -o ${TMP_O} ${TMP_C}
-}
-
-check_cxx() {
-  log check_cxx "$@"
-  cat >${TMP_CC}
-  log_file ${TMP_CC}
-  check_cmd ${CXX} ${CXXFLAGS} "$@" -c -o ${TMP_O} ${TMP_CC}
-}
-
-check_cpp() {
-  log check_cpp "$@"
-  cat > ${TMP_C}
-  log_file ${TMP_C}
-  check_cmd ${CC} ${CFLAGS} "$@" -E -o ${TMP_O} ${TMP_C}
-}
-
-check_ld() {
-  log check_ld "$@"
-  check_cc $@ \
-    && check_cmd ${LD} ${LDFLAGS} "$@" -o ${TMP_X} ${TMP_O} ${extralibs}
-}
-
-check_header(){
-  log check_header "$@"
-  header=$1
-  shift
-  var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
-  disable_feature $var
-  check_cpp "$@" <<EOF && enable_feature $var
-#include "$header"
-int x;
-EOF
-}
-
-check_cflags() {
- log check_cflags "$@"
- check_cc -Werror "$@" <<EOF
-int x;
-EOF
-}
-
-check_cxxflags() {
-  log check_cxxflags "$@"
-
-  # Catch CFLAGS that trigger CXX warnings
-  case "$CXX" in
-    *c++-analyzer|*clang++|*g++*)
-      check_cxx -Werror "$@" <<EOF
-int x;
-EOF
-      ;;
-    *)
-      check_cxx -Werror "$@" <<EOF
-int x;
-EOF
-      ;;
-    esac
-}
-
-check_add_cflags() {
-  check_cxxflags "$@" && add_cxxflags_only "$@"
-  check_cflags "$@" && add_cflags_only "$@"
-}
-
-check_add_cxxflags() {
-  check_cxxflags "$@" && add_cxxflags_only "$@"
-}
-
-check_add_asflags() {
-  log add_asflags "$@"
-  add_asflags "$@"
-}
-
-check_add_ldflags() {
-  log add_ldflags "$@"
-  add_ldflags "$@"
-}
-
-check_asm_align() {
-  log check_asm_align "$@"
-  cat >${TMP_ASM} <<EOF
-section .rodata
-align 16
-EOF
-  log_file ${TMP_ASM}
-  check_cmd ${AS} ${ASFLAGS} -o ${TMP_O} ${TMP_ASM}
-  readelf -WS ${TMP_O} >${TMP_X}
-  log_file ${TMP_X}
-  if ! grep -q '\.rodata .* 16$' ${TMP_X}; then
-    die "${AS} ${ASFLAGS} does not support section alignment (nasm <=2.08?)"
-  fi
-}
-
-# tests for -m$1 toggling the feature given in $2. If $2 is empty $1 is used.
-check_gcc_machine_option() {
-  opt="$1"
-  feature="$2"
-  [ -n "$feature" ] || feature="$opt"
-
-  if enabled gcc && ! disabled "$feature" && ! check_cflags "-m$opt"; then
-    RTCD_OPTIONS="${RTCD_OPTIONS}--disable-$feature "
-  else
-    soft_enable "$feature"
-  fi
-}
-
-write_common_config_banner() {
-  print_webm_license config.mk "##" ""
-  echo '# This file automatically generated by configure. Do not edit!' >> config.mk
-  echo "TOOLCHAIN := ${toolchain}" >> config.mk
-
-  case ${toolchain} in
-    *-linux-rvct)
-      echo "ALT_LIBC := ${alt_libc}" >> config.mk
-      ;;
-  esac
-}
-
-write_common_config_targets() {
-  for t in ${all_targets}; do
-    if enabled ${t}; then
-      if enabled child; then
-        fwrite config.mk "ALL_TARGETS += ${t}-${toolchain}"
-      else
-        fwrite config.mk "ALL_TARGETS += ${t}"
-      fi
-    fi
-    true;
-  done
-  true
-}
-
-write_common_target_config_mk() {
-  saved_CC="${CC}"
-  saved_CXX="${CXX}"
-  enabled ccache && CC="ccache ${CC}"
-  enabled ccache && CXX="ccache ${CXX}"
-  print_webm_license $1 "##" ""
-
-  cat >> $1 << EOF
-# This file automatically generated by configure. Do not edit!
-SRC_PATH="$source_path"
-SRC_PATH_BARE=$source_path
-BUILD_PFX=${BUILD_PFX}
-TOOLCHAIN=${toolchain}
-ASM_CONVERSION=${asm_conversion_cmd:-${source_path}/build/make/ads2gas.pl}
-GEN_VCPROJ=${gen_vcproj_cmd}
-MSVS_ARCH_DIR=${msvs_arch_dir}
-
-CC=${CC}
-CXX=${CXX}
-AR=${AR}
-LD=${LD}
-AS=${AS}
-STRIP=${STRIP}
-NM=${NM}
-
-CFLAGS  = ${CFLAGS}
-CXXFLAGS  = ${CXXFLAGS}
-ARFLAGS = -crs\$(if \$(quiet),,v)
-LDFLAGS = ${LDFLAGS}
-ASFLAGS = ${ASFLAGS}
-extralibs = ${extralibs}
-AS_SFX    = ${AS_SFX:-.asm}
-EXE_SFX   = ${EXE_SFX}
-VCPROJ_SFX = ${VCPROJ_SFX}
-RTCD_OPTIONS = ${RTCD_OPTIONS}
-EOF
-
-  if enabled rvct; then cat >> $1 << EOF
-fmt_deps = sed -e 's;^__image.axf;\${@:.d=.o} \$@;' #hide
-EOF
-elif enabled orbis; then cat >> $1 << EOF
-fmt_deps = python fix_orbis_deps.py
-EOF
-  else cat >> $1 << EOF
-fmt_deps = sed -e 's;^\([a-zA-Z0-9_]*\)\.o;\${@:.d=.o} \$@;'
-EOF
-  fi
-
-  print_config_mk ARCH   "${1}" ${ARCH_LIST}
-  print_config_mk HAVE   "${1}" ${HAVE_LIST}
-  print_config_mk CONFIG "${1}" ${CONFIG_LIST}
-  print_config_mk HAVE   "${1}" gnu_strip
-
-  enabled msvs && echo "CONFIG_VS_VERSION=${vs_version}" >> "${1}"
-
-  CC="${saved_CC}"
-  CXX="${saved_CXX}"
-}
-
-write_common_target_config_h() {
-  print_webm_license ${TMP_H} "/*" " */"
-  cat >> ${TMP_H} << EOF
-/* This file automatically generated by configure. Do not edit! */
-#ifndef VPX_CONFIG_H
-#define VPX_CONFIG_H
-#define RESTRICT    ${RESTRICT}
-#define INLINE      ${INLINE}
-EOF
-  print_config_h ARCH   "${TMP_H}" ${ARCH_LIST}
-  print_config_h HAVE   "${TMP_H}" ${HAVE_LIST}
-  print_config_h CONFIG "${TMP_H}" ${CONFIG_LIST}
-  print_config_vars_h   "${TMP_H}" ${VAR_LIST}
-  echo "#endif /* VPX_CONFIG_H */" >> ${TMP_H}
-  mkdir -p `dirname "$1"`
-  cmp "$1" ${TMP_H} >/dev/null 2>&1 || mv ${TMP_H} "$1"
-}
-
-process_common_cmdline() {
-  for opt in "$@"; do
-    optval="${opt#*=}"
-    case "$opt" in
-      --child)
-        enable_feature child
-        ;;
-      --log*)
-        logging="$optval"
-        if ! disabled logging ; then
-          enabled logging || logfile="$logging"
-        else
-          logfile=/dev/null
-        fi
-        ;;
-      --target=*)
-        toolchain="${toolchain:-${optval}}"
-        ;;
-      --force-target=*)
-        toolchain="${toolchain:-${optval}}"
-        enable_feature force_toolchain
-        ;;
-      --cpu=*)
-        tune_cpu="$optval"
-        ;;
-      --extra-cflags=*)
-        extra_cflags="${optval}"
-        ;;
-      --extra-cxxflags=*)
-        extra_cxxflags="${optval}"
-        ;;
-      --enable-?*|--disable-?*)
-        eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
-        if is_in ${option} ${ARCH_EXT_LIST}; then
-          [ $action = "disable" ] && RTCD_OPTIONS="${RTCD_OPTIONS}--disable-${option} "
-        elif [ $action = "disable" ] && ! disabled $option ; then
-          is_in ${option} ${CMDLINE_SELECT} || die_unknown $opt
-          log_echo "  disabling $option"
-        elif [ $action = "enable" ] && ! enabled $option ; then
-          is_in ${option} ${CMDLINE_SELECT} || die_unknown $opt
-          log_echo "  enabling $option"
-        fi
-        ${action}_feature $option
-        ;;
-      --require-?*)
-        eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
-        if is_in ${option} ${ARCH_EXT_LIST}; then
-            RTCD_OPTIONS="${RTCD_OPTIONS}${opt} "
-        else
-            die_unknown $opt
-        fi
-        ;;
-      --force-enable-?*|--force-disable-?*)
-        eval `echo "$opt" | sed 's/--force-/action=/;s/-/ option=/;s/-/_/g'`
-        ${action}_feature $option
-        ;;
-      --libc=*)
-        [ -d "${optval}" ] || die "Not a directory: ${optval}"
-        disable_feature builtin_libc
-        alt_libc="${optval}"
-        ;;
-      --as=*)
-        [ "${optval}" = yasm ] || [ "${optval}" = nasm ] \
-          || [ "${optval}" = auto ] \
-          || die "Must be yasm, nasm or auto: ${optval}"
-        alt_as="${optval}"
-        ;;
-      --size-limit=*)
-        w="${optval%%x*}"
-        h="${optval##*x}"
-        VAR_LIST="DECODE_WIDTH_LIMIT ${w} DECODE_HEIGHT_LIMIT ${h}"
-        [ ${w} -gt 0 ] && [ ${h} -gt 0 ] || die "Invalid size-limit: too small."
-        [ ${w} -lt 65536 ] && [ ${h} -lt 65536 ] \
-            || die "Invalid size-limit: too big."
-        enable_feature size_limit
-        ;;
-      --prefix=*)
-        prefix="${optval}"
-        ;;
-      --libdir=*)
-        libdir="${optval}"
-        ;;
-      --sdk-path=*)
-        [ -d "${optval}" ] || die "Not a directory: ${optval}"
-        sdk_path="${optval}"
-        ;;
-      --libc|--as|--prefix|--libdir|--sdk-path)
-        die "Option ${opt} requires argument"
-        ;;
-      --help|-h)
-        show_help
-        ;;
-      *)
-        die_unknown $opt
-        ;;
-    esac
-  done
-}
-
-process_cmdline() {
-  for opt do
-    optval="${opt#*=}"
-    case "$opt" in
-      *)
-        process_common_cmdline $opt
-        ;;
-    esac
-  done
-}
-
-post_process_common_cmdline() {
-  prefix="${prefix:-/usr/local}"
-  prefix="${prefix%/}"
-  libdir="${libdir:-${prefix}/lib}"
-  libdir="${libdir%/}"
-  if [ "${libdir#${prefix}}" = "${libdir}" ]; then
-    die "Libdir ${libdir} must be a subdirectory of ${prefix}"
-  fi
-}
-
-post_process_cmdline() {
-  true;
-}
-
-setup_gnu_toolchain() {
-  CC=${CC:-${CROSS}gcc}
-  CXX=${CXX:-${CROSS}g++}
-  AR=${AR:-${CROSS}ar}
-  LD=${LD:-${CROSS}${link_with_cc:-ld}}
-  AS=${AS:-${CROSS}as}
-  STRIP=${STRIP:-${CROSS}strip}
-  NM=${NM:-${CROSS}nm}
-  AS_SFX=.s
-  EXE_SFX=
-}
-
-setup_clang_toolchain() {
-  CC=${CC:-${CROSS}clang}
-  CXX=${CXX:-${CROSS}clang++}
-  AR=${AR:-${CROSS}ar}
-  LD=${LD:-${CROSS}ld}
-  AS=${AS:-${CROSS}as}
-  STRIP=${STRIP:-${CROSS}strip}
-  NM=${NM:-${CROSS}nm}
-  AS_SFX=.s
-  EXE_SFX=
-}
-
-# Reliably find the newest available Darwin SDKs. (Older versions of
-# xcrun don't support --show-sdk-path.)
-show_darwin_sdk_path() {
-  xcrun --sdk $1 --show-sdk-path 2>/dev/null ||
-    xcodebuild -sdk $1 -version Path 2>/dev/null
-}
-
-# Print the major version number of the Darwin SDK specified by $1.
-show_darwin_sdk_major_version() {
-  xcrun --sdk $1 --show-sdk-version 2>/dev/null | cut -d. -f1
-}
-
-# Print the Xcode version.
-show_xcode_version() {
-  xcodebuild -version | head -n1 | cut -d' ' -f2
-}
-
-# Fails when Xcode version is less than 6.3.
-check_xcode_minimum_version() {
-  xcode_major=$(show_xcode_version | cut -f1 -d.)
-  xcode_minor=$(show_xcode_version | cut -f2 -d.)
-  xcode_min_major=6
-  xcode_min_minor=3
-  if [ ${xcode_major} -lt ${xcode_min_major} ]; then
-    return 1
-  fi
-  if [ ${xcode_major} -eq ${xcode_min_major} ] \
-    && [ ${xcode_minor} -lt ${xcode_min_minor} ]; then
-    return 1
-  fi
-}
-
-process_common_toolchain() {
-  if [ -z "$toolchain" ]; then
-    gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}"
-
-    # detect tgt_isa
-    case "$gcctarget" in
-      aarch64*)
-        tgt_isa=arm64
-        ;;
-      armv6*)
-        tgt_isa=armv6
-        ;;
-      armv7*-hardfloat* | armv7*-gnueabihf | arm-*-gnueabihf)
-        tgt_isa=armv7
-        float_abi=hard
-        ;;
-      armv7*)
-        tgt_isa=armv7
-        float_abi=softfp
-        ;;
-      *x86_64*|*amd64*)
-        tgt_isa=x86_64
-        ;;
-      *i[3456]86*)
-        tgt_isa=x86
-        ;;
-      *sparc*)
-        tgt_isa=sparc
-        ;;
-    esac
-
-    # detect tgt_os
-    case "$gcctarget" in
-      *darwin10*)
-        tgt_isa=x86_64
-        tgt_os=darwin10
-        ;;
-      *darwin11*)
-        tgt_isa=x86_64
-        tgt_os=darwin11
-        ;;
-      *darwin12*)
-        tgt_isa=x86_64
-        tgt_os=darwin12
-        ;;
-      *darwin13*)
-        tgt_isa=x86_64
-        tgt_os=darwin13
-        ;;
-      *darwin14*)
-        tgt_isa=x86_64
-        tgt_os=darwin14
-        ;;
-      *darwin15*)
-        tgt_isa=x86_64
-        tgt_os=darwin15
-        ;;
-      x86_64*mingw32*)
-        tgt_os=win64
-        ;;
-      *mingw32*|*cygwin*)
-        [ -z "$tgt_isa" ] && tgt_isa=x86
-        tgt_os=win32
-        ;;
-      *linux*|*bsd*)
-        tgt_os=linux
-        ;;
-      *solaris2.10)
-        tgt_os=solaris
-        ;;
-      *os2*)
-        tgt_os=os2
-        ;;
-    esac
-
-    if [ -n "$tgt_isa" ] && [ -n "$tgt_os" ]; then
-      toolchain=${tgt_isa}-${tgt_os}-gcc
-    fi
-  fi
-
-  toolchain=${toolchain:-generic-gnu}
-
-  is_in ${toolchain} ${all_platforms} || enabled force_toolchain \
-    || die "Unrecognized toolchain '${toolchain}'"
-
-  enabled child || log_echo "Configuring for target '${toolchain}'"
-
-  #
-  # Set up toolchain variables
-  #
-  tgt_isa=$(echo ${toolchain} | awk 'BEGIN{FS="-"}{print $1}')
-  tgt_os=$(echo ${toolchain} | awk 'BEGIN{FS="-"}{print $2}')
-  tgt_cc=$(echo ${toolchain} | awk 'BEGIN{FS="-"}{print $3}')
-
-  # Mark the specific ISA requested as enabled
-  soft_enable ${tgt_isa}
-  enable_feature ${tgt_os}
-  enable_feature ${tgt_cc}
-
-  # Enable the architecture family
-  case ${tgt_isa} in
-    arm*)
-      enable_feature arm
-      ;;
-    mips*)
-      enable_feature mips
-      ;;
-  esac
-
-  # PIC is probably what we want when building shared libs
-  enabled shared && soft_enable pic
-  enabled orbis && soft_enable pic
-
-  # Minimum iOS version for all target platforms (darwin and iphonesimulator).
-  # Shared library framework builds are only possible on iOS 8 and later.
-  if enabled shared; then
-    IOS_VERSION_OPTIONS="--enable-shared"
-    IOS_VERSION_MIN="8.0"
-  else
-    IOS_VERSION_OPTIONS=""
-    IOS_VERSION_MIN="6.0"
-  fi
-
-  # Handle darwin variants. Newer SDKs allow targeting older
-  # platforms, so use the newest one available.
-  case ${toolchain} in
-    arm*-darwin*)
-      add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
-      iphoneos_sdk_dir="$(show_darwin_sdk_path iphoneos)"
-      if [ -d "${iphoneos_sdk_dir}" ]; then
-        add_cflags  "-isysroot ${iphoneos_sdk_dir}"
-        add_ldflags "-isysroot ${iphoneos_sdk_dir}"
-      fi
-      ;;
-    x86*-darwin*)
-      osx_sdk_dir="$(show_darwin_sdk_path macosx)"
-      if [ -d "${osx_sdk_dir}" ]; then
-        add_cflags  "-isysroot ${osx_sdk_dir}"
-        add_ldflags "-isysroot ${osx_sdk_dir}"
-      fi
-      ;;
-  esac
-
-  case ${toolchain} in
-    *-darwin8-*)
-      add_cflags  "-mmacosx-version-min=10.4"
-      add_ldflags "-mmacosx-version-min=10.4"
-      ;;
-    *-darwin9-*)
-      add_cflags  "-mmacosx-version-min=10.5"
-      add_ldflags "-mmacosx-version-min=10.5"
-      ;;
-    *-darwin10-*)
-      add_cflags  "-mmacosx-version-min=10.6"
-      add_ldflags "-mmacosx-version-min=10.6"
-      ;;
-    *-darwin11-*)
-      add_cflags  "-mmacosx-version-min=10.7"
-      add_ldflags "-mmacosx-version-min=10.7"
-      ;;
-    *-darwin12-*)
-      add_cflags  "-mmacosx-version-min=10.8"
-      add_ldflags "-mmacosx-version-min=10.8"
-      ;;
-    *-darwin13-*)
-      add_cflags  "-mmacosx-version-min=10.9"
-      add_ldflags "-mmacosx-version-min=10.9"
-      ;;
-    *-darwin14-*)
-      add_cflags  "-mmacosx-version-min=10.10"
-      add_ldflags "-mmacosx-version-min=10.10"
-      ;;
-    *-darwin15-*)
-      add_cflags  "-mmacosx-version-min=10.11"
-      add_ldflags "-mmacosx-version-min=10.11"
-      ;;
-    *-iphonesimulator-*)
-      add_cflags  "-miphoneos-version-min=${IOS_VERSION_MIN}"
-      add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
-      iossim_sdk_dir="$(show_darwin_sdk_path iphonesimulator)"
-      if [ -d "${iossim_sdk_dir}" ]; then
-        add_cflags  "-isysroot ${iossim_sdk_dir}"
-        add_ldflags "-isysroot ${iossim_sdk_dir}"
-      fi
-      ;;
-  esac
-
-  # Handle Solaris variants. Solaris 10 needs -lposix4
-  case ${toolchain} in
-    sparc-solaris-*)
-      add_extralibs -lposix4
-      ;;
-    *-solaris-*)
-      add_extralibs -lposix4
-      ;;
-  esac
-
-  # Process ARM architecture variants
-  case ${toolchain} in
-    arm*)
-      # on arm, isa versions are supersets
-      case ${tgt_isa} in
-        arm64|armv8)
-          soft_enable neon
-          ;;
-        armv7|armv7s)
-          soft_enable neon
-          # Only enable neon_asm when neon is also enabled.
-          enabled neon && soft_enable neon_asm
-          # If someone tries to force it through, die.
-          if disabled neon && enabled neon_asm; then
-            die "Disabling neon while keeping neon-asm is not supported"
-          fi
-          case ${toolchain} in
-            # Apple iOS SDKs no longer support armv6 as of the version 9
-            # release (coincides with release of Xcode 7). Only enable media
-            # when using earlier SDK releases.
-            *-darwin*)
-              if [ "$(show_darwin_sdk_major_version iphoneos)" -lt 9 ]; then
-                soft_enable media
-              else
-                soft_disable media
-                RTCD_OPTIONS="${RTCD_OPTIONS}--disable-media "
-              fi
-              ;;
-            *)
-              soft_enable media
-              ;;
-          esac
-          ;;
-        armv6)
-          case ${toolchain} in
-            *-darwin*)
-              if [ "$(show_darwin_sdk_major_version iphoneos)" -lt 9 ]; then
-                soft_enable media
-              else
-                die "Your iOS SDK does not support armv6."
-              fi
-              ;;
-            *)
-              soft_enable media
-              ;;
-          esac
-          ;;
-      esac
-
-      asm_conversion_cmd="cat"
-
-      case ${tgt_cc} in
-        gcc)
-          link_with_cc=gcc
-          setup_gnu_toolchain
-          arch_int=${tgt_isa##armv}
-          arch_int=${arch_int%%te}
-          check_add_asflags --defsym ARCHITECTURE=${arch_int}
-          tune_cflags="-mtune="
-          if [ ${tgt_isa} = "armv7" ] || [ ${tgt_isa} = "armv7s" ]; then
-            if [ -z "${float_abi}" ]; then
-              check_cpp <<EOF && float_abi=hard || float_abi=softfp
-#ifndef __ARM_PCS_VFP
-#error "not hardfp"
-#endif
-EOF
-            fi
-            check_add_cflags  -march=armv7-a -mfloat-abi=${float_abi}
-            check_add_asflags -march=armv7-a -mfloat-abi=${float_abi}
-
-            if enabled neon || enabled neon_asm; then
-              check_add_cflags -mfpu=neon #-ftree-vectorize
-              check_add_asflags -mfpu=neon
-            fi
-          else
-            check_add_cflags -march=${tgt_isa}
-            check_add_asflags -march=${tgt_isa}
-          fi
-
-          enabled debug && add_asflags -g
-          asm_conversion_cmd="${source_path}/build/make/ads2gas.pl"
-          if enabled thumb; then
-            asm_conversion_cmd="$asm_conversion_cmd -thumb"
-            check_add_cflags -mthumb
-            check_add_asflags -mthumb -mimplicit-it=always
-          fi
-          ;;
-        vs*)
-          asm_conversion_cmd="${source_path}/build/make/ads2armasm_ms.pl"
-          AS_SFX=.s
-          msvs_arch_dir=arm-msvs
-          disable_feature multithread
-          disable_feature unit_tests
-          vs_version=${tgt_cc##vs}
-          if [ $vs_version -ge 12 ]; then
-            # MSVC 2013 doesn't allow doing plain .exe projects for ARM,
-            # only "AppContainerApplication" which requires an AppxManifest.
-            # Therefore disable the examples, just build the library.
-            disable_feature examples
-          fi
-          ;;
-        rvct)
-          CC=armcc
-          AR=armar
-          AS=armasm
-          LD="${source_path}/build/make/armlink_adapter.sh"
-          STRIP=arm-none-linux-gnueabi-strip
-          NM=arm-none-linux-gnueabi-nm
-          tune_cflags="--cpu="
-          tune_asflags="--cpu="
-          if [ -z "${tune_cpu}" ]; then
-            if [ ${tgt_isa} = "armv7" ]; then
-              if enabled neon || enabled neon_asm
-              then
-                check_add_cflags --fpu=softvfp+vfpv3
-                check_add_asflags --fpu=softvfp+vfpv3
-              fi
-              check_add_cflags --cpu=Cortex-A8
-              check_add_asflags --cpu=Cortex-A8
-            else
-              check_add_cflags --cpu=${tgt_isa##armv}
-              check_add_asflags --cpu=${tgt_isa##armv}
-            fi
-          fi
-          arch_int=${tgt_isa##armv}
-          arch_int=${arch_int%%te}
-          check_add_asflags --pd "\"ARCHITECTURE SETA ${arch_int}\""
-          enabled debug && add_asflags -g
-          add_cflags --gnu
-          add_cflags --enum_is_int
-          add_cflags --wchar32
-          ;;
-      esac
-
-      case ${tgt_os} in
-        none*)
-          disable_feature multithread
-          disable_feature os_support
-          ;;
-
-        android*)
-          SDK_PATH=${sdk_path}
-          COMPILER_LOCATION=`find "${SDK_PATH}" \
-                             -name "arm-linux-androideabi-gcc*" -print -quit`
-          TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/arm-linux-androideabi-
-          CC=${TOOLCHAIN_PATH}gcc
-          CXX=${TOOLCHAIN_PATH}g++
-          AR=${TOOLCHAIN_PATH}ar
-          LD=${TOOLCHAIN_PATH}gcc
-          AS=${TOOLCHAIN_PATH}as
-          STRIP=${TOOLCHAIN_PATH}strip
-          NM=${TOOLCHAIN_PATH}nm
-
-          if [ -z "${alt_libc}" ]; then
-            alt_libc=`find "${SDK_PATH}" -name arch-arm -print | \
-              awk '{n = split($0,a,"/"); \
-                split(a[n-1],b,"-"); \
-                print $0 " " b[2]}' | \
-                sort -g -k 2 | \
-                awk '{ print $1 }' | tail -1`
-          fi
-
-          if [ -d "${alt_libc}" ]; then
-            add_cflags "--sysroot=${alt_libc}"
-            add_ldflags "--sysroot=${alt_libc}"
-          fi
-
-          # linker flag that routes around a CPU bug in some
-          # Cortex-A8 implementations (NDK Dev Guide)
-          add_ldflags "-Wl,--fix-cortex-a8"
-
-          enable_feature pic
-          soft_enable realtime_only
-          if [ ${tgt_isa} = "armv7" ]; then
-            soft_enable runtime_cpu_detect
-          fi
-          if enabled runtime_cpu_detect; then
-            add_cflags "-I${SDK_PATH}/sources/android/cpufeatures"
-          fi
-          ;;
-
-        darwin*)
-          XCRUN_FIND="xcrun --sdk iphoneos --find"
-          CXX="$(${XCRUN_FIND} clang++)"
-          CC="$(${XCRUN_FIND} clang)"
-          AR="$(${XCRUN_FIND} ar)"
-          AS="$(${XCRUN_FIND} as)"
-          STRIP="$(${XCRUN_FIND} strip)"
-          NM="$(${XCRUN_FIND} nm)"
-          RANLIB="$(${XCRUN_FIND} ranlib)"
-          AS_SFX=.s
-          LD="${CXX:-$(${XCRUN_FIND} ld)}"
-
-          # ASFLAGS is written here instead of using check_add_asflags
-          # because we need to overwrite all of ASFLAGS and purge the
-          # options that were put in above
-          ASFLAGS="-arch ${tgt_isa} -g"
-
-          add_cflags -arch ${tgt_isa}
-          add_ldflags -arch ${tgt_isa}
-
-          alt_libc="$(show_darwin_sdk_path iphoneos)"
-          if [ -d "${alt_libc}" ]; then
-            add_cflags -isysroot ${alt_libc}
-          fi
-
-          if [ "${LD}" = "${CXX}" ]; then
-            add_ldflags -miphoneos-version-min="${IOS_VERSION_MIN}"
-          else
-            add_ldflags -ios_version_min "${IOS_VERSION_MIN}"
-          fi
-
-          for d in lib usr/lib usr/lib/system; do
-            try_dir="${alt_libc}/${d}"
-            [ -d "${try_dir}" ] && add_ldflags -L"${try_dir}"
-          done
-
-          case ${tgt_isa} in
-            armv7|armv7s|armv8|arm64)
-              if enabled neon && ! check_xcode_minimum_version; then
-                soft_disable neon
-                log_echo "  neon disabled: upgrade Xcode (need v6.3+)."
-                if enabled neon_asm; then
-                  soft_disable neon_asm
-                  log_echo "  neon_asm disabled: upgrade Xcode (need v6.3+)."
-                fi
-              fi
-              ;;
-          esac
-
-          asm_conversion_cmd="${source_path}/build/make/ads2gas_apple.pl"
-
-          if [ "$(show_darwin_sdk_major_version iphoneos)" -gt 8 ]; then
-            check_add_cflags -fembed-bitcode
-            check_add_asflags -fembed-bitcode
-            check_add_ldflags -fembed-bitcode
-          fi
-          ;;
-
-        linux*)
-          enable_feature linux
-          if enabled rvct; then
-            # Check if we have CodeSourcery GCC in PATH. Needed for
-            # libraries
-            which arm-none-linux-gnueabi-gcc 2>&- || \
-              die "Couldn't find CodeSourcery GCC from PATH"
-
-            # Use armcc as a linker to enable translation of
-            # some gcc specific options such as -lm and -lpthread.
-            LD="armcc --translate_gcc"
-
-            # create configuration file (uses path to CodeSourcery GCC)
-            armcc --arm_linux_configure --arm_linux_config_file=arm_linux.cfg
-
-            add_cflags --arm_linux_paths --arm_linux_config_file=arm_linux.cfg
-            add_asflags --no_hide_all --apcs=/interwork
-            add_ldflags --arm_linux_paths --arm_linux_config_file=arm_linux.cfg
-            enabled pic && add_cflags --apcs=/fpic
-            enabled pic && add_asflags --apcs=/fpic
-            enabled shared && add_cflags --shared
-          fi
-          ;;
-      esac
-      ;;
-    mips*)
-      link_with_cc=gcc
-      setup_gnu_toolchain
-      tune_cflags="-mtune="
-      if enabled dspr2; then
-        check_add_cflags -mips32r2 -mdspr2
-      fi
-
-      if enabled runtime_cpu_detect; then
-        disable_feature runtime_cpu_detect
-      fi
-
-      if [ -n "${tune_cpu}" ]; then
-        case ${tune_cpu} in
-          p5600)
-            check_add_cflags -mips32r5 -funroll-loops -mload-store-pairs
-            check_add_cflags -msched-weight -mhard-float -mfp64
-            check_add_asflags -mips32r5 -mhard-float -mfp64
-            check_add_ldflags -mfp64
-            ;;
-          i6400)
-            check_add_cflags -mips64r6 -mabi=64 -funroll-loops -msched-weight
-            check_add_cflags  -mload-store-pairs -mhard-float -mfp64
-            check_add_asflags -mips64r6 -mabi=64 -mhard-float -mfp64
-            check_add_ldflags -mips64r6 -mabi=64 -mfp64
-            ;;
-        esac
-
-        if enabled msa; then
-          add_cflags -mmsa
-          add_asflags -mmsa
-          add_ldflags -mmsa
-        fi
-      fi
-
-      check_add_cflags -march=${tgt_isa}
-      check_add_asflags -march=${tgt_isa}
-      check_add_asflags -KPIC
-      ;;
-    x86*)
-      case  ${tgt_os} in
-        win*)
-          enabled gcc && add_cflags -fno-common
-          ;;
-        solaris*)
-          CC=${CC:-${CROSS}gcc}
-          CXX=${CXX:-${CROSS}g++}
-          LD=${LD:-${CROSS}gcc}
-          CROSS=${CROSS-g}
-          ;;
-        os2)
-          disable_feature pic
-          AS=${AS:-nasm}
-          add_ldflags -Zhigh-mem
-          ;;
-        orbis)
-          CROSS=${CROSS:-orbis-}
-          ;;
-      esac
-
-      AS="${alt_as:-${AS:-auto}}"
-      case  ${tgt_cc} in
-        icc*)
-          CC=${CC:-icc}
-          LD=${LD:-icc}
-          setup_gnu_toolchain
-          add_cflags -use-msasm  # remove -use-msasm too?
-          # add -no-intel-extensions to suppress warning #10237
-          # refer to http://software.intel.com/en-us/forums/topic/280199
-          add_ldflags -i-static -no-intel-extensions
-          enabled x86_64 && add_cflags -ipo -static -O3 -no-prec-div
-          enabled x86_64 && AR=xiar
-          case ${tune_cpu} in
-            atom*)
-              tune_cflags="-x"
-              tune_cpu="SSE3_ATOM"
-              ;;
-            *)
-              tune_cflags="-march="
-              ;;
-          esac
-          ;;
-        gcc*)
-          link_with_cc=gcc
-          tune_cflags="-march="
-          setup_gnu_toolchain
-          #for 32 bit x86 builds, -O3 did not turn on this flag
-          enabled optimizations && disabled gprof && check_add_cflags -fomit-frame-pointer
-          ;;
-        clang*)
-         link_with_cc=clang
-          tune_cflags="-march="
-          setup_clang_toolchain
-          ;;
-        vs*)
-          # When building with Microsoft Visual Studio the assembler is
-          # invoked directly. Checking at configure time is unnecessary.
-          # Skip the check by setting AS arbitrarily
-          AS=msvs
-          msvs_arch_dir=x86-msvs
-          vc_version=${tgt_cc##vs}
-          case $vc_version in
-            7|8|9|10)
-              echo "${tgt_cc} does not support avx/avx2, disabling....."
-              RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx --disable-avx2 "
-              soft_disable avx
-              soft_disable avx2
-              ;;
-          esac
-          case $vc_version in
-            7|8|9)
-              echo "${tgt_cc} omits stdint.h, disabling webm-io..."
-              soft_disable webm_io
-              ;;
-          esac
-          ;;
-      esac
-
-      bits=32
-      enabled x86_64 && bits=64
-      check_cpp <<EOF && bits=x32
-#if !defined(__ILP32__) || !defined(__x86_64__)
-#error "not x32"
-#endif
-EOF
-      case ${tgt_cc} in
-        gcc*)
-          add_cflags -m${bits}
-          add_ldflags -m${bits}
-          ;;
-      esac
-
-      disabled orbis && soft_enable runtime_cpu_detect
-      # We can't use 'check_cflags' until the compiler is configured and CC is
-      # populated.
-      for ext in ${ARCH_EXT_LIST_X86}; do
-        # disable higher order extensions to simplify asm dependencies
-        if [ "$disable_exts" = "yes" ]; then
-          if ! disabled $ext; then
-            RTCD_OPTIONS="${RTCD_OPTIONS}--disable-${ext} "
-            disable_feature $ext
-          fi
-        elif disabled $ext; then
-          disable_exts="yes"
-        elif [ "$ext" = "avx2" ]; then
-          # on orbis never enable avx2.
-          disabled orbis && check_gcc_machine_option ${ext%_*} $ext
-        else
-          # use the shortened version for the flag: sse4_1 -> sse4
-          check_gcc_machine_option ${ext%_*} $ext
-        fi
-      done
-
-      if enabled external_build; then
-        log_echo "  skipping assembler detection"
-      else
-        case "${AS}" in
-          auto|"")
-            which nasm >/dev/null 2>&1 && AS=nasm
-            which yasm >/dev/null 2>&1 && AS=yasm
-            if [ "${AS}" = nasm ] ; then
-              # Apple ships version 0.98 of nasm through at least Xcode 6. Revisit
-              # this check if they start shipping a compatible version.
-              apple=`nasm -v | grep "Apple"`
-              [ -n "${apple}" ] \
-                && echo "Unsupported version of nasm: ${apple}" \
-                && AS=""
-            fi
-            [ "${AS}" = auto ] || [ -z "${AS}" ] \
-              && die "Neither yasm nor nasm have been found." \
-                     "See the prerequisites section in the README for more info."
-            ;;
-        esac
-        log_echo "  using $AS"
-      fi
-      [ "${AS##*/}" = nasm ] && add_asflags -Ox
-      AS_SFX=.asm
-      case  ${tgt_os} in
-        win32)
-          add_asflags -f win32
-          enabled debug && add_asflags -g cv8
-          EXE_SFX=.exe
-          ;;
-        win64)
-          add_asflags -f x64
-          enabled debug && add_asflags -g cv8
-          EXE_SFX=.exe
-          ;;
-        linux*|solaris*|android*)
-          add_asflags -f elf${bits}
-          enabled debug && [ "${AS}" = yasm ] && add_asflags -g dwarf2
-          enabled debug && [ "${AS}" = nasm ] && add_asflags -g
-          [ "${AS##*/}" = nasm ] && check_asm_align
-          ;;
-        darwin*)
-          add_asflags -f macho${bits}
-          enabled x86 && darwin_arch="-arch i386" || darwin_arch="-arch x86_64"
-          add_cflags  ${darwin_arch}
-          add_ldflags ${darwin_arch}
-          # -mdynamic-no-pic is still a bit of voodoo -- it was required at
-          # one time, but does not seem to be now, and it breaks some of the
-          # code that still relies on inline assembly.
-          # enabled icc && ! enabled pic && add_cflags -fno-pic -mdynamic-no-pic
-          enabled icc && ! enabled pic && add_cflags -fno-pic
-          ;;
-        iphonesimulator)
-          add_asflags -f macho${bits}
-          enabled x86 && sim_arch="-arch i386" || sim_arch="-arch x86_64"
-          add_cflags  ${sim_arch}
-          add_ldflags ${sim_arch}
-
-          if [ "$(show_darwin_sdk_major_version iphonesimulator)" -gt 8 ]; then
-            # yasm v1.3.0 doesn't know what -fembed-bitcode means, so turning it
-            # on is pointless (unless building a C-only lib). Warn the user, but
-            # do nothing here.
-            log "Warning: Bitcode embed disabled for simulator targets."
-          fi
-          ;;
-        os2)
-          add_asflags -f aout
-          enabled debug && add_asflags -g
-          EXE_SFX=.exe
-          ;;
-        orbis*)
-          add_asflags -f elf${bits}
-          enabled debug && [ "${AS}" = yasm ] && add_asflags -g dwarf2
-          enabled debug && [ "${AS}" = nasm ] && add_asflags -g
-          [ "${AS##*/}" = nasm ] && check_asm_align
-          add_ldflags "-L\"${SCE_ORBIS_SDK_DIR}/target/lib/\""
-          add_ldflags "-Wl,--fself-flags=videoservice"
-          add_ldflags "-Wl,--target=orbis"
-          add_ldflags "-Wl,-lc_stub_weak"
-          add_ldflags "-Wl,-lkernel_stub_weak"
-          add_ldflags "-Wl,-lScePosix_stub_weak"
-          EXE_SFX=.elf
-          disable_feature os_support
-          soft_disable avx2
-          RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx2 "
-          ;;
-        *)
-          log "Warning: Unknown os $tgt_os while setting up $AS flags"
-          ;;
-      esac
-      ;;
-    *-gcc|generic-gnu)
-      link_with_cc=gcc
-      enable_feature gcc
-      setup_gnu_toolchain
-      ;;
-  esac
-
-  # Try to enable CPU specific tuning
-  if [ -n "${tune_cpu}" ]; then
-    if [ -n "${tune_cflags}" ]; then
-      check_add_cflags ${tune_cflags}${tune_cpu} || \
-        die "Requested CPU '${tune_cpu}' not supported by compiler"
-    fi
-    if [ -n "${tune_asflags}" ]; then
-      check_add_asflags ${tune_asflags}${tune_cpu} || \
-        die "Requested CPU '${tune_cpu}' not supported by assembler"
-    fi
-    if [ -z "${tune_cflags}${tune_asflags}" ]; then
-      log_echo "Warning: CPU tuning not supported by this toolchain"
-    fi
-  fi
-
-  if enabled debug; then
-    check_add_cflags -g && check_add_ldflags -g
-  else
-    check_add_cflags -DNDEBUG
-  fi
-
-  enabled gprof && check_add_cflags -pg && check_add_ldflags -pg
-  enabled gcov &&
-    check_add_cflags -fprofile-arcs -ftest-coverage &&
-    check_add_ldflags -fprofile-arcs -ftest-coverage
-
-  if enabled optimizations; then
-    if enabled rvct; then
-      enabled small && check_add_cflags -Ospace || check_add_cflags -Otime
-    else
-      enabled small && check_add_cflags -O2 ||  check_add_cflags -O3
-    fi
-  fi
-
-  if [ "${tgt_isa}" = "x86_64" ] || [ "${tgt_isa}" = "x86" ]; then
-    soft_enable use_x86inc
-  fi
-
-  # Position Independent Code (PIC) support, for building relocatable
-  # shared objects
-  enabled gcc && enabled pic && check_add_cflags -fPIC
-
-  # Work around longjmp interception on glibc >= 2.11, to improve binary
-  # compatibility. See http://code.google.com/p/webm/issues/detail?id=166
-  enabled linux && check_add_cflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
-
-  # Check for strip utility variant
-  ${STRIP} -V 2>/dev/null | grep GNU >/dev/null && enable_feature gnu_strip
-
-  # Try to determine target endianness
-  check_cc <<EOF
-unsigned int e = 'O'<<24 | '2'<<16 | 'B'<<8 | 'E';
-EOF
-    [ -f "${TMP_O}" ] && od -A n -t x1 "${TMP_O}" | tr -d '\n' |
-        grep '4f *32 *42 *45' >/dev/null 2>&1 && enable_feature big_endian
-
-    # Try to find which inline keywords are supported
-    check_cc <<EOF && INLINE="inline"
-static inline function() {}
-EOF
-
-  # Almost every platform uses pthreads.
-  if enabled multithread; then
-    case ${toolchain} in
-      *-win*-vs*)
-        ;;
-      *-android-gcc)
-        ;;
-      *orbis*)
-        ;;
-      *)
-        check_header pthread.h && add_extralibs -lpthread
-        ;;
-    esac
-  fi
-
-  # only for MIPS platforms
-  case ${toolchain} in
-    mips*)
-      if enabled big_endian; then
-        if enabled dspr2; then
-          echo "dspr2 optimizations are available only for little endian platforms"
-          disable_feature dspr2
-        fi
-        if enabled msa; then
-          echo "msa optimizations are available only for little endian platforms"
-          disable_feature msa
-        fi
-      fi
-      ;;
-  esac
-
-  # glibc needs these
-  if enabled linux; then
-    add_cflags -D_LARGEFILE_SOURCE
-    add_cflags -D_FILE_OFFSET_BITS=64
-  fi
-}
-
-process_toolchain() {
-  process_common_toolchain
-}
-
-print_config_mk() {
-  saved_prefix="${prefix}"
-  prefix=$1
-  makefile=$2
-  shift 2
-  for cfg; do
-    if enabled $cfg; then
-      upname="`toupper $cfg`"
-      echo "${prefix}_${upname}=yes" >> $makefile
-    fi
-  done
-  prefix="${saved_prefix}"
-}
-
-print_config_h() {
-  saved_prefix="${prefix}"
-  prefix=$1
-  header=$2
-  shift 2
-  for cfg; do
-    upname="`toupper $cfg`"
-    if enabled $cfg; then
-      echo "#define ${prefix}_${upname} 1" >> $header
-    else
-      echo "#define ${prefix}_${upname} 0" >> $header
-    fi
-  done
-  prefix="${saved_prefix}"
-}
-
-print_config_vars_h() {
-  header=$1
-  shift
-  while [ $# -gt 0 ]; do
-    upname="`toupper $1`"
-    echo "#define ${upname} $2" >> $header
-    shift 2
-  done
-}
-
-print_webm_license() {
-  saved_prefix="${prefix}"
-  destination=$1
-  prefix="$2"
-  suffix="$3"
-  shift 3
-  cat <<EOF > ${destination}
-${prefix} Copyright (c) 2011 The WebM project authors. All Rights Reserved.${suffix}
-${prefix} ${suffix}
-${prefix} Use of this source code is governed by a BSD-style license${suffix}
-${prefix} that can be found in the LICENSE file in the root of the source${suffix}
-${prefix} tree. An additional intellectual property rights grant can be found${suffix}
-${prefix} in the file PATENTS.  All contributing project authors may${suffix}
-${prefix} be found in the AUTHORS file in the root of the source tree.${suffix}
-EOF
-  prefix="${saved_prefix}"
-}
-
-process_targets() {
-  true;
-}
-
-process_detect() {
-  true;
-}
-
-enable_feature logging
-logfile="config.log"
-self=$0
-process() {
-  cmdline_args="$@"
-  process_cmdline "$@"
-  if enabled child; then
-    echo "# ${self} $@" >> ${logfile}
-  else
-    echo "# ${self} $@" > ${logfile}
-  fi
-  post_process_common_cmdline
-  post_process_cmdline
-  process_toolchain
-  process_detect
-  process_targets
-
-  OOT_INSTALLS="${OOT_INSTALLS}"
-  if enabled source_path_used; then
-  # Prepare the PWD for building.
-  for f in ${OOT_INSTALLS}; do
-    install -D "${source_path}/$f" "$f"
-  done
-  fi
-  cp "${source_path}/build/make/Makefile" .
-
-  clean_temp_files
-  true
-}
diff --git a/src/third_party/libvpx/build/make/gen_asm_deps.sh b/src/third_party/libvpx/build/make/gen_asm_deps.sh
deleted file mode 100755
index 6a7bff9..0000000
--- a/src/third_party/libvpx/build/make/gen_asm_deps.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-##
-##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-
-self=$0
-show_help() {
-    echo "usage: $self [options] <srcfile>"
-    echo
-    echo "Generate Makefile dependency information from assembly code source"
-    echo
-    exit 1
-}
-die_unknown(){
-    echo "Unknown option \"$1\"."
-    echo "See $0 --help for available options."
-    exit 1
-}
-for opt do
-    optval="${opt#*=}"
-    case "$opt" in
-    --build-pfx=*) pfx="${optval}"
-    ;;
-    --depfile=*) out="${optval}"
-    ;;
-    -I*) raw_inc_paths="${raw_inc_paths} ${opt}"
-         inc_path="${inc_path} ${opt#-I}"
-    ;;
-    -h|--help) show_help
-    ;;
-    *) [ -f "$opt" ] && srcfile="$opt"
-    ;;
-    esac
-done
-
-[ -n "$srcfile" ] || show_help
-sfx=${sfx:-asm}
-includes=$(LC_ALL=C egrep -i "include +\"?[a-z0-9_/]+\.${sfx}" $srcfile |
-           perl -p -e "s;.*?([a-z0-9_/]+.${sfx}).*;\1;")
-#" restore editor state
-for inc in ${includes}; do
-    found_inc_path=
-    for idir in ${inc_path}; do
-        [ -f "${idir}/${inc}" ] && found_inc_path="${idir}" && break
-    done
-    if [ -f `dirname $srcfile`/$inc ]; then
-        # Handle include files in the same directory as the source
-        $self --build-pfx=$pfx --depfile=$out ${raw_inc_paths} `dirname $srcfile`/$inc
-    elif [ -n "${found_inc_path}" ]; then
-        # Handle include files on the include path
-        $self --build-pfx=$pfx --depfile=$out ${raw_inc_paths} "${found_inc_path}/$inc"
-    else
-        # Handle generated includes in the build root (which may not exist yet)
-        echo ${out} ${out%d}o: "${pfx}${inc}"
-    fi
-done
-echo ${out} ${out%d}o: $srcfile
diff --git a/src/third_party/libvpx/build/make/gen_msvs_def.sh b/src/third_party/libvpx/build/make/gen_msvs_def.sh
deleted file mode 100755
index 4defcc2..0000000
--- a/src/third_party/libvpx/build/make/gen_msvs_def.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/bash
-##
-##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-
-self=$0
-self_basename=${self##*/}
-EOL=$'\n'
-
-show_help() {
-    cat <<EOF
-Usage: ${self_basename} [options] file1 [file2 ...]
-
-This script generates a MSVC module definition file containing a list of symbols
-to export from a DLL. Source files are technically bash scripts (and thus may
-use #comment syntax) but in general, take the form of a list of symbols:
-
-  <kind> symbol1 [symbol2, symbol3, ...]
-
-where <kind> is either 'text' or 'data'
-
-
-Options:
-    --help                      Print this message
-    --out=filename              Write output to a file [stdout]
-    --name=project_name         Name of the library (required)
-EOF
-    exit 1
-}
-
-die() {
-    echo "${self_basename}: $@"
-    exit 1
-}
-
-die_unknown(){
-    echo "Unknown option \"$1\"."
-    echo "See ${self_basename} --help for available options."
-    exit 1
-}
-
-text() {
-    for sym in "$@"; do
-        echo "  $sym" >> ${outfile}
-    done
-}
-
-data() {
-    for sym in "$@"; do
-        printf "  %-40s DATA\n" "$sym" >> ${outfile}
-    done
-}
-
-# Process command line
-for opt in "$@"; do
-    optval="${opt#*=}"
-    case "$opt" in
-    --help|-h) show_help
-    ;;
-    --out=*) outfile="$optval"
-    ;;
-    --name=*) name="${optval}"
-    ;;
-     -*) die_unknown $opt
-    ;;
-    *) file_list[${#file_list[@]}]="$opt"
-    esac
-done
-outfile=${outfile:-/dev/stdout}
-[ -n "$name" ] || die "Library name (--name) must be specified!"
-
-echo "LIBRARY ${name}" > ${outfile}
-echo "EXPORTS" >> ${outfile}
-for f in "${file_list[@]}"; do
-    . $f
-done
diff --git a/src/third_party/libvpx/build/make/gen_msvs_proj.sh b/src/third_party/libvpx/build/make/gen_msvs_proj.sh
deleted file mode 100755
index 2b91fbf..0000000
--- a/src/third_party/libvpx/build/make/gen_msvs_proj.sh
+++ /dev/null
@@ -1,490 +0,0 @@
-#!/bin/bash
-##
-##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-self=$0
-self_basename=${self##*/}
-self_dirname=$(dirname "$0")
-
-. "$self_dirname/msvs_common.sh"|| exit 127
-
-show_help() {
-    cat <<EOF
-Usage: ${self_basename} --name=projname [options] file1 [file2 ...]
-
-This script generates a Visual Studio project file from a list of source
-code files.
-
-Options:
-    --help                      Print this message
-    --exe                       Generate a project for building an Application
-    --lib                       Generate a project for creating a static library
-    --dll                       Generate a project for creating a dll
-    --static-crt                Use the static C runtime (/MT)
-    --target=isa-os-cc          Target specifier (required)
-    --out=filename              Write output to a file [stdout]
-    --name=project_name         Name of the project (required)
-    --proj-guid=GUID            GUID to use for the project
-    --module-def=filename       File containing export definitions (for DLLs)
-    --ver=version               Version (7,8,9) of visual studio to generate for
-    --src-path-bare=dir         Path to root of source tree
-    -Ipath/to/include           Additional include directories
-    -DFLAG[=value]              Preprocessor macros to define
-    -Lpath/to/lib               Additional library search paths
-    -llibname                   Library to link against
-EOF
-    exit 1
-}
-
-generate_filter() {
-    local var=$1
-    local name=$2
-    local pats=$3
-    local file_list_sz
-    local i
-    local f
-    local saveIFS="$IFS"
-    local pack
-    echo "generating filter '$name' from ${#file_list[@]} files" >&2
-    IFS=*
-
-    open_tag Filter \
-        Name=$name \
-        Filter=$pats \
-        UniqueIdentifier=`generate_uuid` \
-
-    file_list_sz=${#file_list[@]}
-    for i in ${!file_list[@]}; do
-        f=${file_list[i]}
-        for pat in ${pats//;/$IFS}; do
-            if [ "${f##*.}" == "$pat" ]; then
-                unset file_list[i]
-
-                objf=$(echo ${f%.*}.obj \
-                       | sed -e "s,$src_path_bare,," \
-                             -e 's/^[\./]\+//g' -e 's,[:/ ],_,g')
-                open_tag File RelativePath="$f"
-
-                if [ "$pat" == "asm" ] && $asm_use_custom_step; then
-                    # Avoid object file name collisions, i.e. vpx_config.c and
-                    # vpx_config.asm produce the same object file without
-                    # this additional suffix.
-                    objf=${objf%.obj}_asm.obj
-                    for plat in "${platforms[@]}"; do
-                        for cfg in Debug Release; do
-                            open_tag FileConfiguration \
-                                Name="${cfg}|${plat}" \
-
-                            tag Tool \
-                                Name="VCCustomBuildTool" \
-                                Description="Assembling \$(InputFileName)" \
-                                CommandLine="$(eval echo \$asm_${cfg}_cmdline) -o \$(IntDir)\\$objf" \
-                                Outputs="\$(IntDir)\\$objf" \
-
-                            close_tag FileConfiguration
-                        done
-                    done
-                fi
-                if [ "$pat" == "c" ] || \
-                   [ "$pat" == "cc" ] || [ "$pat" == "cpp" ]; then
-                    for plat in "${platforms[@]}"; do
-                        for cfg in Debug Release; do
-                            open_tag FileConfiguration \
-                                Name="${cfg}|${plat}" \
-
-                            tag Tool \
-                                Name="VCCLCompilerTool" \
-                                ObjectFile="\$(IntDir)\\$objf" \
-
-                            close_tag FileConfiguration
-                        done
-                    done
-                fi
-                close_tag File
-
-                break
-            fi
-        done
-    done
-
-    close_tag Filter
-    IFS="$saveIFS"
-}
-
-# Process command line
-unset target
-for opt in "$@"; do
-    optval="${opt#*=}"
-    case "$opt" in
-        --help|-h) show_help
-        ;;
-        --target=*) target="${optval}"
-        ;;
-        --out=*) outfile="$optval"
-        ;;
-        --name=*) name="${optval}"
-        ;;
-        --proj-guid=*) guid="${optval}"
-        ;;
-        --module-def=*) link_opts="${link_opts} ModuleDefinitionFile=${optval}"
-        ;;
-        --exe) proj_kind="exe"
-        ;;
-        --dll) proj_kind="dll"
-        ;;
-        --lib) proj_kind="lib"
-        ;;
-        --src-path-bare=*)
-            src_path_bare=$(fix_path "$optval")
-            src_path_bare=${src_path_bare%/}
-        ;;
-        --static-crt) use_static_runtime=true
-        ;;
-        --ver=*)
-            vs_ver="$optval"
-            case "$optval" in
-                [789])
-                ;;
-                *) die Unrecognized Visual Studio Version in $opt
-                ;;
-            esac
-        ;;
-        -I*)
-            opt=${opt##-I}
-            opt=$(fix_path "$opt")
-            opt="${opt%/}"
-            incs="${incs}${incs:+;}&quot;${opt}&quot;"
-            yasmincs="${yasmincs} -I&quot;${opt}&quot;"
-        ;;
-        -D*) defines="${defines}${defines:+;}${opt##-D}"
-        ;;
-        -L*) # fudge . to $(OutDir)
-            if [ "${opt##-L}" == "." ]; then
-                libdirs="${libdirs}${libdirs:+;}&quot;\$(OutDir)&quot;"
-            else
-                 # Also try directories for this platform/configuration
-                 opt=${opt##-L}
-                 opt=$(fix_path "$opt")
-                 libdirs="${libdirs}${libdirs:+;}&quot;${opt}&quot;"
-                 libdirs="${libdirs}${libdirs:+;}&quot;${opt}/\$(PlatformName)/\$(ConfigurationName)&quot;"
-                 libdirs="${libdirs}${libdirs:+;}&quot;${opt}/\$(PlatformName)&quot;"
-            fi
-        ;;
-        -l*) libs="${libs}${libs:+ }${opt##-l}.lib"
-        ;;
-        -*) die_unknown $opt
-        ;;
-        *)
-            # The paths in file_list are fixed outside of the loop.
-            file_list[${#file_list[@]}]="$opt"
-            case "$opt" in
-                 *.asm) uses_asm=true
-                 ;;
-            esac
-        ;;
-    esac
-done
-
-# Make one call to fix_path for file_list to improve performance.
-fix_file_list file_list
-
-outfile=${outfile:-/dev/stdout}
-guid=${guid:-`generate_uuid`}
-asm_use_custom_step=false
-uses_asm=${uses_asm:-false}
-case "${vs_ver:-8}" in
-    7) vs_ver_id="7.10"
-       asm_use_custom_step=$uses_asm
-       warn_64bit='Detect64BitPortabilityProblems=true'
-    ;;
-    8) vs_ver_id="8.00"
-       asm_use_custom_step=$uses_asm
-       warn_64bit='Detect64BitPortabilityProblems=true'
-    ;;
-    9) vs_ver_id="9.00"
-       asm_use_custom_step=$uses_asm
-       warn_64bit='Detect64BitPortabilityProblems=false'
-    ;;
-esac
-
-[ -n "$name" ] || die "Project name (--name) must be specified!"
-[ -n "$target" ] || die "Target (--target) must be specified!"
-
-if ${use_static_runtime:-false}; then
-    release_runtime=0
-    debug_runtime=1
-    lib_sfx=mt
-else
-    release_runtime=2
-    debug_runtime=3
-    lib_sfx=md
-fi
-
-# Calculate debug lib names: If a lib ends in ${lib_sfx}.lib, then rename
-# it to ${lib_sfx}d.lib. This precludes linking to release libs from a
-# debug exe, so this may need to be refactored later.
-for lib in ${libs}; do
-    if [ "$lib" != "${lib%${lib_sfx}.lib}" ]; then
-        lib=${lib%.lib}d.lib
-    fi
-    debug_libs="${debug_libs}${debug_libs:+ }${lib}"
-done
-
-
-# List Keyword for this target
-case "$target" in
-    x86*) keyword="ManagedCProj"
-    ;;
-    *) die "Unsupported target $target!"
-esac
-
-# List of all platforms supported for this target
-case "$target" in
-    x86_64*)
-        platforms[0]="x64"
-        asm_Debug_cmdline="yasm -Xvc -g cv8 -f win64 ${yasmincs} &quot;\$(InputPath)&quot;"
-        asm_Release_cmdline="yasm -Xvc -f win64 ${yasmincs} &quot;\$(InputPath)&quot;"
-    ;;
-    x86*)
-        platforms[0]="Win32"
-        asm_Debug_cmdline="yasm -Xvc -g cv8 -f win32 ${yasmincs} &quot;\$(InputPath)&quot;"
-        asm_Release_cmdline="yasm -Xvc -f win32 ${yasmincs} &quot;\$(InputPath)&quot;"
-    ;;
-    *) die "Unsupported target $target!"
-    ;;
-esac
-
-generate_vcproj() {
-    case "$proj_kind" in
-        exe) vs_ConfigurationType=1
-        ;;
-        dll) vs_ConfigurationType=2
-        ;;
-        *)   vs_ConfigurationType=4
-        ;;
-    esac
-
-    echo "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>"
-    open_tag VisualStudioProject \
-        ProjectType="Visual C++" \
-        Version="${vs_ver_id}" \
-        Name="${name}" \
-        ProjectGUID="{${guid}}" \
-        RootNamespace="${name}" \
-        Keyword="${keyword}" \
-
-    open_tag Platforms
-    for plat in "${platforms[@]}"; do
-        tag Platform Name="$plat"
-    done
-    close_tag Platforms
-
-    open_tag Configurations
-    for plat in "${platforms[@]}"; do
-        plat_no_ws=`echo $plat | sed 's/[^A-Za-z0-9_]/_/g'`
-        open_tag Configuration \
-            Name="Debug|$plat" \
-            OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
-            IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
-            ConfigurationType="$vs_ConfigurationType" \
-            CharacterSet="1" \
-
-        case "$target" in
-            x86*)
-                case "$name" in
-                    vpx)
-                        tag Tool \
-                            Name="VCCLCompilerTool" \
-                            Optimization="0" \
-                            AdditionalIncludeDirectories="$incs" \
-                            PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
-                            RuntimeLibrary="$debug_runtime" \
-                            UsePrecompiledHeader="0" \
-                            WarningLevel="3" \
-                            DebugInformationFormat="2" \
-                            $warn_64bit \
-
-                        $uses_asm && tag Tool Name="YASM"  IncludePaths="$incs" Debug="true"
-                    ;;
-                    *)
-                        tag Tool \
-                            Name="VCCLCompilerTool" \
-                            Optimization="0" \
-                            AdditionalIncludeDirectories="$incs" \
-                            PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
-                            RuntimeLibrary="$debug_runtime" \
-                            UsePrecompiledHeader="0" \
-                            WarningLevel="3" \
-                            DebugInformationFormat="2" \
-                            $warn_64bit \
-
-                        $uses_asm && tag Tool Name="YASM"  IncludePaths="$incs" Debug="true"
-                    ;;
-                esac
-            ;;
-        esac
-
-        case "$proj_kind" in
-            exe)
-                case "$target" in
-                    x86*)
-                        case "$name" in
-                            *)
-                                tag Tool \
-                                    Name="VCLinkerTool" \
-                                    AdditionalDependencies="$debug_libs \$(NoInherit)" \
-                                    AdditionalLibraryDirectories="$libdirs" \
-                                    GenerateDebugInformation="true" \
-                                    ProgramDatabaseFile="\$(OutDir)/${name}.pdb" \
-                            ;;
-                        esac
-                    ;;
-                 esac
-            ;;
-            lib)
-                case "$target" in
-                    x86*)
-                        tag Tool \
-                            Name="VCLibrarianTool" \
-                            OutputFile="\$(OutDir)/${name}${lib_sfx}d.lib" \
-
-                    ;;
-                esac
-            ;;
-            dll)
-                tag Tool \
-                    Name="VCLinkerTool" \
-                    AdditionalDependencies="\$(NoInherit)" \
-                    LinkIncremental="2" \
-                    GenerateDebugInformation="true" \
-                    AssemblyDebug="1" \
-                    TargetMachine="1" \
-                    $link_opts \
-
-            ;;
-        esac
-
-        close_tag Configuration
-
-        open_tag Configuration \
-            Name="Release|$plat" \
-            OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
-            IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
-            ConfigurationType="$vs_ConfigurationType" \
-            CharacterSet="1" \
-            WholeProgramOptimization="0" \
-
-        case "$target" in
-            x86*)
-                case "$name" in
-                    vpx)
-                        tag Tool \
-                            Name="VCCLCompilerTool" \
-                            Optimization="2" \
-                            FavorSizeorSpeed="1" \
-                            AdditionalIncludeDirectories="$incs" \
-                            PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
-                            RuntimeLibrary="$release_runtime" \
-                            UsePrecompiledHeader="0" \
-                            WarningLevel="3" \
-                            DebugInformationFormat="0" \
-                            $warn_64bit \
-
-                        $uses_asm && tag Tool Name="YASM"  IncludePaths="$incs"
-                    ;;
-                    *)
-                        tag Tool \
-                            Name="VCCLCompilerTool" \
-                            AdditionalIncludeDirectories="$incs" \
-                            Optimization="2" \
-                            FavorSizeorSpeed="1" \
-                            PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
-                            RuntimeLibrary="$release_runtime" \
-                            UsePrecompiledHeader="0" \
-                            WarningLevel="3" \
-                            DebugInformationFormat="0" \
-                            $warn_64bit \
-
-                        $uses_asm && tag Tool Name="YASM"  IncludePaths="$incs"
-                    ;;
-                esac
-            ;;
-        esac
-
-        case "$proj_kind" in
-            exe)
-                case "$target" in
-                    x86*)
-                        case "$name" in
-                            *)
-                                tag Tool \
-                                    Name="VCLinkerTool" \
-                                    AdditionalDependencies="$libs \$(NoInherit)" \
-                                    AdditionalLibraryDirectories="$libdirs" \
-
-                            ;;
-                        esac
-                    ;;
-                 esac
-            ;;
-            lib)
-                case "$target" in
-                    x86*)
-                        tag Tool \
-                            Name="VCLibrarianTool" \
-                            OutputFile="\$(OutDir)/${name}${lib_sfx}.lib" \
-
-                    ;;
-                esac
-            ;;
-            dll) # note differences to debug version: LinkIncremental, AssemblyDebug
-                tag Tool \
-                    Name="VCLinkerTool" \
-                    AdditionalDependencies="\$(NoInherit)" \
-                    LinkIncremental="1" \
-                    GenerateDebugInformation="true" \
-                    TargetMachine="1" \
-                    $link_opts \
-
-            ;;
-        esac
-
-        close_tag Configuration
-    done
-    close_tag Configurations
-
-    open_tag Files
-    generate_filter srcs   "Source Files"   "c;cc;cpp;def;odl;idl;hpj;bat;asm;asmx"
-    generate_filter hdrs   "Header Files"   "h;hm;inl;inc;xsd"
-    generate_filter resrcs "Resource Files" "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
-    generate_filter resrcs "Build Files"    "mk"
-    close_tag Files
-
-    tag       Globals
-    close_tag VisualStudioProject
-
-    # This must be done from within the {} subshell
-    echo "Ignored files list (${#file_list[@]} items) is:" >&2
-    for f in "${file_list[@]}"; do
-        echo "    $f" >&2
-    done
-}
-
-generate_vcproj |
-    sed  -e '/"/s;\([^ "]\)/;\1\\;g' > ${outfile}
-
-exit
-<!--
-TODO: Add any files not captured by filters.
-                <File
-                        RelativePath=".\ReadMe.txt"
-                        >
-                </File>
--->
diff --git a/src/third_party/libvpx/build/make/gen_msvs_sln.sh b/src/third_party/libvpx/build/make/gen_msvs_sln.sh
deleted file mode 100755
index 664b404..0000000
--- a/src/third_party/libvpx/build/make/gen_msvs_sln.sh
+++ /dev/null
@@ -1,327 +0,0 @@
-#!/bin/bash
-##
-##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-
-self=$0
-self_basename=${self##*/}
-EOL=$'\n'
-EOLDOS=$'\r'
-
-show_help() {
-    cat <<EOF
-Usage: ${self_basename} [options] file1 [file2 ...]
-
-This script generates a Visual Studio solution file from a list of project
-files.
-
-Options:
-    --help                      Print this message
-    --out=outfile               Redirect output to a file
-    --ver=version               Version (7,8,9,10,11,12,14) of visual studio to generate for
-    --target=isa-os-cc          Target specifier
-EOF
-    exit 1
-}
-
-die() {
-    echo "${self_basename}: $@" >&2
-    [ -f "${outfile}" ] && rm -f ${outfile}{,.mk}
-    exit 1
-}
-
-die_unknown(){
-    echo "Unknown option \"$1\"." >&2
-    echo "See ${self_basename} --help for available options." >&2
-    [ -f "${outfile}" ] && rm -f ${outfile}{,.mk}
-    exit 1
-}
-
-indent1=$'\t'
-indent=""
-indent_push() {
-    indent="${indent}${indent1}"
-}
-indent_pop() {
-    indent="${indent%${indent1}}"
-}
-
-parse_project() {
-    local file=$1
-    if [ "$sfx" = "vcproj" ]; then
-        local name=`grep Name "$file" | awk 'BEGIN {FS="\""}{if (NR==1) print $2}'`
-        local guid=`grep ProjectGUID "$file" | awk 'BEGIN {FS="\""}{if (NR==1) print $2}'`
-    else
-        local name=`grep RootNamespace "$file" | sed 's,.*<.*>\(.*\)</.*>.*,\1,'`
-        local guid=`grep ProjectGuid "$file" | sed 's,.*<.*>\(.*\)</.*>.*,\1,'`
-    fi
-
-    # save the project GUID to a varaible, normalizing to the basename of the
-    # vcproj file without the extension
-    local var
-    var=${file##*/}
-    var=${var%%.${sfx}}
-    eval "${var}_file=\"$1\""
-    eval "${var}_name=$name"
-    eval "${var}_guid=$guid"
-
-    if [ "$sfx" = "vcproj" ]; then
-        cur_config_list=`grep -A1 '<Configuration' $file |
-            grep Name | cut -d\" -f2`
-    else
-        cur_config_list=`grep -B1 'Label="Configuration"' $file |
-            grep Condition | cut -d\' -f4`
-    fi
-    new_config_list=$(for i in $config_list $cur_config_list; do
-        echo $i
-    done | sort | uniq)
-    if [ "$config_list" != "" ] && [ "$config_list" != "$new_config_list" ]; then
-        mixed_platforms=1
-    fi
-    config_list="$new_config_list"
-    eval "${var}_config_list=\"$cur_config_list\""
-    proj_list="${proj_list} ${var}"
-}
-
-process_project() {
-    eval "local file=\${$1_file}"
-    eval "local name=\${$1_name}"
-    eval "local guid=\${$1_guid}"
-
-    # save the project GUID to a varaible, normalizing to the basename of the
-    # vcproj file without the extension
-    local var
-    var=${file##*/}
-    var=${var%%.${sfx}}
-    eval "${var}_guid=$guid"
-
-    echo "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"$name\", \"$file\", \"$guid\""
-    indent_push
-
-    eval "local deps=\"\${${var}_deps}\""
-    if [ -n "$deps" ] && [ "$sfx" = "vcproj" ]; then
-        echo "${indent}ProjectSection(ProjectDependencies) = postProject"
-        indent_push
-
-        for dep in $deps; do
-            eval "local dep_guid=\${${dep}_guid}"
-            [ -z "${dep_guid}" ] && die "Unknown GUID for $dep (dependency of $var)"
-            echo "${indent}$dep_guid = $dep_guid"
-        done
-
-        indent_pop
-        echo "${indent}EndProjectSection"
-
-    fi
-
-    indent_pop
-    echo "EndProject"
-}
-
-process_global() {
-    echo "Global"
-    indent_push
-
-    #
-    # Solution Configuration Platforms
-    #
-    echo "${indent}GlobalSection(SolutionConfigurationPlatforms) = preSolution"
-    indent_push
-    IFS_bak=${IFS}
-    IFS=$'\r'$'\n'
-    if [ "$mixed_platforms" != "" ]; then
-        config_list="
-Release|Mixed Platforms
-Debug|Mixed Platforms"
-    fi
-    for config in ${config_list}; do
-        echo "${indent}$config = $config"
-    done
-    IFS=${IFS_bak}
-    indent_pop
-    echo "${indent}EndGlobalSection"
-
-    #
-    # Project Configuration Platforms
-    #
-    echo "${indent}GlobalSection(ProjectConfigurationPlatforms) = postSolution"
-    indent_push
-    for proj in ${proj_list}; do
-        eval "local proj_guid=\${${proj}_guid}"
-        eval "local proj_config_list=\${${proj}_config_list}"
-        IFS=$'\r'$'\n'
-        for config in ${proj_config_list}; do
-            if [ "$mixed_platforms" != "" ]; then
-                local c=${config%%|*}
-                echo "${indent}${proj_guid}.${c}|Mixed Platforms.ActiveCfg = ${config}"
-                echo "${indent}${proj_guid}.${c}|Mixed Platforms.Build.0 = ${config}"
-            else
-                echo "${indent}${proj_guid}.${config}.ActiveCfg = ${config}"
-                echo "${indent}${proj_guid}.${config}.Build.0 = ${config}"
-            fi
-
-        done
-        IFS=${IFS_bak}
-    done
-    indent_pop
-    echo "${indent}EndGlobalSection"
-
-    #
-    # Solution Properties
-    #
-    echo "${indent}GlobalSection(SolutionProperties) = preSolution"
-    indent_push
-    echo "${indent}HideSolutionNode = FALSE"
-    indent_pop
-    echo "${indent}EndGlobalSection"
-
-    indent_pop
-    echo "EndGlobal"
-}
-
-process_makefile() {
-    IFS_bak=${IFS}
-    IFS=$'\r'$'\n'
-    local TAB=$'\t'
-    cat <<EOF
-ifeq (\$(CONFIG_VS_VERSION),7)
-MSBUILD_TOOL := devenv.com
-else
-MSBUILD_TOOL := msbuild.exe
-endif
-found_devenv := \$(shell which \$(MSBUILD_TOOL) >/dev/null 2>&1 && echo yes)
-.nodevenv.once:
-${TAB}@echo "  * \$(MSBUILD_TOOL) not found in path."
-${TAB}@echo "  * "
-${TAB}@echo "  * You will have to build all configurations manually using the"
-${TAB}@echo "  * Visual Studio IDE. To allow make to build them automatically,"
-${TAB}@echo "  * add the Common7/IDE directory of your Visual Studio"
-${TAB}@echo "  * installation to your path, eg:"
-${TAB}@echo "  *   C:\Program Files\Microsoft Visual Studio 8\Common7\IDE"
-${TAB}@echo "  * "
-${TAB}@touch \$@
-CLEAN-OBJS += \$(if \$(found_devenv),,.nodevenv.once)
-
-EOF
-
-    for sln_config in ${config_list}; do
-        local config=${sln_config%%|*}
-        local platform=${sln_config##*|}
-        local nows_sln_config=`echo $sln_config | sed -e 's/[^a-zA-Z0-9]/_/g'`
-        cat <<EOF
-BUILD_TARGETS += \$(if \$(NO_LAUNCH_DEVENV),,$nows_sln_config)
-clean::
-${TAB}rm -rf "$platform"/"$config"
-.PHONY: $nows_sln_config
-ifneq (\$(found_devenv),)
-  ifeq (\$(CONFIG_VS_VERSION),7)
-$nows_sln_config: $outfile
-${TAB}\$(MSBUILD_TOOL) $outfile -build "$config"
-
-  else
-$nows_sln_config: $outfile
-${TAB}\$(MSBUILD_TOOL) $outfile -m -t:Build \\
-${TAB}${TAB}-p:Configuration="$config" -p:Platform="$platform"
-
-  endif
-else
-$nows_sln_config: $outfile .nodevenv.once
-${TAB}@echo "  * Skipping build of $sln_config (\$(MSBUILD_TOOL) not in path)."
-${TAB}@echo "  * "
-endif
-
-EOF
-    done
-    IFS=${IFS_bak}
-}
-
-# Process command line
-outfile=/dev/stdout
-for opt in "$@"; do
-    optval="${opt#*=}"
-    case "$opt" in
-    --help|-h) show_help
-    ;;
-    --out=*) outfile="${optval}"; mkoutfile="${optval}".mk
-    ;;
-    --dep=*) eval "${optval%%:*}_deps=\"\${${optval%%:*}_deps} ${optval##*:}\""
-    ;;
-    --ver=*) vs_ver="$optval"
-             case $optval in
-             [789]|10|11|12|14)
-             ;;
-             *) die Unrecognized Visual Studio Version in $opt
-             ;;
-             esac
-    ;;
-    --ver=*) vs_ver="$optval"
-             case $optval in
-             7) sln_vers="8.00"
-                sln_vers_str="Visual Studio .NET 2003"
-             ;;
-             [89])
-             ;;
-             *) die "Unrecognized Visual Studio Version '$optval' in $opt"
-             ;;
-             esac
-    ;;
-    --target=*) target="${optval}"
-    ;;
-    -*) die_unknown $opt
-    ;;
-    *) file_list[${#file_list[@]}]="$opt"
-    esac
-done
-outfile=${outfile:-/dev/stdout}
-mkoutfile=${mkoutfile:-/dev/stdout}
-case "${vs_ver:-8}" in
-    7) sln_vers="8.00"
-       sln_vers_str="Visual Studio .NET 2003"
-    ;;
-    8) sln_vers="9.00"
-       sln_vers_str="Visual Studio 2005"
-    ;;
-    9) sln_vers="10.00"
-       sln_vers_str="Visual Studio 2008"
-    ;;
-    10) sln_vers="11.00"
-       sln_vers_str="Visual Studio 2010"
-    ;;
-    11) sln_vers="12.00"
-       sln_vers_str="Visual Studio 2012"
-    ;;
-    12) sln_vers="12.00"
-       sln_vers_str="Visual Studio 2013"
-    ;;
-    14) sln_vers="14.00"
-       sln_vers_str="Visual Studio 2015"
-    ;;
-esac
-case "${vs_ver:-8}" in
-    [789])
-    sfx=vcproj
-    ;;
-    10|11|12|14)
-    sfx=vcxproj
-    ;;
-esac
-
-for f in "${file_list[@]}"; do
-    parse_project $f
-done
-cat  >${outfile} <<EOF
-Microsoft Visual Studio Solution File, Format Version $sln_vers${EOLDOS}
-# $sln_vers_str${EOLDOS}
-EOF
-for proj in ${proj_list}; do
-    process_project $proj >>${outfile}
-done
-process_global >>${outfile}
-process_makefile >${mkoutfile}
diff --git a/src/third_party/libvpx/build/make/gen_msvs_vcxproj.sh b/src/third_party/libvpx/build/make/gen_msvs_vcxproj.sh
deleted file mode 100755
index e98611d..0000000
--- a/src/third_party/libvpx/build/make/gen_msvs_vcxproj.sh
+++ /dev/null
@@ -1,490 +0,0 @@
-#!/bin/bash
-##
-##  Copyright (c) 2013 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-self=$0
-self_basename=${self##*/}
-self_dirname=$(dirname "$0")
-
-. "$self_dirname/msvs_common.sh"|| exit 127
-
-show_help() {
-    cat <<EOF
-Usage: ${self_basename} --name=projname [options] file1 [file2 ...]
-
-This script generates a Visual Studio project file from a list of source
-code files.
-
-Options:
-    --help                      Print this message
-    --exe                       Generate a project for building an Application
-    --lib                       Generate a project for creating a static library
-    --dll                       Generate a project for creating a dll
-    --static-crt                Use the static C runtime (/MT)
-    --enable-werror             Treat warnings as errors (/WX)
-    --target=isa-os-cc          Target specifier (required)
-    --out=filename              Write output to a file [stdout]
-    --name=project_name         Name of the project (required)
-    --proj-guid=GUID            GUID to use for the project
-    --module-def=filename       File containing export definitions (for DLLs)
-    --ver=version               Version (10,11,12,14) of visual studio to generate for
-    --src-path-bare=dir         Path to root of source tree
-    -Ipath/to/include           Additional include directories
-    -DFLAG[=value]              Preprocessor macros to define
-    -Lpath/to/lib               Additional library search paths
-    -llibname                   Library to link against
-EOF
-    exit 1
-}
-
-tag_content() {
-    local tag=$1
-    local content=$2
-    shift
-    shift
-    if [ $# -ne 0 ]; then
-        echo "${indent}<${tag}"
-        indent_push
-        tag_attributes "$@"
-        echo "${indent}>${content}</${tag}>"
-        indent_pop
-    else
-        echo "${indent}<${tag}>${content}</${tag}>"
-    fi
-}
-
-generate_filter() {
-    local name=$1
-    local pats=$2
-    local file_list_sz
-    local i
-    local f
-    local saveIFS="$IFS"
-    local pack
-    echo "generating filter '$name' from ${#file_list[@]} files" >&2
-    IFS=*
-
-    file_list_sz=${#file_list[@]}
-    for i in ${!file_list[@]}; do
-        f=${file_list[i]}
-        for pat in ${pats//;/$IFS}; do
-            if [ "${f##*.}" == "$pat" ]; then
-                unset file_list[i]
-
-                objf=$(echo ${f%.*}.obj \
-                       | sed -e "s,$src_path_bare,," \
-                             -e 's/^[\./]\+//g' -e 's,[:/ ],_,g')
-
-                if ([ "$pat" == "asm" ] || [ "$pat" == "s" ]) && $asm_use_custom_step; then
-                    # Avoid object file name collisions, i.e. vpx_config.c and
-                    # vpx_config.asm produce the same object file without
-                    # this additional suffix.
-                    objf=${objf%.obj}_asm.obj
-                    open_tag CustomBuild \
-                        Include="$f"
-                    for plat in "${platforms[@]}"; do
-                        for cfg in Debug Release; do
-                            tag_content Message "Assembling %(Filename)%(Extension)" \
-                                Condition="'\$(Configuration)|\$(Platform)'=='$cfg|$plat'"
-                            tag_content Command "$(eval echo \$asm_${cfg}_cmdline) -o \$(IntDir)$objf" \
-                                Condition="'\$(Configuration)|\$(Platform)'=='$cfg|$plat'"
-                            tag_content Outputs "\$(IntDir)$objf" \
-                                Condition="'\$(Configuration)|\$(Platform)'=='$cfg|$plat'"
-                        done
-                    done
-                    close_tag CustomBuild
-                elif [ "$pat" == "c" ] || \
-                     [ "$pat" == "cc" ] || [ "$pat" == "cpp" ]; then
-                    open_tag ClCompile \
-                        Include="$f"
-                    # Separate file names with Condition?
-                    tag_content ObjectFileName "\$(IntDir)$objf"
-                    # Check for AVX and turn it on to avoid warnings.
-                    if [[ $f =~ avx.?\.c$ ]]; then
-                        tag_content AdditionalOptions "/arch:AVX"
-                    fi
-                    close_tag ClCompile
-                elif [ "$pat" == "h" ] ; then
-                    tag ClInclude \
-                        Include="$f"
-                elif [ "$pat" == "vcxproj" ] ; then
-                    open_tag ProjectReference \
-                        Include="$f"
-                    depguid=`grep ProjectGuid "$f" | sed 's,.*<.*>\(.*\)</.*>.*,\1,'`
-                    tag_content Project "$depguid"
-                    tag_content ReferenceOutputAssembly false
-                    close_tag ProjectReference
-                else
-                    tag None \
-                        Include="$f"
-                fi
-
-                break
-            fi
-        done
-    done
-
-    IFS="$saveIFS"
-}
-
-# Process command line
-unset target
-for opt in "$@"; do
-    optval="${opt#*=}"
-    case "$opt" in
-        --help|-h) show_help
-        ;;
-        --target=*) target="${optval}"
-        ;;
-        --out=*) outfile="$optval"
-        ;;
-        --name=*) name="${optval}"
-        ;;
-        --proj-guid=*) guid="${optval}"
-        ;;
-        --module-def=*) module_def="${optval}"
-        ;;
-        --exe) proj_kind="exe"
-        ;;
-        --dll) proj_kind="dll"
-        ;;
-        --lib) proj_kind="lib"
-        ;;
-        --src-path-bare=*)
-            src_path_bare=$(fix_path "$optval")
-            src_path_bare=${src_path_bare%/}
-        ;;
-        --static-crt) use_static_runtime=true
-        ;;
-        --enable-werror) werror=true
-        ;;
-        --ver=*)
-            vs_ver="$optval"
-            case "$optval" in
-                10|11|12|14)
-                ;;
-                *) die Unrecognized Visual Studio Version in $opt
-                ;;
-            esac
-        ;;
-        -I*)
-            opt=${opt##-I}
-            opt=$(fix_path "$opt")
-            opt="${opt%/}"
-            incs="${incs}${incs:+;}&quot;${opt}&quot;"
-            yasmincs="${yasmincs} -I&quot;${opt}&quot;"
-        ;;
-        -D*) defines="${defines}${defines:+;}${opt##-D}"
-        ;;
-        -L*) # fudge . to $(OutDir)
-            if [ "${opt##-L}" == "." ]; then
-                libdirs="${libdirs}${libdirs:+;}&quot;\$(OutDir)&quot;"
-            else
-                 # Also try directories for this platform/configuration
-                 opt=${opt##-L}
-                 opt=$(fix_path "$opt")
-                 libdirs="${libdirs}${libdirs:+;}&quot;${opt}&quot;"
-                 libdirs="${libdirs}${libdirs:+;}&quot;${opt}/\$(PlatformName)/\$(Configuration)&quot;"
-                 libdirs="${libdirs}${libdirs:+;}&quot;${opt}/\$(PlatformName)&quot;"
-            fi
-        ;;
-        -l*) libs="${libs}${libs:+ }${opt##-l}.lib"
-        ;;
-        -*) die_unknown $opt
-        ;;
-        *)
-            # The paths in file_list are fixed outside of the loop.
-            file_list[${#file_list[@]}]="$opt"
-            case "$opt" in
-                 *.asm|*.s) uses_asm=true
-                 ;;
-            esac
-        ;;
-    esac
-done
-
-# Make one call to fix_path for file_list to improve performance.
-fix_file_list file_list
-
-outfile=${outfile:-/dev/stdout}
-guid=${guid:-`generate_uuid`}
-asm_use_custom_step=false
-uses_asm=${uses_asm:-false}
-case "${vs_ver:-11}" in
-    10|11|12|14)
-       asm_use_custom_step=$uses_asm
-    ;;
-esac
-
-[ -n "$name" ] || die "Project name (--name) must be specified!"
-[ -n "$target" ] || die "Target (--target) must be specified!"
-
-if ${use_static_runtime:-false}; then
-    release_runtime=MultiThreaded
-    debug_runtime=MultiThreadedDebug
-    lib_sfx=mt
-else
-    release_runtime=MultiThreadedDLL
-    debug_runtime=MultiThreadedDebugDLL
-    lib_sfx=md
-fi
-
-# Calculate debug lib names: If a lib ends in ${lib_sfx}.lib, then rename
-# it to ${lib_sfx}d.lib. This precludes linking to release libs from a
-# debug exe, so this may need to be refactored later.
-for lib in ${libs}; do
-    if [ "$lib" != "${lib%${lib_sfx}.lib}" ]; then
-        lib=${lib%.lib}d.lib
-    fi
-    debug_libs="${debug_libs}${debug_libs:+ }${lib}"
-done
-debug_libs=${debug_libs// /;}
-libs=${libs// /;}
-
-
-# List of all platforms supported for this target
-case "$target" in
-    x86_64*)
-        platforms[0]="x64"
-        asm_Debug_cmdline="yasm -Xvc -g cv8 -f win64 ${yasmincs} &quot;%(FullPath)&quot;"
-        asm_Release_cmdline="yasm -Xvc -f win64 ${yasmincs} &quot;%(FullPath)&quot;"
-    ;;
-    x86*)
-        platforms[0]="Win32"
-        asm_Debug_cmdline="yasm -Xvc -g cv8 -f win32 ${yasmincs} &quot;%(FullPath)&quot;"
-        asm_Release_cmdline="yasm -Xvc -f win32 ${yasmincs} &quot;%(FullPath)&quot;"
-    ;;
-    arm*)
-        platforms[0]="ARM"
-        asm_Debug_cmdline="armasm -nologo -oldit &quot;%(FullPath)&quot;"
-        asm_Release_cmdline="armasm -nologo -oldit &quot;%(FullPath)&quot;"
-    ;;
-    *) die "Unsupported target $target!"
-    ;;
-esac
-
-generate_vcxproj() {
-    echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
-    open_tag Project \
-        DefaultTargets="Build" \
-        ToolsVersion="4.0" \
-        xmlns="http://schemas.microsoft.com/developer/msbuild/2003" \
-
-    open_tag ItemGroup \
-        Label="ProjectConfigurations"
-    for plat in "${platforms[@]}"; do
-        for config in Debug Release; do
-            open_tag ProjectConfiguration \
-                Include="$config|$plat"
-            tag_content Configuration $config
-            tag_content Platform $plat
-            close_tag ProjectConfiguration
-        done
-    done
-    close_tag ItemGroup
-
-    open_tag PropertyGroup \
-        Label="Globals"
-        tag_content ProjectGuid "{${guid}}"
-        tag_content RootNamespace ${name}
-        tag_content Keyword ManagedCProj
-        if [ $vs_ver -ge 12 ] && [ "${platforms[0]}" = "ARM" ]; then
-            tag_content AppContainerApplication true
-            # The application type can be one of "Windows Store",
-            # "Windows Phone" or "Windows Phone Silverlight". The
-            # actual value doesn't matter from the libvpx point of view,
-            # since a static library built for one works on the others.
-            # The PlatformToolset field needs to be set in sync with this;
-            # for Windows Store and Windows Phone Silverlight it should be
-            # v120 while it should be v120_wp81 if the type is Windows Phone.
-            tag_content ApplicationType "Windows Store"
-            tag_content ApplicationTypeRevision 8.1
-        fi
-    close_tag PropertyGroup
-
-    tag Import \
-        Project="\$(VCTargetsPath)\\Microsoft.Cpp.Default.props"
-
-    for plat in "${platforms[@]}"; do
-        for config in Release Debug; do
-            open_tag PropertyGroup \
-                Condition="'\$(Configuration)|\$(Platform)'=='$config|$plat'" \
-                Label="Configuration"
-            if [ "$proj_kind" = "exe" ]; then
-                tag_content ConfigurationType Application
-            elif [ "$proj_kind" = "dll" ]; then
-                tag_content ConfigurationType DynamicLibrary
-            else
-                tag_content ConfigurationType StaticLibrary
-            fi
-            if [ "$vs_ver" = "11" ]; then
-                if [ "$plat" = "ARM" ]; then
-                    # Setting the wp80 toolchain automatically sets the
-                    # WINAPI_FAMILY define, which is required for building
-                    # code for arm with the windows headers. Alternatively,
-                    # one could add AppContainerApplication=true in the Globals
-                    # section and add PrecompiledHeader=NotUsing and
-                    # CompileAsWinRT=false in ClCompile and SubSystem=Console
-                    # in Link.
-                    tag_content PlatformToolset v110_wp80
-                else
-                    tag_content PlatformToolset v110
-                fi
-            fi
-            if [ "$vs_ver" = "12" ]; then
-                # Setting a PlatformToolset indicating windows phone isn't
-                # enough to build code for arm with MSVC 2013, one strictly
-                # has to enable AppContainerApplication as well.
-                tag_content PlatformToolset v120
-            fi
-            if [ "$vs_ver" = "14" ]; then
-                tag_content PlatformToolset v140
-            fi
-            tag_content CharacterSet Unicode
-            if [ "$config" = "Release" ]; then
-                tag_content WholeProgramOptimization true
-            fi
-            close_tag PropertyGroup
-        done
-    done
-
-    tag Import \
-        Project="\$(VCTargetsPath)\\Microsoft.Cpp.props"
-
-    open_tag ImportGroup \
-        Label="PropertySheets"
-        tag Import \
-            Project="\$(UserRootDir)\\Microsoft.Cpp.\$(Platform).user.props" \
-            Condition="exists('\$(UserRootDir)\\Microsoft.Cpp.\$(Platform).user.props')" \
-            Label="LocalAppDataPlatform"
-    close_tag ImportGroup
-
-    tag PropertyGroup \
-        Label="UserMacros"
-
-    for plat in "${platforms[@]}"; do
-        plat_no_ws=`echo $plat | sed 's/[^A-Za-z0-9_]/_/g'`
-        for config in Debug Release; do
-            open_tag PropertyGroup \
-                Condition="'\$(Configuration)|\$(Platform)'=='$config|$plat'"
-            tag_content OutDir "\$(SolutionDir)$plat_no_ws\\\$(Configuration)\\"
-            tag_content IntDir "$plat_no_ws\\\$(Configuration)\\${name}\\"
-            if [ "$proj_kind" == "lib" ]; then
-              if [ "$config" == "Debug" ]; then
-                config_suffix=d
-              else
-                config_suffix=""
-              fi
-              tag_content TargetName "${name}${lib_sfx}${config_suffix}"
-            fi
-            close_tag PropertyGroup
-        done
-    done
-
-    for plat in "${platforms[@]}"; do
-        for config in Debug Release; do
-            open_tag ItemDefinitionGroup \
-                Condition="'\$(Configuration)|\$(Platform)'=='$config|$plat'"
-            if [ "$name" == "vpx" ]; then
-                hostplat=$plat
-                if [ "$hostplat" == "ARM" ]; then
-                    hostplat=Win32
-                fi
-            fi
-            open_tag ClCompile
-            if [ "$config" = "Debug" ]; then
-                opt=Disabled
-                runtime=$debug_runtime
-                curlibs=$debug_libs
-                debug=_DEBUG
-            else
-                opt=MaxSpeed
-                runtime=$release_runtime
-                curlibs=$libs
-                tag_content FavorSizeOrSpeed Speed
-                debug=NDEBUG
-            fi
-            extradefines=";$defines"
-            tag_content Optimization $opt
-            tag_content AdditionalIncludeDirectories "$incs;%(AdditionalIncludeDirectories)"
-            tag_content PreprocessorDefinitions "WIN32;$debug;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE$extradefines;%(PreprocessorDefinitions)"
-            tag_content RuntimeLibrary $runtime
-            tag_content WarningLevel Level3
-            if ${werror:-false}; then
-                tag_content TreatWarningAsError true
-            fi
-            if [ $vs_ver -ge 11 ]; then
-                # We need to override the defaults for these settings
-                # if AppContainerApplication is set.
-                tag_content CompileAsWinRT false
-                tag_content PrecompiledHeader NotUsing
-                tag_content SDLCheck false
-            fi
-            close_tag ClCompile
-            case "$proj_kind" in
-            exe)
-                open_tag Link
-                tag_content GenerateDebugInformation true
-                # Console is the default normally, but if
-                # AppContainerApplication is set, we need to override it.
-                tag_content SubSystem Console
-                close_tag Link
-                ;;
-            dll)
-                open_tag Link
-                tag_content GenerateDebugInformation true
-                tag_content ModuleDefinitionFile $module_def
-                close_tag Link
-                ;;
-            lib)
-                ;;
-            esac
-            close_tag ItemDefinitionGroup
-        done
-
-    done
-
-    open_tag ItemGroup
-    generate_filter "Source Files"   "c;cc;cpp;def;odl;idl;hpj;bat;asm;asmx;s"
-    close_tag ItemGroup
-    open_tag ItemGroup
-    generate_filter "Header Files"   "h;hm;inl;inc;xsd"
-    close_tag ItemGroup
-    open_tag ItemGroup
-    generate_filter "Build Files"    "mk"
-    close_tag ItemGroup
-    open_tag ItemGroup
-    generate_filter "References"     "vcxproj"
-    close_tag ItemGroup
-
-    tag Import \
-        Project="\$(VCTargetsPath)\\Microsoft.Cpp.targets"
-
-    open_tag ImportGroup \
-        Label="ExtensionTargets"
-    close_tag ImportGroup
-
-    close_tag Project
-
-    # This must be done from within the {} subshell
-    echo "Ignored files list (${#file_list[@]} items) is:" >&2
-    for f in "${file_list[@]}"; do
-        echo "    $f" >&2
-    done
-}
-
-# This regexp doesn't catch most of the strings in the vcxproj format,
-# since they're like <tag>path</tag> instead of <tag attr="path" />
-# as previously. It still seems to work ok despite this.
-generate_vcxproj |
-    sed  -e '/"/s;\([^ "]\)/;\1\\;g' |
-    sed  -e '/xmlns/s;\\;/;g' > ${outfile}
-
-exit
diff --git a/src/third_party/libvpx/build/make/ios-Info.plist b/src/third_party/libvpx/build/make/ios-Info.plist
deleted file mode 100644
index d157b11..0000000
--- a/src/third_party/libvpx/build/make/ios-Info.plist
+++ /dev/null
@@ -1,37 +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>CFBundleExecutable</key>
-	<string>VPX</string>
-	<key>CFBundleIdentifier</key>
-	<string>org.webmproject.VPX</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>VPX</string>
-	<key>CFBundlePackageType</key>
-	<string>FMWK</string>
-	<key>CFBundleShortVersionString</key>
-	<string>${VERSION}</string>
-	<key>CFBundleSignature</key>
-	<string>????</string>
-	<key>CFBundleSupportedPlatforms</key>
-	<array>
-		<string>iPhoneOS</string>
-	</array>
-	<key>CFBundleVersion</key>
-	<string>${VERSION}</string>
-	<key>MinimumOSVersion</key>
-	<string>${IOS_VERSION_MIN}</string>
-	<key>UIDeviceFamily</key>
-	<array>
-		<integer>1</integer>
-		<integer>2</integer>
-	</array>
-	<key>VPXFullVersion</key>
-	<string>${FULLVERSION}</string>
-</dict>
-</plist>
diff --git a/src/third_party/libvpx/build/make/iosbuild.sh b/src/third_party/libvpx/build/make/iosbuild.sh
deleted file mode 100755
index c703f22..0000000
--- a/src/third_party/libvpx/build/make/iosbuild.sh
+++ /dev/null
@@ -1,383 +0,0 @@
-#!/bin/sh
-##
-##  Copyright (c) 2014 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-##
-## This script generates 'VPX.framework'. An iOS app can encode and decode VPx
-## video by including 'VPX.framework'.
-##
-## Run iosbuild.sh to create 'VPX.framework' in the current directory.
-##
-set -e
-devnull='> /dev/null 2>&1'
-
-BUILD_ROOT="_iosbuild"
-CONFIGURE_ARGS="--disable-docs
-                --disable-examples
-                --disable-libyuv
-                --disable-unit-tests"
-DIST_DIR="_dist"
-FRAMEWORK_DIR="VPX.framework"
-FRAMEWORK_LIB="VPX.framework/VPX"
-HEADER_DIR="${FRAMEWORK_DIR}/Headers/vpx"
-SCRIPT_DIR=$(dirname "$0")
-LIBVPX_SOURCE_DIR=$(cd ${SCRIPT_DIR}/../..; pwd)
-LIPO=$(xcrun -sdk iphoneos${SDK} -find lipo)
-ORIG_PWD="$(pwd)"
-ARM_TARGETS="arm64-darwin-gcc
-             armv7-darwin-gcc
-             armv7s-darwin-gcc"
-SIM_TARGETS="x86-iphonesimulator-gcc
-             x86_64-iphonesimulator-gcc"
-OSX_TARGETS="x86-darwin15-gcc
-             x86_64-darwin15-gcc"
-TARGETS="${ARM_TARGETS} ${SIM_TARGETS}"
-
-# Configures for the target specified by $1, and invokes make with the dist
-# target using $DIST_DIR as the distribution output directory.
-build_target() {
-  local target="$1"
-  local old_pwd="$(pwd)"
-  local target_specific_flags=""
-
-  vlog "***Building target: ${target}***"
-
-  case "${target}" in
-    x86-*)
-      target_specific_flags="--enable-pic"
-      vlog "Enabled PIC for ${target}"
-      ;;
-  esac
-
-  mkdir "${target}"
-  cd "${target}"
-  eval "${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \
-    ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} ${target_specific_flags} \
-    ${devnull}
-  export DIST_DIR
-  eval make dist ${devnull}
-  cd "${old_pwd}"
-
-  vlog "***Done building target: ${target}***"
-}
-
-# Returns the preprocessor symbol for the target specified by $1.
-target_to_preproc_symbol() {
-  target="$1"
-  case "${target}" in
-    arm64-*)
-      echo "__aarch64__"
-      ;;
-    armv7-*)
-      echo "__ARM_ARCH_7A__"
-      ;;
-    armv7s-*)
-      echo "__ARM_ARCH_7S__"
-      ;;
-    x86-*)
-      echo "__i386__"
-      ;;
-    x86_64-*)
-      echo "__x86_64__"
-      ;;
-    *)
-      echo "#error ${target} unknown/unsupported"
-      return 1
-      ;;
-  esac
-}
-
-# Create a vpx_config.h shim that, based on preprocessor settings for the
-# current target CPU, includes the real vpx_config.h for the current target.
-# $1 is the list of targets.
-create_vpx_framework_config_shim() {
-  local targets="$1"
-  local config_file="${HEADER_DIR}/vpx_config.h"
-  local preproc_symbol=""
-  local target=""
-  local include_guard="VPX_FRAMEWORK_HEADERS_VPX_VPX_CONFIG_H_"
-
-  local file_header="/*
- *  Copyright (c) $(date +%Y) The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-/* GENERATED FILE: DO NOT EDIT! */
-
-#ifndef ${include_guard}
-#define ${include_guard}
-
-#if defined"
-
-  printf "%s" "${file_header}" > "${config_file}"
-  for target in ${targets}; do
-    preproc_symbol=$(target_to_preproc_symbol "${target}")
-    printf " ${preproc_symbol}\n" >> "${config_file}"
-    printf "#define VPX_FRAMEWORK_TARGET \"${target}\"\n" >> "${config_file}"
-    printf "#include \"VPX/vpx/${target}/vpx_config.h\"\n" >> "${config_file}"
-    printf "#elif defined" >> "${config_file}"
-    mkdir "${HEADER_DIR}/${target}"
-    cp -p "${BUILD_ROOT}/${target}/vpx_config.h" "${HEADER_DIR}/${target}"
-  done
-
-  # Consume the last line of output from the loop: We don't want it.
-  sed -i '' -e '$d' "${config_file}"
-
-  printf "#endif\n\n" >> "${config_file}"
-  printf "#endif  // ${include_guard}" >> "${config_file}"
-}
-
-# Verifies that $FRAMEWORK_LIB fat library contains requested builds.
-verify_framework_targets() {
-  local requested_cpus=""
-  local cpu=""
-
-  # Extract CPU from full target name.
-  for target; do
-    cpu="${target%%-*}"
-    if [ "${cpu}" = "x86" ]; then
-      # lipo -info outputs i386 for libvpx x86 targets.
-      cpu="i386"
-    fi
-    requested_cpus="${requested_cpus}${cpu} "
-  done
-
-  # Get target CPUs present in framework library.
-  local targets_built=$(${LIPO} -info ${FRAMEWORK_LIB})
-
-  # $LIPO -info outputs a string like the following:
-  #   Architectures in the fat file: $FRAMEWORK_LIB <architectures>
-  # Capture only the architecture strings.
-  targets_built=${targets_built##*: }
-
-  # Sort CPU strings to make the next step a simple string compare.
-  local actual=$(echo ${targets_built} | tr " " "\n" | sort | tr "\n" " ")
-  local requested=$(echo ${requested_cpus} | tr " " "\n" | sort | tr "\n" " ")
-
-  vlog "Requested ${FRAMEWORK_LIB} CPUs: ${requested}"
-  vlog "Actual ${FRAMEWORK_LIB} CPUs: ${actual}"
-
-  if [ "${requested}" != "${actual}" ]; then
-    elog "Actual ${FRAMEWORK_LIB} targets do not match requested target list."
-    elog "  Requested target CPUs: ${requested}"
-    elog "  Actual target CPUs: ${actual}"
-    return 1
-  fi
-}
-
-# Configures and builds each target specified by $1, and then builds
-# VPX.framework.
-build_framework() {
-  local lib_list=""
-  local targets="$1"
-  local target=""
-  local target_dist_dir=""
-
-  # Clean up from previous build(s).
-  rm -rf "${BUILD_ROOT}" "${FRAMEWORK_DIR}"
-
-  # Create output dirs.
-  mkdir -p "${BUILD_ROOT}"
-  mkdir -p "${HEADER_DIR}"
-
-  cd "${BUILD_ROOT}"
-
-  for target in ${targets}; do
-    build_target "${target}"
-    target_dist_dir="${BUILD_ROOT}/${target}/${DIST_DIR}"
-    if [ "${ENABLE_SHARED}" = "yes" ]; then
-      local suffix="dylib"
-    else
-      local suffix="a"
-    fi
-    lib_list="${lib_list} ${target_dist_dir}/lib/libvpx.${suffix}"
-  done
-
-  cd "${ORIG_PWD}"
-
-  # The basic libvpx API includes are all the same; just grab the most recent
-  # set.
-  cp -p "${target_dist_dir}"/include/vpx/* "${HEADER_DIR}"
-
-  # Build the fat library.
-  ${LIPO} -create ${lib_list} -output ${FRAMEWORK_DIR}/VPX
-
-  # Create the vpx_config.h shim that allows usage of vpx_config.h from
-  # within VPX.framework.
-  create_vpx_framework_config_shim "${targets}"
-
-  # Copy in vpx_version.h.
-  cp -p "${BUILD_ROOT}/${target}/vpx_version.h" "${HEADER_DIR}"
-
-  if [ "${ENABLE_SHARED}" = "yes" ]; then
-    # Adjust the dylib's name so dynamic linking in apps works as expected.
-    install_name_tool -id '@rpath/VPX.framework/VPX' ${FRAMEWORK_DIR}/VPX
-
-    # Copy in Info.plist.
-    cat "${SCRIPT_DIR}/ios-Info.plist" \
-      | sed "s/\${FULLVERSION}/${FULLVERSION}/g" \
-      | sed "s/\${VERSION}/${VERSION}/g" \
-      | sed "s/\${IOS_VERSION_MIN}/${IOS_VERSION_MIN}/g" \
-      > "${FRAMEWORK_DIR}/Info.plist"
-  fi
-
-  # Confirm VPX.framework/VPX contains the targets requested.
-  verify_framework_targets ${targets}
-
-  vlog "Created fat library ${FRAMEWORK_LIB} containing:"
-  for lib in ${lib_list}; do
-    vlog "  $(echo ${lib} | awk -F / '{print $2, $NF}')"
-  done
-}
-
-# Trap function. Cleans up the subtree used to build all targets contained in
-# $TARGETS.
-cleanup() {
-  local readonly res=$?
-  cd "${ORIG_PWD}"
-
-  if [ $res -ne 0 ]; then
-    elog "build exited with error ($res)"
-  fi
-
-  if [ "${PRESERVE_BUILD_OUTPUT}" != "yes" ]; then
-    rm -rf "${BUILD_ROOT}"
-  fi
-}
-
-print_list() {
-  local indent="$1"
-  shift
-  local list="$@"
-  for entry in ${list}; do
-    echo "${indent}${entry}"
-  done
-}
-
-iosbuild_usage() {
-cat << EOF
-  Usage: ${0##*/} [arguments]
-    --help: Display this message and exit.
-    --enable-shared: Build a dynamic framework for use on iOS 8 or later.
-    --extra-configure-args <args>: Extra args to pass when configuring libvpx.
-    --macosx: Uses darwin15 targets instead of iphonesimulator targets for x86
-              and x86_64. Allows linking to framework when builds target MacOSX
-              instead of iOS.
-    --preserve-build-output: Do not delete the build directory.
-    --show-build-output: Show output from each library build.
-    --targets <targets>: Override default target list. Defaults:
-$(print_list "        " ${TARGETS})
-    --test-link: Confirms all targets can be linked. Functionally identical to
-                 passing --enable-examples via --extra-configure-args.
-    --verbose: Output information about the environment and each stage of the
-               build.
-EOF
-}
-
-elog() {
-  echo "${0##*/} failed because: $@" 1>&2
-}
-
-vlog() {
-  if [ "${VERBOSE}" = "yes" ]; then
-    echo "$@"
-  fi
-}
-
-trap cleanup EXIT
-
-# Parse the command line.
-while [ -n "$1" ]; do
-  case "$1" in
-    --extra-configure-args)
-      EXTRA_CONFIGURE_ARGS="$2"
-      shift
-      ;;
-    --help)
-      iosbuild_usage
-      exit
-      ;;
-    --enable-shared)
-      ENABLE_SHARED=yes
-      ;;
-    --preserve-build-output)
-      PRESERVE_BUILD_OUTPUT=yes
-      ;;
-    --show-build-output)
-      devnull=
-      ;;
-    --test-link)
-      EXTRA_CONFIGURE_ARGS="${EXTRA_CONFIGURE_ARGS} --enable-examples"
-      ;;
-    --targets)
-      TARGETS="$2"
-      shift
-      ;;
-    --macosx)
-      TARGETS="${ARM_TARGETS} ${OSX_TARGETS}"
-      ;;
-    --verbose)
-      VERBOSE=yes
-      ;;
-    *)
-      iosbuild_usage
-      exit 1
-      ;;
-  esac
-  shift
-done
-
-if [ "${ENABLE_SHARED}" = "yes" ]; then
-  CONFIGURE_ARGS="--enable-shared ${CONFIGURE_ARGS}"
-fi
-
-FULLVERSION=$("${SCRIPT_DIR}"/version.sh --bare "${LIBVPX_SOURCE_DIR}")
-VERSION=$(echo "${FULLVERSION}" | sed -E 's/^v([0-9]+\.[0-9]+\.[0-9]+).*$/\1/')
-
-if [ "$ENABLE_SHARED" = "yes" ]; then
-  IOS_VERSION_OPTIONS="--enable-shared"
-  IOS_VERSION_MIN="8.0"
-else
-  IOS_VERSION_OPTIONS=""
-  IOS_VERSION_MIN="6.0"
-fi
-
-if [ "${VERBOSE}" = "yes" ]; then
-cat << EOF
-  BUILD_ROOT=${BUILD_ROOT}
-  DIST_DIR=${DIST_DIR}
-  CONFIGURE_ARGS=${CONFIGURE_ARGS}
-  EXTRA_CONFIGURE_ARGS=${EXTRA_CONFIGURE_ARGS}
-  FRAMEWORK_DIR=${FRAMEWORK_DIR}
-  FRAMEWORK_LIB=${FRAMEWORK_LIB}
-  HEADER_DIR=${HEADER_DIR}
-  LIBVPX_SOURCE_DIR=${LIBVPX_SOURCE_DIR}
-  LIPO=${LIPO}
-  MAKEFLAGS=${MAKEFLAGS}
-  ORIG_PWD=${ORIG_PWD}
-  PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT}
-  TARGETS="$(print_list "" ${TARGETS})"
-  ENABLE_SHARED=${ENABLE_SHARED}
-  OSX_TARGETS="${OSX_TARGETS}"
-  SIM_TARGETS="${SIM_TARGETS}"
-  SCRIPT_DIR="${SCRIPT_DIR}"
-  FULLVERSION="${FULLVERSION}"
-  VERSION="${VERSION}"
-  IOS_VERSION_MIN="${IOS_VERSION_MIN}"
-EOF
-fi
-
-build_framework "${TARGETS}"
-echo "Successfully built '${FRAMEWORK_DIR}' for:"
-print_list "" ${TARGETS}
diff --git a/src/third_party/libvpx/build/make/msvs_common.sh b/src/third_party/libvpx/build/make/msvs_common.sh
deleted file mode 100644
index 88f1cf9..0000000
--- a/src/third_party/libvpx/build/make/msvs_common.sh
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/bin/bash
-##
-##  Copyright (c) 2014 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-if [ "$(uname -o 2>/dev/null)" = "Cygwin" ] \
-   && cygpath --help >/dev/null 2>&1; then
-    FIXPATH='cygpath -m'
-else
-    FIXPATH='echo_path'
-fi
-
-die() {
-    echo "${self_basename}: $@" >&2
-    exit 1
-}
-
-die_unknown(){
-    echo "Unknown option \"$1\"." >&2
-    echo "See ${self_basename} --help for available options." >&2
-    exit 1
-}
-
-echo_path() {
-    for path; do
-        echo "$path"
-    done
-}
-
-# Output one, possibly changed based on the system, path per line.
-fix_path() {
-    $FIXPATH "$@"
-}
-
-# Corrects the paths in file_list in one pass for efficiency.
-# $1 is the name of the array to be modified.
-fix_file_list() {
-    declare -n array_ref=$1
-    files=$(fix_path "${array_ref[@]}")
-    local IFS=$'\n'
-    array_ref=($files)
-}
-
-generate_uuid() {
-    local hex="0123456789ABCDEF"
-    local i
-    local uuid=""
-    local j
-    #93995380-89BD-4b04-88EB-625FBE52EBFB
-    for ((i=0; i<32; i++)); do
-        (( j = $RANDOM % 16 ))
-        uuid="${uuid}${hex:$j:1}"
-    done
-    echo "${uuid:0:8}-${uuid:8:4}-${uuid:12:4}-${uuid:16:4}-${uuid:20:12}"
-}
-
-indent1="    "
-indent=""
-indent_push() {
-    indent="${indent}${indent1}"
-}
-indent_pop() {
-    indent="${indent%${indent1}}"
-}
-
-tag_attributes() {
-    for opt in "$@"; do
-        optval="${opt#*=}"
-        [ -n "${optval}" ] ||
-            die "Missing attribute value in '$opt' while generating $tag tag"
-        echo "${indent}${opt%%=*}=\"${optval}\""
-    done
-}
-
-open_tag() {
-    local tag=$1
-    shift
-    if [ $# -ne 0 ]; then
-        echo "${indent}<${tag}"
-        indent_push
-        tag_attributes "$@"
-        echo "${indent}>"
-    else
-        echo "${indent}<${tag}>"
-        indent_push
-    fi
-}
-
-close_tag() {
-    local tag=$1
-    indent_pop
-    echo "${indent}</${tag}>"
-}
-
-tag() {
-    local tag=$1
-    shift
-    if [ $# -ne 0 ]; then
-        echo "${indent}<${tag}"
-        indent_push
-        tag_attributes "$@"
-        indent_pop
-        echo "${indent}/>"
-    else
-        echo "${indent}<${tag}/>"
-    fi
-}
-
diff --git a/src/third_party/libvpx/build/make/rtcd.pl b/src/third_party/libvpx/build/make/rtcd.pl
deleted file mode 100755
index 991b6ab..0000000
--- a/src/third_party/libvpx/build/make/rtcd.pl
+++ /dev/null
@@ -1,426 +0,0 @@
-#!/usr/bin/env perl
-
-no strict 'refs';
-use warnings;
-use Getopt::Long;
-Getopt::Long::Configure("auto_help") if $Getopt::Long::VERSION > 2.32;
-
-my %ALL_FUNCS = ();
-my @ALL_ARCHS;
-my @ALL_FORWARD_DECLS;
-my @REQUIRES;
-
-my %opts = ();
-my %disabled = ();
-my %required = ();
-
-my @argv;
-foreach (@ARGV) {
-  $disabled{$1} = 1, next if /--disable-(.*)/;
-  $required{$1} = 1, next if /--require-(.*)/;
-  push @argv, $_;
-}
-
-# NB: use GetOptions() instead of GetOptionsFromArray() for compatibility.
-@ARGV = @argv;
-GetOptions(
-  \%opts,
-  'arch=s',
-  'sym=s',
-  'config=s',
-);
-
-foreach my $opt (qw/arch config/) {
-  if (!defined($opts{$opt})) {
-    warn "--$opt is required!\n";
-    Getopt::Long::HelpMessage('-exit' => 1);
-  }
-}
-
-foreach my $defs_file (@ARGV) {
-  if (!-f $defs_file) {
-    warn "$defs_file: $!\n";
-    Getopt::Long::HelpMessage('-exit' => 1);
-  }
-}
-
-open CONFIG_FILE, $opts{config} or
-  die "Error opening config file '$opts{config}': $!\n";
-
-my %config = ();
-while (<CONFIG_FILE>) {
-  next if !/^(?:CONFIG_|HAVE_)/;
-  chomp;
-  my @pair = split /=/;
-  $config{$pair[0]} = $pair[1];
-}
-close CONFIG_FILE;
-
-#
-# Routines for the RTCD DSL to call
-#
-sub vpx_config($) {
-  return (defined $config{$_[0]}) ? $config{$_[0]} : "";
-}
-
-sub specialize {
-  my $fn=$_[0];
-  shift;
-  foreach my $opt (@_) {
-    eval "\$${fn}_${opt}=${fn}_${opt}";
-  }
-}
-
-sub add_proto {
-  my $fn = splice(@_, -2, 1);
-  $ALL_FUNCS{$fn} = \@_;
-  specialize $fn, "c";
-}
-
-sub require {
-  foreach my $fn (keys %ALL_FUNCS) {
-    foreach my $opt (@_) {
-      my $ofn = eval "\$${fn}_${opt}";
-      next if !$ofn;
-
-      # if we already have a default, then we can disable it, as we know
-      # we can do better.
-      my $best = eval "\$${fn}_default";
-      if ($best) {
-        my $best_ofn = eval "\$${best}";
-        if ($best_ofn && "$best_ofn" ne "$ofn") {
-          eval "\$${best}_link = 'false'";
-        }
-      }
-      eval "\$${fn}_default=${fn}_${opt}";
-      eval "\$${fn}_${opt}_link='true'";
-    }
-  }
-}
-
-sub forward_decls {
-  push @ALL_FORWARD_DECLS, @_;
-}
-
-#
-# Include the user's directives
-#
-foreach my $f (@ARGV) {
-  open FILE, "<", $f or die "cannot open $f: $!\n";
-  my $contents = join('', <FILE>);
-  close FILE;
-  eval $contents or warn "eval failed: $@\n";
-}
-
-#
-# Process the directives according to the command line
-#
-sub process_forward_decls() {
-  foreach (@ALL_FORWARD_DECLS) {
-    $_->();
-  }
-}
-
-sub determine_indirection {
-  vpx_config("CONFIG_RUNTIME_CPU_DETECT") eq "yes" or &require(@ALL_ARCHS);
-  foreach my $fn (keys %ALL_FUNCS) {
-    my $n = "";
-    my @val = @{$ALL_FUNCS{$fn}};
-    my $args = pop @val;
-    my $rtyp = "@val";
-    my $dfn = eval "\$${fn}_default";
-    $dfn = eval "\$${dfn}";
-    foreach my $opt (@_) {
-      my $ofn = eval "\$${fn}_${opt}";
-      next if !$ofn;
-      my $link = eval "\$${fn}_${opt}_link";
-      next if $link && $link eq "false";
-      $n .= "x";
-    }
-    if ($n eq "x") {
-      eval "\$${fn}_indirect = 'false'";
-    } else {
-      eval "\$${fn}_indirect = 'true'";
-    }
-  }
-}
-
-sub declare_function_pointers {
-  foreach my $fn (sort keys %ALL_FUNCS) {
-    my @val = @{$ALL_FUNCS{$fn}};
-    my $args = pop @val;
-    my $rtyp = "@val";
-    my $dfn = eval "\$${fn}_default";
-    $dfn = eval "\$${dfn}";
-    foreach my $opt (@_) {
-      my $ofn = eval "\$${fn}_${opt}";
-      next if !$ofn;
-      print "$rtyp ${ofn}($args);\n";
-    }
-    if (eval "\$${fn}_indirect" eq "false") {
-      print "#define ${fn} ${dfn}\n";
-    } else {
-      print "RTCD_EXTERN $rtyp (*${fn})($args);\n";
-    }
-    print "\n";
-  }
-}
-
-sub set_function_pointers {
-  foreach my $fn (sort keys %ALL_FUNCS) {
-    my @val = @{$ALL_FUNCS{$fn}};
-    my $args = pop @val;
-    my $rtyp = "@val";
-    my $dfn = eval "\$${fn}_default";
-    $dfn = eval "\$${dfn}";
-    if (eval "\$${fn}_indirect" eq "true") {
-      print "    $fn = $dfn;\n";
-      foreach my $opt (@_) {
-        my $ofn = eval "\$${fn}_${opt}";
-        next if !$ofn;
-        next if "$ofn" eq "$dfn";
-        my $link = eval "\$${fn}_${opt}_link";
-        next if $link && $link eq "false";
-        my $cond = eval "\$have_${opt}";
-        print "    if (${cond}) $fn = $ofn;\n"
-      }
-    }
-  }
-}
-
-sub filter {
-  my @filtered;
-  foreach (@_) { push @filtered, $_ unless $disabled{$_}; }
-  return @filtered;
-}
-
-#
-# Helper functions for generating the arch specific RTCD files
-#
-sub common_top() {
-  my $include_guard = uc($opts{sym})."_H_";
-  print <<EOF;
-#ifndef ${include_guard}
-#define ${include_guard}
-
-#ifdef RTCD_C
-#define RTCD_EXTERN
-#else
-#define RTCD_EXTERN extern
-#endif
-
-EOF
-
-process_forward_decls();
-print <<EOF;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
-declare_function_pointers("c", @ALL_ARCHS);
-
-print <<EOF;
-void $opts{sym}(void);
-
-EOF
-}
-
-sub common_bottom() {
-  print <<EOF;
-
-#ifdef __cplusplus
-}  // extern "C"
-#endif
-
-#endif
-EOF
-}
-
-sub x86() {
-  determine_indirection("c", @ALL_ARCHS);
-
-  # Assign the helper variable for each enabled extension
-  foreach my $opt (@ALL_ARCHS) {
-    my $opt_uc = uc $opt;
-    eval "\$have_${opt}=\"flags & HAS_${opt_uc}\"";
-  }
-
-  common_top;
-  print <<EOF;
-#ifdef RTCD_C
-#include "vpx_ports/x86.h"
-static void setup_rtcd_internal(void)
-{
-    int flags = x86_simd_caps();
-
-    (void)flags;
-
-EOF
-
-  set_function_pointers("c", @ALL_ARCHS);
-
-  print <<EOF;
-}
-#endif
-EOF
-  common_bottom;
-}
-
-sub arm() {
-  determine_indirection("c", @ALL_ARCHS);
-
-  # Assign the helper variable for each enabled extension
-  foreach my $opt (@ALL_ARCHS) {
-    my $opt_uc = uc $opt;
-    # Enable neon assembly based on HAVE_NEON logic instead of adding new
-    # HAVE_NEON_ASM logic
-    if ($opt eq 'neon_asm') { $opt_uc = 'NEON' }
-    eval "\$have_${opt}=\"flags & HAS_${opt_uc}\"";
-  }
-
-  common_top;
-  print <<EOF;
-#include "vpx_config.h"
-
-#ifdef RTCD_C
-#include "vpx_ports/arm.h"
-static void setup_rtcd_internal(void)
-{
-    int flags = arm_cpu_caps();
-
-    (void)flags;
-
-EOF
-
-  set_function_pointers("c", @ALL_ARCHS);
-
-  print <<EOF;
-}
-#endif
-EOF
-  common_bottom;
-}
-
-sub mips() {
-  determine_indirection("c", @ALL_ARCHS);
-  common_top;
-
-  print <<EOF;
-#include "vpx_config.h"
-
-#ifdef RTCD_C
-static void setup_rtcd_internal(void)
-{
-EOF
-
-  set_function_pointers("c", @ALL_ARCHS);
-
-  print <<EOF;
-#if HAVE_DSPR2
-void vpx_dsputil_static_init();
-#if CONFIG_VP8
-void dsputil_static_init();
-#endif
-
-vpx_dsputil_static_init();
-#if CONFIG_VP8
-dsputil_static_init();
-#endif
-#endif
-}
-#endif
-EOF
-  common_bottom;
-}
-
-sub unoptimized() {
-  determine_indirection "c";
-  common_top;
-  print <<EOF;
-#include "vpx_config.h"
-
-#ifdef RTCD_C
-static void setup_rtcd_internal(void)
-{
-EOF
-
-  set_function_pointers "c";
-
-  print <<EOF;
-}
-#endif
-EOF
-  common_bottom;
-}
-
-#
-# Main Driver
-#
-
-&require("c");
-if ($opts{arch} eq 'x86') {
-  @ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/);
-  x86;
-} elsif ($opts{arch} eq 'x86_64') {
-  @ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/);
-  @REQUIRES = filter(keys %required ? keys %required : qw/mmx sse sse2/);
-  &require(@REQUIRES);
-  x86;
-} elsif ($opts{arch} eq 'mips32' || $opts{arch} eq 'mips64') {
-  @ALL_ARCHS = filter("$opts{arch}");
-  open CONFIG_FILE, $opts{config} or
-    die "Error opening config file '$opts{config}': $!\n";
-  while (<CONFIG_FILE>) {
-    if (/HAVE_DSPR2=yes/) {
-      @ALL_ARCHS = filter("$opts{arch}", qw/dspr2/);
-      last;
-    }
-    if (/HAVE_MSA=yes/) {
-      @ALL_ARCHS = filter("$opts{arch}", qw/msa/);
-      last;
-    }
-  }
-  close CONFIG_FILE;
-  mips;
-} elsif ($opts{arch} eq 'armv6') {
-  @ALL_ARCHS = filter(qw/media/);
-  arm;
-} elsif ($opts{arch} =~ /armv7\w?/) {
-  @ALL_ARCHS = filter(qw/media neon_asm neon/);
-  @REQUIRES = filter(keys %required ? keys %required : qw/media/);
-  &require(@REQUIRES);
-  arm;
-} elsif ($opts{arch} eq 'armv8' || $opts{arch} eq 'arm64' ) {
-  @ALL_ARCHS = filter(qw/neon/);
-  arm;
-} else {
-  unoptimized;
-}
-
-__END__
-
-=head1 NAME
-
-rtcd -
-
-=head1 SYNOPSIS
-
-Usage: rtcd.pl [options] FILE
-
-See 'perldoc rtcd.pl' for more details.
-
-=head1 DESCRIPTION
-
-Reads the Run Time CPU Detections definitions from FILE and generates a
-C header file on stdout.
-
-=head1 OPTIONS
-
-Options:
-  --arch=ARCH       Architecture to generate defs for (required)
-  --disable-EXT     Disable support for EXT extensions
-  --require-EXT     Require support for EXT extensions
-  --sym=SYMBOL      Unique symbol to use for RTCD initialization function
-  --config=FILE     File with CONFIG_FOO=yes lines to parse
diff --git a/src/third_party/libvpx/build/make/thumb.pm b/src/third_party/libvpx/build/make/thumb.pm
deleted file mode 100644
index 483c253..0000000
--- a/src/third_party/libvpx/build/make/thumb.pm
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/env perl
-##
-##  Copyright (c) 2013 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-package thumb;
-
-sub FixThumbInstructions($$)
-{
-    my $short_branches = $_[1];
-    my $branch_shift_offset = $short_branches ? 1 : 0;
-
-    # Write additions with shifts, such as "add r10, r11, lsl #8",
-    # in three operand form, "add r10, r10, r11, lsl #8".
-    s/(add\s+)(r\d+),\s*(r\d+),\s*(lsl #\d+)/$1$2, $2, $3, $4/g;
-
-    # Convert additions with a non-constant shift into a sequence
-    # with left shift, addition and a right shift (to restore the
-    # register to the original value). Currently the right shift
-    # isn't necessary in the code base since the values in these
-    # registers aren't used, but doing the shift for consistency.
-    # This converts instructions such as "add r12, r12, r5, lsl r4"
-    # into the sequence "lsl r5, r4", "add r12, r12, r5", "lsr r5, r4".
-    s/^(\s*)(add)(\s+)(r\d+),\s*(r\d+),\s*(r\d+),\s*lsl (r\d+)/$1lsl$3$6, $7\n$1$2$3$4, $5, $6\n$1lsr$3$6, $7/g;
-
-    # Convert loads with right shifts in the indexing into a
-    # sequence of an add, load and sub. This converts
-    # "ldrb r4, [r9, lr, asr #1]" into "add r9, r9, lr, asr #1",
-    # "ldrb r9, [r9]", "sub r9, r9, lr, asr #1".
-    s/^(\s*)(ldrb)(\s+)(r\d+),\s*\[(\w+),\s*(\w+),\s*(asr #\d+)\]/$1add $3$5, $5, $6, $7\n$1$2$3$4, [$5]\n$1sub $3$5, $5, $6, $7/g;
-
-    # Convert register indexing with writeback into a separate add
-    # instruction. This converts "ldrb r12, [r1, r2]!" into
-    # "ldrb r12, [r1, r2]", "add r1, r1, r2".
-    s/^(\s*)(ldrb)(\s+)(r\d+),\s*\[(\w+),\s*(\w+)\]!/$1$2$3$4, [$5, $6]\n$1add $3$5, $6/g;
-
-    # Convert negative register indexing into separate sub/add instructions.
-    # This converts "ldrne r4, [src, -pstep, lsl #1]" into
-    # "subne src, src, pstep, lsl #1", "ldrne r4, [src]",
-    # "addne src, src, pstep, lsl #1". In a couple of cases where
-    # this is used, it's used for two subsequent load instructions,
-    # where a hand-written version of it could merge two subsequent
-    # add and sub instructions.
-    s/^(\s*)((ldr|str|pld)(ne)?)(\s+)(r\d+,\s*)?\[(\w+), -([^\]]+)\]/$1sub$4$5$7, $7, $8\n$1$2$5$6\[$7\]\n$1add$4$5$7, $7, $8/g;
-
-    # Convert register post indexing to a separate add instruction.
-    # This converts "ldrneb r9, [r0], r2" into "ldrneb r9, [r0]",
-    # "addne r0, r0, r2".
-    s/^(\s*)((ldr|str)(ne)?[bhd]?)(\s+)(\w+),(\s*\w+,)?\s*\[(\w+)\],\s*(\w+)/$1$2$5$6,$7 [$8]\n$1add$4$5$8, $8, $9/g;
-
-    # Convert a conditional addition to the pc register into a series of
-    # instructions. This converts "addlt pc, pc, r3, lsl #2" into
-    # "itttt lt", "movlt.n r12, pc", "addlt.w r12, #12",
-    # "addlt.w r12, r12, r3, lsl #2", "movlt.n pc, r12".
-    # This assumes that r12 is free at this point.
-    s/^(\s*)addlt(\s+)pc,\s*pc,\s*(\w+),\s*lsl\s*#(\d+)/$1itttt$2lt\n$1movlt.n$2r12, pc\n$1addlt.w$2r12, #12\n$1addlt.w$2r12, r12, $3, lsl #($4-$branch_shift_offset)\n$1movlt.n$2pc, r12/g;
-
-    # Convert "mov pc, lr" into "bx lr", since the former only works
-    # for switching from arm to thumb (and only in armv7), but not
-    # from thumb to arm.
-    s/mov(\s*)pc\s*,\s*lr/bx$1lr/g;
-}
-
-1;
diff --git a/src/third_party/libvpx/build/make/version.sh b/src/third_party/libvpx/build/make/version.sh
deleted file mode 100755
index 6967527..0000000
--- a/src/third_party/libvpx/build/make/version.sh
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-##
-##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-
-
-for opt in "$@"; do
-    optval="${opt#*=}"
-    case "$opt" in
-    --bare) bare=true ;;
-    *) break ;;
-    esac
-    shift
-done
-source_path=${1:-.}
-out_file=${2}
-id=${3:-VERSION_STRING}
-
-git_version_id=""
-if [ -e "${source_path}/.git" ]; then
-    # Source Path is a git working copy. Check for local modifications.
-    # Note that git submodules may have a file as .git, not a directory.
-    export GIT_DIR="${source_path}/.git"
-    git_version_id=`git describe --match=v[0-9]* 2>/dev/null`
-fi
-
-changelog_version=""
-for p in "${source_path}" "${source_path}/.."; do
-    if [ -z "$git_version_id" -a -f "${p}/CHANGELOG" ]; then
-        changelog_version=`head -n1 "${p}/CHANGELOG" | awk '{print $2}'`
-        changelog_version="${changelog_version}"
-        break
-    fi
-done
-version_str="${changelog_version}${git_version_id}"
-bare_version=${version_str#v}
-major_version=${bare_version%%.*}
-bare_version=${bare_version#*.}
-minor_version=${bare_version%%.*}
-bare_version=${bare_version#*.}
-patch_version=${bare_version%%-*}
-bare_version=${bare_version#${patch_version}}
-extra_version=${bare_version##-}
-
-#since they'll be used as integers below make sure they are or force to 0
-for v in major_version minor_version patch_version; do
-    if eval echo \$$v |grep -E -q '[^[:digit:]]'; then
-        eval $v=0
-    fi
-done
-
-if [ ${bare} ]; then
-    echo "${changelog_version}${git_version_id}" > $$.tmp
-else
-    cat<<EOF>$$.tmp
-#define VERSION_MAJOR  $major_version
-#define VERSION_MINOR  $minor_version
-#define VERSION_PATCH  $patch_version
-#define VERSION_EXTRA  "$extra_version"
-#define VERSION_PACKED ((VERSION_MAJOR<<16)|(VERSION_MINOR<<8)|(VERSION_PATCH))
-#define ${id}_NOSP "${version_str}"
-#define ${id}      " ${version_str}"
-EOF
-fi
-if [ -n "$out_file" ]; then
-diff $$.tmp ${out_file} >/dev/null 2>&1 || cat $$.tmp > ${out_file}
-else
-cat $$.tmp
-fi
-rm $$.tmp
diff --git a/src/third_party/libvpx/configure b/src/third_party/libvpx/configure
deleted file mode 100755
index fb6dfca..0000000
--- a/src/third_party/libvpx/configure
+++ /dev/null
@@ -1,751 +0,0 @@
-#!/bin/sh
-##
-##  configure
-##
-##  This script is the front-end to the build system. It provides a similar
-##  interface to standard configure scripts with some extra bits for dealing
-##  with toolchains that differ from the standard POSIX interface and
-##  for extracting subsets of the source tree. In theory, reusable parts
-##  of this script were intended to live in build/make/configure.sh,
-##  but in practice, the line is pretty blurry.
-##
-##  This build system is based in part on the FFmpeg configure script.
-##
-
-#source_path="`dirname \"$0\"`"
-source_path=${0%/*}
-. "${source_path}/build/make/configure.sh"
-
-show_help(){
-    show_help_pre
-    cat << EOF
-Advanced options:
-  ${toggle_libs}                  libraries
-  ${toggle_examples}              examples
-  ${toggle_docs}                  documentation
-  ${toggle_unit_tests}            unit tests
-  ${toggle_decode_perf_tests}     build decoder perf tests with unit tests
-  ${toggle_encode_perf_tests}     build encoder perf tests with unit tests
-  --cpu=CPU                       tune for the specified CPU (ARM: cortex-a8, X86: sse3)
-  --libc=PATH                     path to alternate libc
-  --size-limit=WxH                max size to allow in the decoder
-  --as={yasm|nasm|auto}           use specified assembler [auto, yasm preferred]
-  --sdk-path=PATH                 path to root of sdk (android builds only)
-  ${toggle_codec_srcs}            in/exclude codec library source code
-  ${toggle_debug_libs}            in/exclude debug version of libraries
-  ${toggle_static_msvcrt}         use static MSVCRT (VS builds only)
-  ${toggle_vp9_highbitdepth}      use VP9 high bit depth (10/12) profiles
-  ${toggle_better_hw_compatibility}
-                                  enable encoder to produce streams with better
-                                  hardware decoder compatibility
-  ${toggle_vp8}                   VP8 codec support
-  ${toggle_vp9}                   VP9 codec support
-  ${toggle_vp10}                  VP10 codec support
-  ${toggle_internal_stats}        output of encoder internal stats for debug, if supported (encoders)
-  ${toggle_postproc}              postprocessing
-  ${toggle_vp9_postproc}          vp9 specific postprocessing
-  ${toggle_multithread}           multithreaded encoding and decoding
-  ${toggle_spatial_resampling}    spatial sampling (scaling) support
-  ${toggle_realtime_only}         enable this option while building for real-time encoding
-  ${toggle_onthefly_bitpacking}   enable on-the-fly bitpacking in real-time encoding
-  ${toggle_error_concealment}     enable this option to get a decoder which is able to conceal losses
-  ${toggle_coefficient_range_checking}
-                                  enable decoder to check if intermediate
-                                  transform coefficients are in valid range
-  ${toggle_runtime_cpu_detect}    runtime cpu detection
-  ${toggle_shared}                shared library support
-  ${toggle_static}                static library support
-  ${toggle_small}                 favor smaller size over speed
-  ${toggle_postproc_visualizer}   macro block / block level visualizers
-  ${toggle_multi_res_encoding}    enable multiple-resolution encoding
-  ${toggle_temporal_denoising}    enable temporal denoising and disable the spatial denoiser
-  ${toggle_vp9_temporal_denoising}
-                                  enable vp9 temporal denoising
-  ${toggle_webm_io}               enable input from and output to WebM container
-  ${toggle_libyuv}                enable libyuv
-
-Codecs:
-  Codecs can be selectively enabled or disabled individually, or by family:
-      --disable-<codec>
-  is equivalent to:
-      --disable-<codec>-encoder
-      --disable-<codec>-decoder
-
-  Codecs available in this distribution:
-EOF
-#restore editor state '
-
-    family="";
-    last_family="";
-    c="";
-    str="";
-    for c in ${CODECS}; do
-        family=${c%_*}
-        if [ "${family}" != "${last_family}" ]; then
-            [ -z "${str}" ] || echo "${str}"
-            str="$(printf '    %10s:' ${family})"
-        fi
-        str="${str} $(printf '%10s' ${c#*_})"
-        last_family=${family}
-    done
-    echo "${str}"
-    show_help_post
-}
-
-##
-## BEGIN APPLICATION SPECIFIC CONFIGURATION
-##
-
-# all_platforms is a list of all supported target platforms. Maintain
-# alphabetically by architecture, generic-gnu last.
-all_platforms="${all_platforms} armv6-linux-rvct"
-all_platforms="${all_platforms} armv6-linux-gcc"
-all_platforms="${all_platforms} armv6-none-rvct"
-all_platforms="${all_platforms} arm64-darwin-gcc"
-all_platforms="${all_platforms} arm64-linux-gcc"
-all_platforms="${all_platforms} armv7-android-gcc"   #neon Cortex-A8
-all_platforms="${all_platforms} armv7-darwin-gcc"    #neon Cortex-A8
-all_platforms="${all_platforms} armv7-linux-rvct"    #neon Cortex-A8
-all_platforms="${all_platforms} armv7-linux-gcc"     #neon Cortex-A8
-all_platforms="${all_platforms} armv7-none-rvct"     #neon Cortex-A8
-all_platforms="${all_platforms} armv7-win32-vs11"
-all_platforms="${all_platforms} armv7-win32-vs12"
-all_platforms="${all_platforms} armv7-win32-vs14"
-all_platforms="${all_platforms} armv7s-darwin-gcc"
-all_platforms="${all_platforms} mips32-linux-gcc"
-all_platforms="${all_platforms} mips64-linux-gcc"
-all_platforms="${all_platforms} sparc-solaris-gcc"
-all_platforms="${all_platforms} x86-android-gcc"
-all_platforms="${all_platforms} x86-darwin8-gcc"
-all_platforms="${all_platforms} x86-darwin8-icc"
-all_platforms="${all_platforms} x86-darwin9-gcc"
-all_platforms="${all_platforms} x86-darwin9-icc"
-all_platforms="${all_platforms} x86-darwin10-gcc"
-all_platforms="${all_platforms} x86-darwin11-gcc"
-all_platforms="${all_platforms} x86-darwin12-gcc"
-all_platforms="${all_platforms} x86-darwin13-gcc"
-all_platforms="${all_platforms} x86-darwin14-gcc"
-all_platforms="${all_platforms} x86-darwin15-gcc"
-all_platforms="${all_platforms} x86-iphonesimulator-gcc"
-all_platforms="${all_platforms} x86-linux-gcc"
-all_platforms="${all_platforms} x86-linux-icc"
-all_platforms="${all_platforms} x86-os2-gcc"
-all_platforms="${all_platforms} x86-solaris-gcc"
-all_platforms="${all_platforms} x86-win32-gcc"
-all_platforms="${all_platforms} x86-win32-vs7"
-all_platforms="${all_platforms} x86-win32-vs8"
-all_platforms="${all_platforms} x86-win32-vs9"
-all_platforms="${all_platforms} x86-win32-vs10"
-all_platforms="${all_platforms} x86-win32-vs11"
-all_platforms="${all_platforms} x86-win32-vs12"
-all_platforms="${all_platforms} x86-win32-vs14"
-all_platforms="${all_platforms} x86_64-android-gcc"
-all_platforms="${all_platforms} x86_64-darwin9-gcc"
-all_platforms="${all_platforms} x86_64-darwin10-gcc"
-all_platforms="${all_platforms} x86_64-darwin11-gcc"
-all_platforms="${all_platforms} x86_64-darwin12-gcc"
-all_platforms="${all_platforms} x86_64-darwin13-gcc"
-all_platforms="${all_platforms} x86_64-darwin14-gcc"
-all_platforms="${all_platforms} x86_64-darwin15-gcc"
-all_platforms="${all_platforms} x86_64-iphonesimulator-gcc"
-all_platforms="${all_platforms} x86_64-linux-gcc"
-all_platforms="${all_platforms} x86_64-linux-icc"
-all_platforms="${all_platforms} x86_64-orbis-clang"
-all_platforms="${all_platforms} x86_64-solaris-gcc"
-all_platforms="${all_platforms} x86_64-win64-gcc"
-all_platforms="${all_platforms} x86_64-win64-vs8"
-all_platforms="${all_platforms} x86_64-win64-vs9"
-all_platforms="${all_platforms} x86_64-win64-vs10"
-all_platforms="${all_platforms} x86_64-win64-vs11"
-all_platforms="${all_platforms} x86_64-win64-vs12"
-all_platforms="${all_platforms} x86_64-win64-vs14"
-all_platforms="${all_platforms} generic-gnu"
-
-# all_targets is a list of all targets that can be configured
-# note that these should be in dependency order for now.
-all_targets="libs examples docs"
-
-# all targets available are enabled, by default.
-for t in ${all_targets}; do
-    [ -f "${source_path}/${t}.mk" ] && enable_feature ${t}
-done
-
-if ! perl --version >/dev/null; then
-    die "Perl is required to build"
-fi
-
-
-if [ "`cd \"${source_path}\" && pwd`" != "`pwd`" ]; then
-  # test to see if source_path already configured
-  if [ -f "${source_path}/vpx_config.h" ]; then
-    die "source directory already configured; run 'make distclean' there first"
-  fi
-fi
-
-# check installed doxygen version
-doxy_version=$(doxygen --version 2>/dev/null)
-doxy_major=${doxy_version%%.*}
-if [ ${doxy_major:-0} -ge 1 ]; then
-    doxy_version=${doxy_version#*.}
-    doxy_minor=${doxy_version%%.*}
-    doxy_patch=${doxy_version##*.}
-
-    [ $doxy_major -gt 1 ] && enable_feature doxygen
-    [ $doxy_minor -gt 5 ] && enable_feature doxygen
-    [ $doxy_minor -eq 5 ] && [ $doxy_patch -ge 3 ] && enable_feature doxygen
-fi
-
-# disable codecs when their source directory does not exist
-[ -d "${source_path}/vp8" ] || disable_codec vp8
-[ -d "${source_path}/vp9" ] || disable_codec vp9
-[ -d "${source_path}/vp10" ] || disable_codec vp10
-
-# disable vp10 codec by default
-disable_codec vp10
-
-# install everything except the sources, by default. sources will have
-# to be enabled when doing dist builds, since that's no longer a common
-# case.
-enabled doxygen && enable_feature install_docs
-enable_feature install_bins
-enable_feature install_libs
-
-enable_feature static
-enable_feature optimizations
-enable_feature dependency_tracking
-enable_feature spatial_resampling
-enable_feature multithread
-enable_feature os_support
-enable_feature temporal_denoising
-
-CODECS="
-    vp8_encoder
-    vp8_decoder
-    vp9_encoder
-    vp9_decoder
-    vp10_encoder
-    vp10_decoder
-"
-CODEC_FAMILIES="
-    vp8
-    vp9
-    vp10
-"
-
-ARCH_LIST="
-    arm
-    mips
-    x86
-    x86_64
-"
-ARCH_EXT_LIST_X86="
-    mmx
-    sse
-    sse2
-    sse3
-    ssse3
-    sse4_1
-    avx
-    avx2
-"
-ARCH_EXT_LIST="
-    edsp
-    media
-    neon
-    neon_asm
-
-    mips32
-    dspr2
-    msa
-    mips64
-
-    ${ARCH_EXT_LIST_X86}
-"
-HAVE_LIST="
-    ${ARCH_EXT_LIST}
-    vpx_ports
-    pthread_h
-    unistd_h
-"
-EXPERIMENT_LIST="
-    spatial_svc
-    fp_mb_stats
-    emulate_hardware
-    misc_fixes
-"
-CONFIG_LIST="
-    dependency_tracking
-    external_build
-    install_docs
-    install_bins
-    install_libs
-    install_srcs
-    use_x86inc
-    debug
-    gprof
-    gcov
-    rvct
-    gcc
-    msvs
-    pic
-    big_endian
-
-    codec_srcs
-    debug_libs
-
-    dequant_tokens
-    dc_recon
-    runtime_cpu_detect
-    postproc
-    vp9_postproc
-    multithread
-    internal_stats
-    ${CODECS}
-    ${CODEC_FAMILIES}
-    encoders
-    decoders
-    static_msvcrt
-    spatial_resampling
-    realtime_only
-    onthefly_bitpacking
-    error_concealment
-    shared
-    static
-    small
-    postproc_visualizer
-    os_support
-    unit_tests
-    webm_io
-    libyuv
-    decode_perf_tests
-    encode_perf_tests
-    multi_res_encoding
-    temporal_denoising
-    vp9_temporal_denoising
-    coefficient_range_checking
-    vp9_highbitdepth
-    better_hw_compatibility
-    experimental
-    size_limit
-    ${EXPERIMENT_LIST}
-"
-CMDLINE_SELECT="
-    dependency_tracking
-    external_build
-    extra_warnings
-    werror
-    install_docs
-    install_bins
-    install_libs
-    install_srcs
-    debug
-    gprof
-    gcov
-    pic
-    use_x86inc
-    optimizations
-    ccache
-    runtime_cpu_detect
-    thumb
-
-    libs
-    examples
-    docs
-    libc
-    as
-    size_limit
-    codec_srcs
-    debug_libs
-
-    dequant_tokens
-    dc_recon
-    postproc
-    vp9_postproc
-    multithread
-    internal_stats
-    ${CODECS}
-    ${CODEC_FAMILIES}
-    static_msvcrt
-    spatial_resampling
-    realtime_only
-    onthefly_bitpacking
-    error_concealment
-    shared
-    static
-    small
-    postproc_visualizer
-    unit_tests
-    webm_io
-    libyuv
-    decode_perf_tests
-    encode_perf_tests
-    multi_res_encoding
-    temporal_denoising
-    vp9_temporal_denoising
-    coefficient_range_checking
-    better_hw_compatibility
-    vp9_highbitdepth
-    experimental
-"
-
-process_cmdline() {
-    for opt do
-        optval="${opt#*=}"
-        case "$opt" in
-        --disable-codecs)
-          for c in ${CODEC_FAMILIES}; do disable_codec $c; done
-          ;;
-        --enable-?*|--disable-?*)
-        eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
-        if is_in ${option} ${EXPERIMENT_LIST}; then
-            if enabled experimental; then
-                ${action}_feature $option
-            else
-                log_echo "Ignoring $opt -- not in experimental mode."
-            fi
-        elif is_in ${option} "${CODECS} ${CODEC_FAMILIES}"; then
-            ${action}_codec ${option}
-        else
-            process_common_cmdline $opt
-        fi
-        ;;
-        *) process_common_cmdline "$opt"
-        ;;
-        esac
-    done
-}
-
-post_process_cmdline() {
-    c=""
-
-    # Enable all detected codecs, if they haven't been disabled
-    for c in ${CODECS}; do soft_enable $c; done
-
-    # Enable the codec family if any component of that family is enabled
-    for c in ${CODECS}; do
-        enabled $c && enable_feature ${c%_*}
-    done
-
-    # Set the {en,de}coders variable if any algorithm in that class is enabled
-    for c in ${CODECS}; do
-        enabled ${c} && enable_feature ${c##*_}s
-    done
-}
-
-
-process_targets() {
-    enabled child || write_common_config_banner
-    write_common_target_config_h ${BUILD_PFX}vpx_config.h
-    write_common_config_targets
-
-    # Calculate the default distribution name, based on the enabled features
-    cf=""
-    DIST_DIR=vpx
-    for cf in $CODEC_FAMILIES; do
-        if enabled ${cf}_encoder && enabled ${cf}_decoder; then
-            DIST_DIR="${DIST_DIR}-${cf}"
-        elif enabled ${cf}_encoder; then
-            DIST_DIR="${DIST_DIR}-${cf}cx"
-        elif enabled ${cf}_decoder; then
-            DIST_DIR="${DIST_DIR}-${cf}dx"
-        fi
-    done
-    enabled debug_libs && DIST_DIR="${DIST_DIR}-debug"
-    enabled codec_srcs && DIST_DIR="${DIST_DIR}-src"
-    ! enabled postproc && ! enabled vp9_postproc && DIST_DIR="${DIST_DIR}-nopost"
-    ! enabled multithread && DIST_DIR="${DIST_DIR}-nomt"
-    ! enabled install_docs && DIST_DIR="${DIST_DIR}-nodocs"
-    DIST_DIR="${DIST_DIR}-${tgt_isa}-${tgt_os}"
-    case "${tgt_os}" in
-    win*) enabled static_msvcrt && DIST_DIR="${DIST_DIR}mt" || DIST_DIR="${DIST_DIR}md"
-          DIST_DIR="${DIST_DIR}-${tgt_cc}"
-          ;;
-    esac
-    if [ -f "${source_path}/build/make/version.sh" ]; then
-        ver=`"$source_path/build/make/version.sh" --bare "$source_path"`
-        DIST_DIR="${DIST_DIR}-${ver}"
-        VERSION_STRING=${ver}
-        ver=${ver%%-*}
-        VERSION_PATCH=${ver##*.}
-        ver=${ver%.*}
-        VERSION_MINOR=${ver##*.}
-        ver=${ver#v}
-        VERSION_MAJOR=${ver%.*}
-    fi
-    enabled child || cat <<EOF >> config.mk
-
-PREFIX=${prefix}
-ifeq (\$(MAKECMDGOALS),dist)
-DIST_DIR?=${DIST_DIR}
-else
-DIST_DIR?=\$(DESTDIR)${prefix}
-endif
-LIBSUBDIR=${libdir##${prefix}/}
-
-VERSION_STRING=${VERSION_STRING}
-
-VERSION_MAJOR=${VERSION_MAJOR}
-VERSION_MINOR=${VERSION_MINOR}
-VERSION_PATCH=${VERSION_PATCH}
-
-CONFIGURE_ARGS=${CONFIGURE_ARGS}
-EOF
-    enabled child || echo "CONFIGURE_ARGS?=${CONFIGURE_ARGS}" >> config.mk
-
-    #
-    # Write makefiles for all enabled targets
-    #
-    for tgt in libs examples docs solution; do
-        tgt_fn="$tgt-$toolchain.mk"
-
-        if enabled $tgt; then
-            echo "Creating makefiles for ${toolchain} ${tgt}"
-            write_common_target_config_mk $tgt_fn ${BUILD_PFX}vpx_config.h
-            #write_${tgt}_config
-        fi
-    done
-
-}
-
-process_detect() {
-    if enabled shared; then
-        # Can only build shared libs on a subset of platforms. Doing this check
-        # here rather than at option parse time because the target auto-detect
-        # magic happens after the command line has been parsed.
-        case "${tgt_os}" in
-        linux|os2|darwin*|iphonesimulator*)
-            # Supported platforms
-            ;;
-        *)
-            if enabled gnu; then
-                echo "--enable-shared is only supported on ELF; assuming this is OK"
-            else
-                die "--enable-shared only supported on ELF, OS/2, and Darwin for now"
-            fi
-            ;;
-        esac
-    fi
-    if [ -z "$CC" ] || enabled external_build; then
-        echo "Bypassing toolchain for environment detection."
-        enable_feature external_build
-        check_header() {
-            log fake_check_header "$@"
-            header=$1
-            shift
-            var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
-            disable_feature $var
-            # Headers common to all environments
-            case $header in
-                stdio.h)
-                    true;
-                ;;
-                *)
-                    result=false
-                    for d in "$@"; do
-                        [ -f "${d##-I}/$header" ] && result=true && break
-                    done
-                    ${result:-true}
-            esac && enable_feature $var
-
-            # Specialize windows and POSIX environments.
-            case $toolchain in
-                *-win*-*)
-                    # Don't check for any headers in Windows builds.
-                    false
-                ;;
-                *)
-                    case $header in
-                        pthread.h) true;;
-                        unistd.h) true;;
-                        *) false;;
-                    esac && enable_feature $var
-            esac
-            enabled $var
-        }
-        check_ld() {
-            true
-        }
-    fi
-    check_header stdio.h || die "Unable to invoke compiler: ${CC} ${CFLAGS}"
-    check_ld <<EOF || die "Toolchain is unable to link executables"
-int main(void) {return 0;}
-EOF
-    # check system headers
-    check_header pthread.h
-    check_header unistd.h # for sysconf(3) and friends.
-
-    check_header vpx/vpx_integer.h -I${source_path} && enable_feature vpx_ports
-}
-
-process_toolchain() {
-    process_common_toolchain
-
-    # Enable some useful compiler flags
-    if enabled gcc; then
-        enabled werror && check_add_cflags -Werror
-        check_add_cflags -Wall
-        check_add_cflags -Wdeclaration-after-statement
-        check_add_cflags -Wdisabled-optimization
-        check_add_cflags -Wpointer-arith
-        check_add_cflags -Wtype-limits
-        check_add_cflags -Wcast-qual
-        check_add_cflags -Wvla
-        check_add_cflags -Wimplicit-function-declaration
-        check_add_cflags -Wuninitialized
-        check_add_cflags -Wunused-variable
-        case ${CC} in
-          *clang*)
-              # libvpx and/or clang have issues with aliasing:
-              # https://code.google.com/p/webm/issues/detail?id=603
-              # work around them until they are fixed
-              check_add_cflags -fno-strict-aliasing
-          ;;
-          *) check_add_cflags -Wunused-but-set-variable ;;
-        esac
-        if enabled mips || [ -z "${INLINE}" ]; then
-          enabled extra_warnings || check_add_cflags -Wno-unused-function
-        else
-          check_add_cflags -Wunused-function
-        fi
-    fi
-
-    if enabled icc; then
-        enabled werror && check_add_cflags -Werror
-        check_add_cflags -Wall
-        check_add_cflags -Wpointer-arith
-
-        # ICC has a number of floating point optimizations that we disable
-        # in favor of deterministic output WRT to other compilers
-        add_cflags -fp-model precise
-    fi
-
-    # Enable extra, harmless warnings. These might provide additional insight
-    # to what the compiler is doing and why, but in general, but they shouldn't
-    # be treated as fatal, even if we're treating warnings as errors.
-    GCC_EXTRA_WARNINGS="
-        -Wdisabled-optimization
-        -Winline
-    "
-    enabled gcc && EXTRA_WARNINGS="${GCC_EXTRA_WARNINGS}"
-    RVCT_EXTRA_WARNINGS="
-        --remarks
-    "
-    enabled rvct && EXTRA_WARNINGS="${RVCT_EXTRA_WARNINGS}"
-    if enabled extra_warnings; then
-        for w in ${EXTRA_WARNINGS}; do
-            check_add_cflags ${w}
-            enabled gcc && enabled werror && check_add_cflags -Wno-error=${w}
-        done
-    fi
-
-    # ccache only really works on gcc toolchains
-    enabled gcc || soft_disable ccache
-    if enabled mips; then
-        enable_feature dequant_tokens
-        enable_feature dc_recon
-    fi
-
-    if enabled internal_stats; then
-        enable_feature vp9_postproc
-    fi
-
-    # Enable the postbuild target if building for visual studio.
-    case "$tgt_cc" in
-        vs*) enable_feature msvs
-             enable_feature solution
-             vs_version=${tgt_cc##vs}
-             case $vs_version in
-             [789])
-                 VCPROJ_SFX=vcproj
-                 gen_vcproj_cmd=${source_path}/build/make/gen_msvs_proj.sh
-                 ;;
-             10|11|12|14)
-                 VCPROJ_SFX=vcxproj
-                 gen_vcproj_cmd=${source_path}/build/make/gen_msvs_vcxproj.sh
-                 enabled werror && gen_vcproj_cmd="${gen_vcproj_cmd} --enable-werror"
-                 ;;
-             esac
-             all_targets="${all_targets} solution"
-             INLINE="__forceinline"
-        ;;
-    esac
-
-    # Other toolchain specific defaults
-    case $toolchain in x86*) soft_enable postproc;; esac
-
-    if enabled postproc_visualizer; then
-        enabled postproc || die "postproc_visualizer requires postproc to be enabled"
-    fi
-
-    # Enable unit tests by default if we have a working C++ compiler.
-    case "$toolchain" in
-        *-vs*)
-            soft_enable unit_tests
-            soft_enable webm_io
-            soft_enable libyuv
-        ;;
-        *-android-*)
-            soft_enable webm_io
-            soft_enable libyuv
-            # GTestLog must be modified to use Android logging utilities.
-        ;;
-        *-darwin-*)
-            # iOS/ARM builds do not work with gtest. This does not match
-            # x86 targets.
-        ;;
-        *-iphonesimulator-*)
-            soft_enable webm_io
-            soft_enable libyuv
-        ;;
-        *-win*)
-            # Some mingw toolchains don't have pthread available by default.
-            # Treat these more like visual studio where threading in gtest
-            # would be disabled for the same reason.
-            check_cxx "$@" <<EOF && soft_enable unit_tests
-int z;
-EOF
-            check_cxx "$@" <<EOF && soft_enable webm_io
-int z;
-EOF
-            check_cxx "$@" <<EOF && soft_enable libyuv
-int z;
-EOF
-        ;;
-        *)
-            enabled pthread_h && check_cxx "$@" <<EOF && soft_enable unit_tests
-int z;
-EOF
-            check_cxx "$@" <<EOF && soft_enable webm_io
-int z;
-EOF
-            check_cxx "$@" <<EOF && soft_enable libyuv
-int z;
-EOF
-        ;;
-    esac
-    # libwebm needs to be linked with C++ standard library
-    enabled webm_io && LD=${CXX}
-
-    # append any user defined extra cflags
-    if [ -n "${extra_cflags}" ] ; then
-        check_add_cflags ${extra_cflags} || \
-        die "Requested extra CFLAGS '${extra_cflags}' not supported by compiler"
-    fi
-    if [ -n "${extra_cxxflags}" ]; then
-        check_add_cxxflags ${extra_cxxflags} || \
-        die "Requested extra CXXFLAGS '${extra_cxxflags}' not supported by compiler"
-    fi
-}
-
-
-##
-## END APPLICATION SPECIFIC CONFIGURATION
-##
-CONFIGURE_ARGS="$@"
-process "$@"
-print_webm_license ${BUILD_PFX}vpx_config.c "/*" " */"
-cat <<EOF >> ${BUILD_PFX}vpx_config.c
-#include "vpx/vpx_codec.h"
-static const char* const cfg = "$CONFIGURE_ARGS";
-const char *vpx_codec_build_config(void) {return cfg;}
-EOF
diff --git a/src/third_party/libvpx/docs.mk b/src/third_party/libvpx/docs.mk
deleted file mode 100644
index 889d182..0000000
--- a/src/third_party/libvpx/docs.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-##
-##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-
-INSTALL_MAPS += docs/%    docs/%
-INSTALL_MAPS += src/%     %
-INSTALL_MAPS += %         %
-
-# Static documentation authored in doxygen
-CODEC_DOX :=    mainpage.dox \
-		keywords.dox \
-		usage.dox \
-		usage_cx.dox \
-		usage_dx.dox \
-
-# Other doxy files sourced in Markdown
-TXT_DOX = $(call enabled,TXT_DOX)
-
-EXAMPLE_PATH += $(SRC_PATH_BARE) #for CHANGELOG, README, etc
-EXAMPLE_PATH += $(SRC_PATH_BARE)/examples
-
-doxyfile: $(if $(findstring examples, $(ALL_TARGETS)),examples.doxy)
-doxyfile: libs.doxy_template libs.doxy
-	@echo "    [CREATE] $@"
-	@cat $^ > $@
-	@echo "STRIP_FROM_PATH += $(SRC_PATH_BARE) $(BUILD_ROOT)" >> $@
-	@echo "INPUT += $(addprefix $(SRC_PATH_BARE)/,$(CODEC_DOX))" >> $@;
-	@echo "INPUT += $(TXT_DOX)" >> $@;
-	@echo "EXAMPLE_PATH += $(EXAMPLE_PATH)" >> $@
-
-CLEAN-OBJS += doxyfile $(wildcard docs/html/*)
-docs/html/index.html: doxyfile $(CODEC_DOX) $(TXT_DOX)
-	@echo "    [DOXYGEN] $<"
-	@doxygen $<
-DOCS-yes += docs/html/index.html
-
-DIST-DOCS-yes = $(wildcard docs/html/*)
-DIST-DOCS-$(CONFIG_CODEC_SRCS) += $(addprefix src/,$(CODEC_DOX))
-DIST-DOCS-$(CONFIG_CODEC_SRCS) += src/libs.doxy_template
-DIST-DOCS-yes                  += CHANGELOG
-DIST-DOCS-yes                  += README
diff --git a/src/third_party/libvpx/examples.mk b/src/third_party/libvpx/examples.mk
deleted file mode 100644
index c891a54..0000000
--- a/src/third_party/libvpx/examples.mk
+++ /dev/null
@@ -1,393 +0,0 @@
-##
-##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-##
-##  Use of this source code is governed by a BSD-style license
-##  that can be found in the LICENSE file in the root of the source
-##  tree. An additional intellectual property rights grant can be found
-##  in the file PATENTS.  All contributing project authors may
-##  be found in the AUTHORS file in the root of the source tree.
-##
-
-LIBYUV_SRCS +=  third_party/libyuv/include/libyuv/basic_types.h  \
-                third_party/libyuv/include/libyuv/convert.h \
-                third_party/libyuv/include/libyuv/convert_argb.h \
-                third_party/libyuv/include/libyuv/convert_from.h \
-                third_party/libyuv/include/libyuv/cpu_id.h  \
-                third_party/libyuv/include/libyuv/planar_functions.h  \
-                third_party/libyuv/include/libyuv/rotate.h  \
-                third_party/libyuv/include/libyuv/row.h  \
-                third_party/libyuv/include/libyuv/scale.h  \
-                third_party/libyuv/include/libyuv/scale_row.h  \
-                third_party/libyuv/source/cpu_id.cc \
-                third_party/libyuv/source/planar_functions.cc \
-                third_party/libyuv/source/row_any.cc \
-                third_party/libyuv/source/row_common.cc \
-                third_party/libyuv/source/row_gcc.cc \
-                third_party/libyuv/source/row_mips.cc \
-                third_party/libyuv/source/row_neon.cc \
-                third_party/libyuv/source/row_neon64.cc \
-                third_party/libyuv/source/row_win.cc \
-                third_party/libyuv/source/scale.cc \
-                third_party/libyuv/source/scale_any.cc \
-                third_party/libyuv/source/scale_common.cc \
-                third_party/libyuv/source/scale_gcc.cc \
-                third_party/libyuv/source/scale_mips.cc \
-                third_party/libyuv/source/scale_neon.cc \
-                third_party/libyuv/source/scale_neon64.cc \
-                third_party/libyuv/source/scale_win.cc \
-
-LIBWEBM_COMMON_SRCS += third_party/libwebm/common/hdr_util.cc \
-                       third_party/libwebm/common/hdr_util.h \
-                       third_party/libwebm/common/webmids.h
-
-LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer/mkvmuxer.cc \
-                      third_party/libwebm/mkvmuxer/mkvmuxerutil.cc \
-                      third_party/libwebm/mkvmuxer/mkvwriter.cc \
-                      third_party/libwebm/mkvmuxer/mkvmuxer.h \
-                      third_party/libwebm/mkvmuxer/mkvmuxertypes.h \
-                      third_party/libwebm/mkvmuxer/mkvmuxerutil.h \
-                      third_party/libwebm/mkvparser/mkvparser.h \
-                      third_party/libwebm/mkvmuxer/mkvwriter.h
-
-LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser/mkvparser.cc \
-                      third_party/libwebm/mkvparser/mkvreader.cc \
-                      third_party/libwebm/mkvparser/mkvparser.h \
-                      third_party/libwebm/mkvparser/mkvreader.h
-
-# Add compile flags and include path for libwebm sources.
-ifeq ($(CONFIG_WEBM_IO),yes)
-  CXXFLAGS     += -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
-  INC_PATH-yes += $(SRC_PATH_BARE)/third_party/libwebm
-endif
-
-
-# List of examples to build. UTILS are tools meant for distribution
-# while EXAMPLES demonstrate specific portions of the API.
-UTILS-$(CONFIG_DECODERS)    += vpxdec.c
-vpxdec.SRCS                 += md5_utils.c md5_utils.h
-vpxdec.SRCS                 += vpx_ports/mem_ops.h
-vpxdec.SRCS                 += vpx_ports/mem_ops_aligned.h
-vpxdec.SRCS                 += vpx_ports/msvc.h
-vpxdec.SRCS                 += vpx_ports/vpx_timer.h
-vpxdec.SRCS                 += vpx/vpx_integer.h
-vpxdec.SRCS                 += args.c args.h
-vpxdec.SRCS                 += ivfdec.c ivfdec.h
-vpxdec.SRCS                 += tools_common.c tools_common.h
-vpxdec.SRCS                 += y4menc.c y4menc.h
-ifeq ($(CONFIG_LIBYUV),yes)
-  vpxdec.SRCS                 += $(LIBYUV_SRCS)
-endif
-ifeq ($(CONFIG_WEBM_IO),yes)
-  vpxdec.SRCS                 += $(LIBWEBM_COMMON_SRCS)
-  vpxdec.SRCS                 += $(LIBWEBM_MUXER_SRCS)
-  vpxdec.SRCS                 += $(LIBWEBM_PARSER_SRCS)
-  vpxdec.SRCS                 += webmdec.cc webmdec.h
-endif
-vpxdec.GUID                  = BA5FE66F-38DD-E034-F542-B1578C5FB950
-vpxdec.DESCRIPTION           = Full featured decoder
-UTILS-$(CONFIG_ENCODERS)    += vpxenc.c
-vpxenc.SRCS                 += args.c args.h y4minput.c y4minput.h vpxenc.h
-vpxenc.SRCS                 += ivfdec.c ivfdec.h
-vpxenc.SRCS                 += ivfenc.c ivfenc.h
-vpxenc.SRCS                 += rate_hist.c rate_hist.h
-vpxenc.SRCS                 += tools_common.c tools_common.h
-vpxenc.SRCS                 += warnings.c warnings.h
-vpxenc.SRCS                 += vpx_ports/mem_ops.h
-vpxenc.SRCS                 += vpx_ports/mem_ops_aligned.h
-vpxenc.SRCS                 += vpx_ports/msvc.h
-vpxenc.SRCS                 += vpx_ports/vpx_timer.h
-vpxenc.SRCS                 += vpxstats.c vpxstats.h
-ifeq ($(CONFIG_LIBYUV),yes)
-  vpxenc.SRCS                 += $(LIBYUV_SRCS)
-endif
-ifeq ($(CONFIG_WEBM_IO),yes)
-  vpxenc.SRCS                 += $(LIBWEBM_COMMON_SRCS)
-  vpxenc.SRCS                 += $(LIBWEBM_MUXER_SRCS)
-  vpxenc.SRCS                 += $(LIBWEBM_PARSER_SRCS)
-  vpxenc.SRCS                 += webmenc.cc webmenc.h
-endif
-vpxenc.GUID                  = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1
-vpxenc.DESCRIPTION           = Full featured encoder
-ifeq ($(CONFIG_SPATIAL_SVC),yes)
-  EXAMPLES-$(CONFIG_VP9_ENCODER)      += vp9_spatial_svc_encoder.c
-  vp9_spatial_svc_encoder.SRCS        += args.c args.h
-  vp9_spatial_svc_encoder.SRCS        += ivfenc.c ivfenc.h
-  vp9_spatial_svc_encoder.SRCS        += tools_common.c tools_common.h
-  vp9_spatial_svc_encoder.SRCS        += video_common.h
-  vp9_spatial_svc_encoder.SRCS        += video_writer.h video_writer.c
-  vp9_spatial_svc_encoder.SRCS        += vpx_ports/msvc.h
-  vp9_spatial_svc_encoder.SRCS        += vpxstats.c vpxstats.h
-  vp9_spatial_svc_encoder.GUID        = 4A38598D-627D-4505-9C7B-D4020C84100D
-  vp9_spatial_svc_encoder.DESCRIPTION = VP9 Spatial SVC Encoder
-endif
-
-ifneq ($(CONFIG_SHARED),yes)
-EXAMPLES-$(CONFIG_VP9_ENCODER)    += resize_util.c
-endif
-
-EXAMPLES-$(CONFIG_ENCODERS)          += vpx_temporal_svc_encoder.c
-vpx_temporal_svc_encoder.SRCS        += ivfenc.c ivfenc.h
-vpx_temporal_svc_encoder.SRCS        += tools_common.c tools_common.h
-vpx_temporal_svc_encoder.SRCS        += video_common.h
-vpx_temporal_svc_encoder.SRCS        += video_writer.h video_writer.c
-vpx_temporal_svc_encoder.SRCS        += vpx_ports/msvc.h
-vpx_temporal_svc_encoder.GUID        = B18C08F2-A439-4502-A78E-849BE3D60947
-vpx_temporal_svc_encoder.DESCRIPTION = Temporal SVC Encoder
-EXAMPLES-$(CONFIG_DECODERS)        += simple_decoder.c
-simple_decoder.GUID                 = D3BBF1E9-2427-450D-BBFF-B2843C1D44CC
-simple_decoder.SRCS                += ivfdec.h ivfdec.c
-simple_decoder.SRCS                += tools_common.h tools_common.c
-simple_decoder.SRCS                += video_common.h
-simple_decoder.SRCS                += video_reader.h video_reader.c
-simple_decoder.SRCS                += vpx_ports/mem_ops.h
-simple_decoder.SRCS                += vpx_ports/mem_ops_aligned.h
-simple_decoder.SRCS                += vpx_ports/msvc.h
-simple_decoder.DESCRIPTION          = Simplified decoder loop
-EXAMPLES-$(CONFIG_DECODERS)        += postproc.c
-postproc.SRCS                      += ivfdec.h ivfdec.c
-postproc.SRCS                      += tools_common.h tools_common.c
-postproc.SRCS                      += video_common.h
-postproc.SRCS                      += video_reader.h video_reader.c
-postproc.SRCS                      += vpx_ports/mem_ops.h
-postproc.SRCS                      += vpx_ports/mem_ops_aligned.h
-postproc.SRCS                      += vpx_ports/msvc.h
-postproc.GUID                       = 65E33355-F35E-4088-884D-3FD4905881D7
-postproc.DESCRIPTION                = Decoder postprocessor control
-EXAMPLES-$(CONFIG_DECODERS)        += decode_to_md5.c
-decode_to_md5.SRCS                 += md5_utils.h md5_utils.c
-decode_to_md5.SRCS                 += ivfdec.h ivfdec.c
-decode_to_md5.SRCS                 += tools_common.h tools_common.c
-decode_to_md5.SRCS                 += video_common.h
-decode_to_md5.SRCS                 += video_reader.h video_reader.c
-decode_to_md5.SRCS                 += vpx_ports/mem_ops.h
-decode_to_md5.SRCS                 += vpx_ports/mem_ops_aligned.h
-decode_to_md5.SRCS                 += vpx_ports/msvc.h
-decode_to_md5.GUID                  = 59120B9B-2735-4BFE-B022-146CA340FE42
-decode_to_md5.DESCRIPTION           = Frame by frame MD5 checksum
-EXAMPLES-$(CONFIG_ENCODERS)     += simple_encoder.c
-simple_encoder.SRCS             += ivfenc.h ivfenc.c
-simple_encoder.SRCS             += tools_common.h tools_common.c
-simple_encoder.SRCS             += video_common.h
-simple_encoder.SRCS             += video_writer.h video_writer.c
-simple_encoder.SRCS             += vpx_ports/msvc.h
-simple_encoder.GUID              = 4607D299-8A71-4D2C-9B1D-071899B6FBFD
-simple_encoder.DESCRIPTION       = Simplified encoder loop
-EXAMPLES-$(CONFIG_VP9_ENCODER)  += vp9_lossless_encoder.c
-vp9_lossless_encoder.SRCS       += ivfenc.h ivfenc.c
-vp9_lossless_encoder.SRCS       += tools_common.h tools_common.c
-vp9_lossless_encoder.SRCS       += video_common.h
-vp9_lossless_encoder.SRCS       += video_writer.h video_writer.c
-vp9_lossless_encoder.SRCS       += vpx_ports/msvc.h
-vp9_lossless_encoder.GUID        = B63C7C88-5348-46DC-A5A6-CC151EF93366
-vp9_lossless_encoder.DESCRIPTION = Simplified lossless VP9 encoder
-EXAMPLES-$(CONFIG_ENCODERS)     += twopass_encoder.c
-twopass_encoder.SRCS            += ivfenc.h ivfenc.c
-twopass_encoder.SRCS            += tools_common.h tools_common.c
-twopass_encoder.SRCS            += video_common.h
-twopass_encoder.SRCS            += video_writer.h video_writer.c
-twopass_encoder.SRCS            += vpx_ports/msvc.h
-twopass_encoder.GUID             = 73494FA6-4AF9-4763-8FBB-265C92402FD8
-twopass_encoder.DESCRIPTION      = Two-pass encoder loop
-EXAMPLES-$(CONFIG_DECODERS)     += decode_with_drops.c
-decode_with_drops.SRCS          += ivfdec.h ivfdec.c
-decode_with_drops.SRCS          += tools_common.h tools_common.c
-decode_with_drops.SRCS          += video_common.h
-decode_with_drops.SRCS          += video_reader.h video_reader.c
-decode_with_drops.SRCS          += vpx_ports/mem_ops.h
-decode_with_drops.SRCS          += vpx_ports/mem_ops_aligned.h
-decode_with_drops.SRCS          += vpx_ports/msvc.h
-decode_with_drops.GUID           = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26
-decode_with_drops.DESCRIPTION    = Drops frames while decoding
-EXAMPLES-$(CONFIG_ENCODERS)        += set_maps.c
-set_maps.SRCS                      += ivfenc.h ivfenc.c
-set_maps.SRCS                      += tools_common.h tools_common.c
-set_maps.SRCS                      += video_common.h
-set_maps.SRCS                      += video_writer.h video_writer.c
-set_maps.SRCS                      += vpx_ports/msvc.h
-set_maps.GUID                       = ECB2D24D-98B8-4015-A465-A4AF3DCC145F
-set_maps.DESCRIPTION                = Set active and ROI maps
-EXAMPLES-$(CONFIG_VP8_ENCODER)     += vp8cx_set_ref.c
-vp8cx_set_ref.SRCS                 += ivfenc.h ivfenc.c
-vp8cx_set_ref.SRCS                 += tools_common.h tools_common.c
-vp8cx_set_ref.SRCS                 += video_common.h
-vp8cx_set_ref.SRCS                 += video_writer.h video_writer.c
-vp8cx_set_ref.SRCS                 += vpx_ports/msvc.h
-vp8cx_set_ref.GUID                  = C5E31F7F-96F6-48BD-BD3E-10EBF6E8057A
-vp8cx_set_ref.DESCRIPTION           = VP8 set encoder reference frame
-
-
-ifeq ($(CONFIG_MULTI_RES_ENCODING),yes)
-ifeq ($(CONFIG_LIBYUV),yes)
-EXAMPLES-$(CONFIG_VP8_ENCODER)          += vp8_multi_resolution_encoder.c
-vp8_multi_resolution_encoder.SRCS       += ivfenc.h ivfenc.c
-vp8_multi_resolution_encoder.SRCS       += tools_common.h tools_common.c
-vp8_multi_resolution_encoder.SRCS       += video_writer.h video_writer.c
-vp8_multi_resolution_encoder.SRCS       += vpx_ports/msvc.h
-vp8_multi_resolution_encoder.SRCS       += $(LIBYUV_SRCS)
-vp8_multi_resolution_encoder.GUID        = 04f8738e-63c8-423b-90fa-7c2703a374de
-vp8_multi_resolution_encoder.DESCRIPTION = VP8 Multiple-resolution Encoding
-endif
-endif
-
-# Handle extra library flags depending on codec configuration
-
-# We should not link to math library (libm) on RVCT
-# when building for bare-metal targets
-ifeq ($(CONFIG_OS_SUPPORT), yes)
-CODEC_EXTRA_LIBS-$(CONFIG_VP8)         += m
-CODEC_EXTRA_LIBS-$(CONFIG_VP9)         += m
-else
-    ifeq ($(CONFIG_GCC), yes)
-    CODEC_EXTRA_LIBS-$(CONFIG_VP8)         += m
-    CODEC_EXTRA_LIBS-$(CONFIG_VP9)         += m
-    endif
-endif
-#
-# End of specified files. The rest of the build rules should happen
-# automagically from here.
-#
-
-
-# Examples need different flags based on whether we're building
-# from an installed tree or a version controlled tree. Determine
-# the proper paths.
-ifeq ($(HAVE_ALT_TREE_LAYOUT),yes)
-    LIB_PATH-yes := $(SRC_PATH_BARE)/../lib
-    INC_PATH-yes := $(SRC_PATH_BARE)/../include
-else
-    LIB_PATH-yes                     += $(if $(BUILD_PFX),$(BUILD_PFX),.)
-    INC_PATH-$(CONFIG_VP8_DECODER)   += $(SRC_PATH_BARE)/vp8
-    INC_PATH-$(CONFIG_VP8_ENCODER)   += $(SRC_PATH_BARE)/vp8
-    INC_PATH-$(CONFIG_VP9_DECODER)   += $(SRC_PATH_BARE)/vp9
-    INC_PATH-$(CONFIG_VP9_ENCODER)   += $(SRC_PATH_BARE)/vp9
-endif
-INC_PATH-$(CONFIG_LIBYUV) += $(SRC_PATH_BARE)/third_party/libyuv/include
-LIB_PATH := $(call enabled,LIB_PATH)
-INC_PATH := $(call enabled,INC_PATH)
-INTERNAL_CFLAGS = $(addprefix -I,$(INC_PATH))
-INTERNAL_LDFLAGS += $(addprefix -L,$(LIB_PATH))
-
-
-# Expand list of selected examples to build (as specified above)
-UTILS           = $(call enabled,UTILS)
-EXAMPLES        = $(addprefix examples/,$(call enabled,EXAMPLES))
-ALL_EXAMPLES    = $(UTILS) $(EXAMPLES)
-UTIL_SRCS       = $(foreach ex,$(UTILS),$($(ex:.c=).SRCS))
-ALL_SRCS        = $(foreach ex,$(ALL_EXAMPLES),$($(notdir $(ex:.c=)).SRCS))
-CODEC_EXTRA_LIBS=$(sort $(call enabled,CODEC_EXTRA_LIBS))
-
-
-# Expand all example sources into a variable containing all sources
-# for that example (not just them main one specified in UTILS/EXAMPLES)
-# and add this file to the list (for MSVS workspace generation)
-$(foreach ex,$(ALL_EXAMPLES),$(eval $(notdir $(ex:.c=)).SRCS += $(ex) examples.mk))
-
-
-# Create build/install dependencies for all examples. The common case
-# is handled here. The MSVS case is handled below.
-NOT_MSVS = $(if $(CONFIG_MSVS),,yes)
-DIST-BINS-$(NOT_MSVS)      += $(addprefix bin/,$(ALL_EXAMPLES:.c=$(EXE_SFX)))
-INSTALL-BINS-$(NOT_MSVS)   += $(addprefix bin/,$(UTILS:.c=$(EXE_SFX)))
-DIST-SRCS-yes              += $(ALL_SRCS)
-INSTALL-SRCS-yes           += $(UTIL_SRCS)
-OBJS-$(NOT_MSVS)           += $(call objs,$(ALL_SRCS))
-BINS-$(NOT_MSVS)           += $(addprefix $(BUILD_PFX),$(ALL_EXAMPLES:.c=$(EXE_SFX)))
-
-
-# Instantiate linker template for all examples.
-CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
-ifneq ($(filter darwin%,$(TGT_OS)),)
-SHARED_LIB_SUF=.dylib
-else
-ifneq ($(filter os2%,$(TGT_OS)),)
-SHARED_LIB_SUF=_dll.a
-else
-SHARED_LIB_SUF=.so
-endif
-endif
-CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
-$(foreach bin,$(BINS-yes),\
-    $(eval $(bin):$(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF))\
-    $(eval $(call linker_template,$(bin),\
-        $(call objs,$($(notdir $(bin:$(EXE_SFX)=)).SRCS)) \
-        -l$(CODEC_LIB) $(addprefix -l,$(CODEC_EXTRA_LIBS))\
-        )))
-
-# The following pairs define a mapping of locations in the distribution
-# tree to locations in the source/build trees.
-INSTALL_MAPS += src/%.c   %.c
-INSTALL_MAPS += src/%     $(SRC_PATH_BARE)/%
-INSTALL_MAPS += bin/%     %
-INSTALL_MAPS += %         %
-
-
-# Set up additional MSVS environment
-ifeq ($(CONFIG_MSVS),yes)
-CODEC_LIB=$(if $(CONFIG_SHARED),vpx,$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd))
-# This variable uses deferred expansion intentionally, since the results of
-# $(wildcard) may change during the course of the Make.
-VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d))))
-INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),bin/$(p)/%  $(p)/Release/%)
-endif
-
-# Build Visual Studio Projects. We use a template here to instantiate
-# explicit rules rather than using an implicit rule because we want to
-# leverage make's VPATH searching rather than specifying the paths on
-# each file in ALL_EXAMPLES. This has the unfortunate side effect that
-# touching the source files trigger a rebuild of the project files
-# even though there is no real dependency there (the dependency is on
-# the makefiles). We may want to revisit this.
-define vcproj_template
-$(1): $($(1:.$(VCPROJ_SFX)=).SRCS) vpx.$(VCPROJ_SFX)
-	$(if $(quiet),@echo "    [vcproj] $$@")
-	$(qexec)$$(GEN_VCPROJ)\
-            --exe\
-            --target=$$(TOOLCHAIN)\
-            --name=$$(@:.$(VCPROJ_SFX)=)\
-            --ver=$$(CONFIG_VS_VERSION)\
-            --proj-guid=$$($$(@:.$(VCPROJ_SFX)=).GUID)\
-            --src-path-bare="$(SRC_PATH_BARE)" \
-            $$(if $$(CONFIG_STATIC_MSVCRT),--static-crt) \
-            --out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \
-            $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -l$$(CODEC_LIB) $$^
-endef
-ALL_EXAMPLES_BASENAME := $(notdir $(ALL_EXAMPLES))
-PROJECTS-$(CONFIG_MSVS) += $(ALL_EXAMPLES_BASENAME:.c=.$(VCPROJ_SFX))
-INSTALL-BINS-$(CONFIG_MSVS) += $(foreach p,$(VS_PLATFORMS),\
-                               $(addprefix bin/$(p)/,$(ALL_EXAMPLES_BASENAME:.c=.exe)))
-$(foreach proj,$(call enabled,PROJECTS),\
-    $(eval $(call vcproj_template,$(proj))))
-
-#
-# Documentation Rules
-#
-%.dox: %.c
-	@echo "    [DOXY] $@"
-	@mkdir -p $(dir $@)
-	@echo "/*!\page example_$(@F:.dox=) $(@F:.dox=)" > $@
-	@echo "   \includelineno $(<F)" >> $@
-	@echo "*/" >> $@
-
-samples.dox: examples.mk
-	@echo "    [DOXY] $@"
-	@echo "/*!\page samples Sample Code" > $@
-	@echo "    This SDK includes a number of sample applications."\
-	      "Each sample documents a feature of the SDK in both prose"\
-	      "and the associated C code."\
-	      "The following samples are included: ">>$@
-	@$(foreach ex,$(sort $(notdir $(EXAMPLES:.c=))),\
-	   echo "     - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;)
-	@echo >> $@
-	@echo "    In addition, the SDK contains a number of utilities."\
-              "Since these utilities are built upon the concepts described"\
-              "in the sample code listed above, they are not documented in"\
-              "pieces like the samples are. Their source is included here"\
-              "for reference. The following utilities are included:" >> $@
-	@$(foreach ex,$(sort $(UTILS:.c=)),\
-	   echo "     - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;)
-	@echo "*/" >> $@
-
-CLEAN-OBJS += examples.doxy samples.dox $(ALL_EXAMPLES:.c=.dox)
-DOCS-yes += examples.doxy samples.dox
-examples.doxy: samples.dox $(ALL_EXAMPLES:.c=.dox)
-	@echo "INPUT += $^" > $@
diff --git a/src/third_party/libvpx/examples/decode_to_md5.c b/src/third_party/libvpx/examples/decode_to_md5.c
deleted file mode 100644
index 1ae7a4b..0000000
--- a/src/third_party/libvpx/examples/decode_to_md5.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-// Frame-by-frame MD5 Checksum
-// ===========================
-//
-// This example builds upon the simple decoder loop to show how checksums
-// of the decoded output can be generated. These are used for validating
-// decoder implementations against the reference implementation, for example.
-//
-// MD5 algorithm
-// -------------
-// The Message-Digest 5 (MD5) is a well known hash function. We have provided
-// an implementation derived from the RSA Data Security, Inc. MD5 Message-Digest
-// Algorithm for your use. Our implmentation only changes the interface of this
-// reference code. You must include the `md5_utils.h` header for access to these
-// functions.
-//
-// Processing The Decoded Data
-// ---------------------------
-// Each row of the image is passed to the MD5 accumulator. First the Y plane
-// is processed, then U, then V. It is important to honor the image's `stride`
-// values.
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "vpx/vp8dx.h"
-#include "vpx/vpx_decoder.h"
-
-#include "../md5_utils.h"
-#include "../tools_common.h"
-#include "../video_reader.h"
-#include "./vpx_config.h"
-
-static void get_image_md5(const vpx_image_t *img, unsigned char digest[16]) {
-  int plane, y;
-  MD5Context md5;
-
-  MD5Init(&md5);
-
-  for (plane = 0; plane < 3; ++plane) {
-    const unsigned char *buf = img->planes[plane];
-    const int stride = img->stride[plane];
-    const int w = plane ? (img->d_w + 1) >> 1 : img->d_w;
-    const int h = plane ? (img->d_h + 1) >> 1 : img->d_h;
-
-    for (y = 0; y < h; ++y) {
-      MD5Update(&md5, buf, w);
-      buf += stride;
-    }
-  }
-
-  MD5Final(digest, &md5);
-}
-
-static void print_md5(FILE *stream, unsigned char digest[16]) {
-  int i;
-
-  for (i = 0; i < 16; ++i)
-    fprintf(stream, "%02x", digest[i]);
-}
-
-static const char *exec_name;
-
-void usage_exit(void) {
-  fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
-  exit(EXIT_FAILURE);
-}
-
-int main(int argc, char **argv) {
-  int frame_cnt = 0;
-  FILE *outfile = NULL;
-  vpx_codec_ctx_t codec;
-  VpxVideoReader *reader = NULL;
-  const VpxVideoInfo *info = NULL;
-  const VpxInterface *decoder = NULL;
-
-  exec_name = argv[0];
-
-  if (argc != 3)
-    die("Invalid number of arguments.");
-
-  reader = vpx_video_reader_open(argv[1]);
-  if (!reader)
-    die("Failed to open %s for reading.", argv[1]);
-
-  if (!(outfile = fopen(argv[2], "wb")))
-    die("Failed to open %s for writing.", argv[2]);
-
-  info = vpx_video_reader_get_info(reader);
-
-  decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
-  if (!decoder)
-    die("Unknown input codec.");
-
-  printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
-
-  if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0))
-    die_codec(&codec, "Failed to initialize decoder");
-
-  while (vpx_video_reader_read_frame(reader)) {
-    vpx_codec_iter_t iter = NULL;
-    vpx_image_t *img = NULL;
-    size_t frame_size = 0;
-    const unsigned char *frame = vpx_video_reader_get_frame(reader,
-                                                            &frame_size);
-    if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0))
-      die_codec(&codec, "Failed to decode frame");
-
-    while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) {
-      unsigned char digest[16];
-
-      get_image_md5(img, digest);
-      print_md5(outfile, digest);
-      fprintf(outfile, "  img-%dx%d-%04d.i420\n",
-              img->d_w, img->d_h, ++frame_cnt);
-    }
-  }
-
-  printf("Processed %d frames.\n", frame_cnt);
-  if (vpx_codec_destroy(&codec))
-    die_codec(&codec, "Failed to destroy codec.");
-
-  vpx_video_reader_close(reader);
-
-  fclose(outfile);
-  return EXIT_SUCCESS;
-}
diff --git a/src/third_party/libvpx/examples/decode_with_drops.c b/src/third_party/libvpx/examples/decode_with_drops.c
deleted file mode 100644
index 2233e47..0000000
--- a/src/third_party/libvpx/examples/decode_with_drops.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-// Decode With Drops Example
-// =========================
-//
-// This is an example utility which drops a series of frames, as specified
-// on the command line. This is useful for observing the error recovery
-// features of the codec.
-//
-// Usage
-// -----
-// This example adds a single argument to the `simple_decoder` example,
-// which specifies the range or pattern of frames to drop. The parameter is
-// parsed as follows:
-//
-// Dropping A Range Of Frames
-// --------------------------
-// To drop a range of frames, specify the starting frame and the ending
-// frame to drop, separated by a dash. The following command will drop
-// frames 5 through 10 (base 1).
-//
-//  $ ./decode_with_drops in.ivf out.i420 5-10
-//
-//
-// Dropping A Pattern Of Frames
-// ----------------------------
-// To drop a pattern of frames, specify the number of frames to drop and
-// the number of frames after which to repeat the pattern, separated by
-// a forward-slash. The following command will drop 3 of 7 frames.
-// Specifically, it will decode 4 frames, then drop 3 frames, and then
-// repeat.
-//
-//  $ ./decode_with_drops in.ivf out.i420 3/7
-//
-//
-// Extra Variables
-// ---------------
-// This example maintains the pattern passed on the command line in the
-// `n`, `m`, and `is_range` variables:
-//
-//
-// Making The Drop Decision
-// ------------------------
-// The example decides whether to drop the frame based on the current
-// frame number, immediately before decoding the frame.
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "vpx/vp8dx.h"
-#include "vpx/vpx_decoder.h"
-
-#include "../tools_common.h"
-#include "../video_reader.h"
-#include "./vpx_config.h"
-
-static const char *exec_name;
-
-void usage_exit(void) {
-  fprintf(stderr, "Usage: %s <infile> <outfile> <N-M|N/M>\n", exec_name);
-  exit(EXIT_FAILURE);
-}
-
-int main(int argc, char **argv) {
-  int frame_cnt = 0;
-  FILE *outfile = NULL;
-  vpx_codec_ctx_t codec;
-  const VpxInterface *decoder = NULL;
-  VpxVideoReader *reader = NULL;
-  const VpxVideoInfo *info = NULL;
-  int n = 0;
-  int m = 0;
-  int is_range = 0;
-  char *nptr = NULL;
-
-  exec_name = argv[0];
-
-  if (argc != 4)
-    die("Invalid number of arguments.");
-
-  reader = vpx_video_reader_open(argv[1]);
-  if (!reader)
-    die("Failed to open %s for reading.", argv[1]);
-
-  if (!(outfile = fopen(argv[2], "wb")))
-    die("Failed to open %s for writing.", argv[2]);
-
-  n = strtol(argv[3], &nptr, 0);
-  m = strtol(nptr + 1, NULL, 0);
-  is_range = (*nptr == '-');
-  if (!n || !m || (*nptr != '-' && *nptr != '/'))
-    die("Couldn't parse pattern %s.\n", argv[3]);
-
-  info = vpx_video_reader_get_info(reader);
-
-  decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
-  if (!decoder)
-    die("Unknown input codec.");
-
-  printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
-
-  if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0))
-    die_codec(&codec, "Failed to initialize decoder.");
-
-  while (vpx_video_reader_read_frame(reader)) {
-    vpx_codec_iter_t iter = NULL;
-    vpx_image_t *img = NULL;
-    size_t frame_size = 0;
-    int skip;
-    const unsigned char *frame = vpx_video_reader_get_frame(reader,
-                                                            &frame_size);
-    if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0))
-      die_codec(&codec, "Failed to decode frame.");
-
-    ++frame_cnt;
-
-    skip = (is_range && frame_cnt >= n && frame_cnt <= m) ||
-           (!is_range && m - (frame_cnt - 1) % m <= n);
-
-    if (!skip) {
-      putc('.', stdout);
-
-      while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL)
-        vpx_img_write(img, outfile);
-    } else {
-      putc('X', stdout);
-    }
-
-    fflush(stdout);
-  }
-
-  printf("Processed %d frames.\n", frame_cnt);
-  if (vpx_codec_destroy(&codec))
-    die_codec(&codec, "Failed to destroy codec.");
-
-  printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n",
-         info->frame_width, info->frame_height, argv[2]);
-
-  vpx_video_reader_close(reader);
-  fclose(outfile);
-
-  return EXIT_SUCCESS;
-}
diff --git a/src/third_party/libvpx/examples/postproc.c b/src/third_party/libvpx/examples/postproc.c
deleted file mode 100644
index a8ac208..0000000
--- a/src/third_party/libvpx/examples/postproc.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-// Postprocessing Decoder
-// ======================
-//
-// This example adds postprocessing to the simple decoder loop.
-//
-// Initializing Postprocessing
-// ---------------------------
-// You must inform the codec that you might request postprocessing at
-// initialization time. This is done by passing the VPX_CODEC_USE_POSTPROC
-// flag to `vpx_codec_dec_init`. If the codec does not support
-// postprocessing, this call will return VPX_CODEC_INCAPABLE. For
-// demonstration purposes, we also fall back to default initialization if
-// the codec does not provide support.
-//
-// Using Adaptive Postprocessing
-// -----------------------------
-// VP6 provides "adaptive postprocessing." It will automatically select the
-// best postprocessing filter on a frame by frame basis based on the amount
-// of time remaining before the user's specified deadline expires. The
-// special value 0 indicates that the codec should take as long as
-// necessary to provide the best quality frame. This example gives the
-// codec 15ms (15000us) to return a frame. Remember that this is a soft
-// deadline, and the codec may exceed it doing its regular processing. In
-// these cases, no additional postprocessing will be done.
-//
-// Codec Specific Postprocessing Controls
-// --------------------------------------
-// Some codecs provide fine grained controls over their built-in
-// postprocessors. VP8 is one example. The following sample code toggles
-// postprocessing on and off every 15 frames.
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "vpx/vp8dx.h"
-#include "vpx/vpx_decoder.h"
-
-#include "../tools_common.h"
-#include "../video_reader.h"
-#include "./vpx_config.h"
-
-static const char *exec_name;
-
-void usage_exit(void) {
-  fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
-  exit(EXIT_FAILURE);
-}
-
-int main(int argc, char **argv) {
-  int frame_cnt = 0;
-  FILE *outfile = NULL;
-  vpx_codec_ctx_t codec;
-  vpx_codec_err_t res;
-  VpxVideoReader *reader = NULL;
-  const VpxInterface *decoder = NULL;
-  const VpxVideoInfo *info = NULL;
-
-  exec_name = argv[0];
-
-  if (argc != 3)
-    die("Invalid number of arguments.");
-
-  reader = vpx_video_reader_open(argv[1]);
-  if (!reader)
-    die("Failed to open %s for reading.", argv[1]);
-
-  if (!(outfile = fopen(argv[2], "wb")))
-    die("Failed to open %s for writing", argv[2]);
-
-  info = vpx_video_reader_get_info(reader);
-
-  decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
-  if (!decoder)
-    die("Unknown input codec.");
-
-  printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
-
-  res = vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL,
-                           VPX_CODEC_USE_POSTPROC);
-  if (res == VPX_CODEC_INCAPABLE)
-    die_codec(&codec, "Postproc not supported by this decoder.");
-
-  if (res)
-    die_codec(&codec, "Failed to initialize decoder.");
-
-  while (vpx_video_reader_read_frame(reader)) {
-    vpx_codec_iter_t iter = NULL;
-    vpx_image_t *img = NULL;
-    size_t frame_size = 0;
-    const unsigned char *frame = vpx_video_reader_get_frame(reader,
-                                                            &frame_size);
-
-    ++frame_cnt;
-
-    if (frame_cnt % 30 == 1) {
-      vp8_postproc_cfg_t pp = {0, 0, 0};
-
-    if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp))
-      die_codec(&codec, "Failed to turn off postproc.");
-    } else if (frame_cnt % 30 == 16) {
-      vp8_postproc_cfg_t pp = {VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE,
-                               4, 0};
-      if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp))
-        die_codec(&codec, "Failed to turn on postproc.");
-    };
-
-    // Decode the frame with 15ms deadline
-    if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 15000))
-      die_codec(&codec, "Failed to decode frame");
-
-    while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) {
-      vpx_img_write(img, outfile);
-    }
-  }
-
-  printf("Processed %d frames.\n", frame_cnt);
-  if (vpx_codec_destroy(&codec))
-    die_codec(&codec, "Failed to destroy codec");
-
-  printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n",
-         info->frame_width, info->frame_height, argv[2]);
-
-  vpx_video_reader_close(reader);
-
-  fclose(outfile);
-  return EXIT_SUCCESS;
-}
diff --git a/src/third_party/libvpx/examples/resize_util.c b/src/third_party/libvpx/examples/resize_util.c
deleted file mode 100644
index e6fdd5b..0000000
--- a/src/third_party/libvpx/examples/resize_util.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- *  Copyright (c) 2014 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#include <assert.h>
-#include <limits.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "../tools_common.h"
-#include "../vp9/encoder/vp9_resize.h"
-
-static const char *exec_name = NULL;
-
-static void usage() {
-  printf("Usage:\n");
-  printf("%s <input_yuv> <width>x<height> <target_width>x<target_height> ",
-         exec_name);
-  printf("<output_yuv> [<frames>]\n");
-}
-
-void usage_exit(void) {
-  usage();
-  exit(EXIT_FAILURE);
-}
-
-static int parse_dim(char *v, int *width, int *height) {
-  char *x = strchr(v, 'x');
-  if (x == NULL)
-    x = strchr(v, 'X');
-  if (x == NULL)
-    return 0;
-  *width = atoi(v);
-  *height = atoi(&x[1]);
-  if (*width <= 0 || *height <= 0)
-    return 0;
-  else
-    return 1;
-}
-
-int main(int argc, char *argv[]) {
-  char *fin, *fout;
-  FILE *fpin, *fpout;
-  uint8_t *inbuf, *outbuf;
-  uint8_t *inbuf_u, *outbuf_u;
-  uint8_t *inbuf_v, *outbuf_v;
-  int f, frames;
-  int width, height, target_width, target_height;
-
-  exec_name = argv[0];
-
-  if (argc < 5) {
-    printf("Incorrect parameters:\n");
-    usage();
-    return 1;
-  }
-
-  fin = argv[1];
-  fout = argv[4];
-  if (!parse_dim(argv[2], &width, &height)) {
-    printf("Incorrect parameters: %s\n", argv[2]);
-    usage();
-    return 1;
-  }
-  if (!parse_dim(argv[3], &target_width, &target_height)) {
-    printf("Incorrect parameters: %s\n", argv[3]);
-    usage();
-    return 1;
-  }
-
-  fpin = fopen(fin, "rb");
-  if (fpin == NULL) {
-    printf("Can't open file %s to read\n", fin);
-    usage();
-    return 1;
-  }
-  fpout = fopen(fout, "wb");
-  if (fpout == NULL) {
-    printf("Can't open file %s to write\n", fout);
-    usage();
-    return 1;
-  }
-  if (argc >= 6)
-    frames = atoi(argv[5]);
-  else
-    frames = INT_MAX;
-
-  printf("Input size:  %dx%d\n",
-         width, height);
-  printf("Target size: %dx%d, Frames: ",
-         target_width, target_height);
-  if (frames == INT_MAX)
-    printf("All\n");
-  else
-    printf("%d\n", frames);
-
-  inbuf = (uint8_t*)malloc(width * height * 3 / 2);
-  outbuf = (uint8_t*)malloc(target_width * target_height * 3 / 2);
-  inbuf_u = inbuf + width * height;
-  inbuf_v = inbuf_u + width * height / 4;
-  outbuf_u = outbuf + target_width * target_height;
-  outbuf_v = outbuf_u + target_width * target_height / 4;
-  f = 0;
-  while (f < frames) {
-    if (fread(inbuf, width * height * 3 / 2, 1, fpin) != 1)
-      break;
-    vp9_resize_frame420(inbuf, width, inbuf_u, inbuf_v, width / 2,
-                        height, width,
-                        outbuf, target_width, outbuf_u, outbuf_v,
-                        target_width / 2,
-                        target_height, target_width);
-    fwrite(outbuf, target_width * target_height * 3 / 2, 1, fpout);
-    f++;
-  }
-  printf("%d frames processed\n", f);
-  fclose(fpin);
-  fclose(fpout);
-
-  free(inbuf);
-  free(outbuf);
-  return 0;
-}
diff --git a/src/third_party/libvpx/examples/set_maps.c b/src/third_party/libvpx/examples/set_maps.c
deleted file mode 100644
index 1dc3ac0..0000000
--- a/src/third_party/libvpx/examples/set_maps.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-
-// VP8 Set Active and ROI Maps
-// ===========================
-//
-// This is an example demonstrating how to control the VP8 encoder's
-// ROI and Active maps.
-//
-// ROI (Reigon of Interest) maps are a way for the application to assign
-// each macroblock in the image to a region, and then set quantizer and
-// filtering parameters on that image.
-//
-// Active maps are a way for the application to specify on a
-// macroblock-by-macroblock basis whether there is any activity in that
-// macroblock.
-//
-//
-// Configuration
-// -------------
-// An ROI map is set on frame 22. If the width of the image in macroblocks
-// is evenly divisble by 4, then the output will appear to have distinct
-// columns, where the quantizer, loopfilter, and static threshold differ
-// from column to column.
-//
-// An active map is set on frame 33. If the width of the image in macroblocks
-// is evenly divisble by 4, then the output will appear to have distinct
-// columns, where one column will have motion and the next will not.
-//
-// The active map is cleared on frame 44.
-//
-// Observing The Effects
-// ---------------------
-// Use the `simple_decoder` example to decode this sample, and observe
-// the change in the image at frames 22, 33, and 44.
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "vpx/vp8cx.h"
-#include "vpx/vpx_encoder.h"
-
-#include "../tools_common.h"
-#include "../video_writer.h"
-
-static const char *exec_name;
-
-void usage_exit(void) {
-  fprintf(stderr, "Usage: %s <codec> <width> <height> <infile> <outfile>\n",
-          exec_name);
-  exit(EXIT_FAILURE);
-}
-
-static void set_roi_map(const vpx_codec_enc_cfg_t *cfg,
-                        vpx_codec_ctx_t *codec) {
-  unsigned int i;
-  vpx_roi_map_t roi;
-  memset(&roi, 0, sizeof(roi));
-
-  roi.rows = (cfg->g_h + 15) / 16;
-  roi.cols = (cfg->g_w + 15) / 16;
-
-  roi.delta_q[0] = 0;
-  roi.delta_q[1] = -2;
-  roi.delta_q[2] = -4;
-  roi.delta_q[3] = -6;
-
-  roi.delta_lf[0] = 0;
-  roi.delta_lf[1] = 1;
-  roi.delta_lf[2] = 2;
-  roi.delta_lf[3] = 3;
-
-  roi.static_threshold[0] = 1500;
-  roi.static_threshold[1] = 1000;
-  roi.static_threshold[2] = 500;
-  roi.static_threshold[3] = 0;
-
-  roi.roi_map = (uint8_t *)malloc(roi.rows * roi.cols);
-  for (i = 0; i < roi.rows * roi.cols; ++i)
-    roi.roi_map[i] = i % 4;
-
-  if (vpx_codec_control(codec, VP8E_SET_ROI_MAP, &roi))
-    die_codec(codec, "Failed to set ROI map");
-
-  free(roi.roi_map);
-}
-
-static void set_active_map(const vpx_codec_enc_cfg_t *cfg,
-                           vpx_codec_ctx_t *codec) {
-  unsigned int i;
-  vpx_active_map_t map = {0, 0, 0};
-
-  map.rows = (cfg->g_h + 15) / 16;
-  map.cols = (cfg->g_w + 15) / 16;
-
-  map.active_map = (uint8_t *)malloc(map.rows * map.cols);
-  for (i = 0; i < map.rows * map.cols; ++i)
-    map.active_map[i] = i % 2;
-
-  if (vpx_codec_control(codec, VP8E_SET_ACTIVEMAP, &map))
-    die_codec(codec, "Failed to set active map");
-
-  free(map.active_map);
-}
-
-static void unset_active_map(const vpx_codec_enc_cfg_t *cfg,
-                             vpx_codec_ctx_t *codec) {
-  vpx_active_map_t map = {0, 0, 0};
-
-  map.rows = (cfg->g_h + 15) / 16;
-  map.cols = (cfg->g_w + 15) / 16;
-  map.active_map = NULL;
-
-  if (vpx_codec_control(codec, VP8E_SET_ACTIVEMAP, &map))
-    die_codec(codec, "Failed to set active map");
-}
-
-static int encode_frame(vpx_codec_ctx_t *codec,
-                        vpx_image_t *img,
-                        int frame_index,
-                        VpxVideoWriter *writer) {
-  int got_pkts = 0;
-  vpx_codec_iter_t iter = NULL;
-  const vpx_codec_cx_pkt_t *pkt = NULL;
-  const vpx_codec_err_t res = vpx_codec_encode(codec, img, frame_index, 1, 0,
-                                               VPX_DL_GOOD_QUALITY);
-  if (res != VPX_CODEC_OK)
-    die_codec(codec, "Failed to encode frame");
-
-  while ((pkt = vpx_codec_get_cx_data(codec, &iter)) != NULL) {
-    got_pkts = 1;
-
-    if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
-      const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
-      if (!vpx_video_writer_write_frame(writer,
-                                        pkt->data.frame.buf,
-                                        pkt->data.frame.sz,
-                                        pkt->data.frame.pts)) {
-        die_codec(codec, "Failed to write compressed frame");
-      }
-
-      printf(keyframe ? "K" : ".");
-      fflush(stdout);
-    }
-  }
-
-  return got_pkts;
-}
-
-int main(int argc, char **argv) {
-  FILE *infile = NULL;
-  vpx_codec_ctx_t codec;
-  vpx_codec_enc_cfg_t cfg;
-  int frame_count = 0;
-  vpx_image_t raw;
-  vpx_codec_err_t res;
-  VpxVideoInfo info;
-  VpxVideoWriter *writer = NULL;
-  const VpxInterface *encoder = NULL;
-  const int fps = 2;        // TODO(dkovalev) add command line argument
-  const double bits_per_pixel_per_frame = 0.067;
-
-  exec_name = argv[0];
-  if (argc != 6)
-    die("Invalid number of arguments");
-
-  memset(&info, 0, sizeof(info));
-
-  encoder = get_vpx_encoder_by_name(argv[1]);
-  if (encoder == NULL) {
-    die("Unsupported codec.");
-  }
-  assert(encoder != NULL);
-  info.codec_fourcc = encoder->fourcc;
-  info.frame_width = strtol(argv[2], NULL, 0);
-  info.frame_height = strtol(argv[3], NULL, 0);
-  info.time_base.numerator = 1;
-  info.time_base.denominator = fps;
-
-  if (info.frame_width <= 0 ||
-      info.frame_height <= 0 ||
-      (info.frame_width % 2) != 0 ||
-      (info.frame_height % 2) != 0) {
-    die("Invalid frame size: %dx%d", info.frame_width, info.frame_height);
-  }
-
-  if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width,
-                                             info.frame_height, 1)) {
-    die("Failed to allocate image.");
-  }
-
-  printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
-
-  res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
-  if (res)
-    die_codec(&codec, "Failed to get default codec config.");
-
-  cfg.g_w = info.frame_width;
-  cfg.g_h = info.frame_height;
-  cfg.g_timebase.num = info.time_base.numerator;
-  cfg.g_timebase.den = info.time_base.denominator;
-  cfg.rc_target_bitrate = (unsigned int)(bits_per_pixel_per_frame * cfg.g_w *
-                                         cfg.g_h * fps / 1000);
-  cfg.g_lag_in_frames = 0;
-
-  writer = vpx_video_writer_open(argv[5], kContainerIVF, &info);
-  if (!writer)
-    die("Failed to open %s for writing.", argv[5]);
-
-  if (!(infile = fopen(argv[4], "rb")))
-    die("Failed to open %s for reading.", argv[4]);
-
-  if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
-    die_codec(&codec, "Failed to initialize encoder");
-
-  // Encode frames.
-  while (vpx_img_read(&raw, infile)) {
-    ++frame_count;
-
-    if (frame_count == 22 && encoder->fourcc == VP8_FOURCC) {
-      set_roi_map(&cfg, &codec);
-    } else if (frame_count == 33) {
-      set_active_map(&cfg, &codec);
-    } else if (frame_count == 44) {
-      unset_active_map(&cfg, &codec);
-    }
-
-    encode_frame(&codec, &raw, frame_count, writer);
-  }
-
-  // Flush encoder.
-  while (encode_frame(&codec, NULL, -1, writer)) {}
-
-  printf("\n");
-  fclose(infile);
-  printf("Processed %d frames.\n", frame_count);
-
-  vpx_img_free(&raw);
-  if (vpx_codec_destroy(&codec))
-    die_codec(&codec, "Failed to destroy codec.");
-
-  vpx_video_writer_close(writer);
-
-  return EXIT_SUCCESS;
-}
diff --git a/src/third_party/libvpx/examples/simple_decoder.c b/src/third_party/libvpx/examples/simple_decoder.c
deleted file mode 100644
index 8ccc810..0000000
--- a/src/third_party/libvpx/examples/simple_decoder.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-
-// Simple Decoder
-// ==============
-//
-// This is an example of a simple decoder loop. It takes an input file
-// containing the compressed data (in IVF format), passes it through the
-// decoder, and writes the decompressed frames to disk. Other decoder
-// examples build upon this one.
-//
-// The details of the IVF format have been elided from this example for
-// simplicity of presentation, as IVF files will not generally be used by
-// your application. In general, an IVF file consists of a file header,
-// followed by a variable number of frames. Each frame consists of a frame
-// header followed by a variable length payload. The length of the payload
-// is specified in the first four bytes of the frame header. The payload is
-// the raw compressed data.
-//
-// Standard Includes
-// -----------------
-// For decoders, you only have to include `vpx_decoder.h` and then any
-// header files for the specific codecs you use. In this case, we're using
-// vp8.
-//
-// Initializing The Codec
-// ----------------------
-// The libvpx decoder is initialized by the call to vpx_codec_dec_init().
-// Determining the codec interface to use is handled by VpxVideoReader and the
-// functions prefixed with vpx_video_reader_. Discussion of those functions is
-// beyond the scope of this example, but the main gist is to open the input file
-// and parse just enough of it to determine if it's a VPx file and which VPx
-// codec is contained within the file.
-// Note the NULL pointer passed to vpx_codec_dec_init(). We do that in this
-// example because we want the algorithm to determine the stream configuration
-// (width/height) and allocate memory automatically.
-//
-// Decoding A Frame
-// ----------------
-// Once the frame has been read into memory, it is decoded using the
-// `vpx_codec_decode` function. The call takes a pointer to the data
-// (`frame`) and the length of the data (`frame_size`). No application data
-// is associated with the frame in this example, so the `user_priv`
-// parameter is NULL. The `deadline` parameter is left at zero for this
-// example. This parameter is generally only used when doing adaptive post
-// processing.
-//
-// Codecs may produce a variable number of output frames for every call to
-// `vpx_codec_decode`. These frames are retrieved by the
-// `vpx_codec_get_frame` iterator function. The iterator variable `iter` is
-// initialized to NULL each time `vpx_codec_decode` is called.
-// `vpx_codec_get_frame` is called in a loop, returning a pointer to a
-// decoded image or NULL to indicate the end of list.
-//
-// Processing The Decoded Data
-// ---------------------------
-// In this example, we simply write the encoded data to disk. It is
-// important to honor the image's `stride` values.
-//
-// Cleanup
-// -------
-// The `vpx_codec_destroy` call frees any memory allocated by the codec.
-//
-// Error Handling
-// --------------
-// This example does not special case any error return codes. If there was
-// an error, a descriptive message is printed and the program exits. With
-// few exceptions, vpx_codec functions return an enumerated error status,
-// with the value `0` indicating success.
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "vpx/vpx_decoder.h"
-
-#include "../tools_common.h"
-#include "../video_reader.h"
-#include "./vpx_config.h"
-
-static const char *exec_name;
-
-void usage_exit(void) {
-  fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
-  exit(EXIT_FAILURE);
-}
-
-int main(int argc, char **argv) {
-  int frame_cnt = 0;
-  FILE *outfile = NULL;
-  vpx_codec_ctx_t codec;
-  VpxVideoReader *reader = NULL;
-  const VpxInterface *decoder = NULL;
-  const VpxVideoInfo *info = NULL;
-
-  exec_name = argv[0];
-
-  if (argc != 3)
-    die("Invalid number of arguments.");
-
-  reader = vpx_video_reader_open(argv[1]);
-  if (!reader)
-    die("Failed to open %s for reading.", argv[1]);
-
-  if (!(outfile = fopen(argv[2], "wb")))
-    die("Failed to open %s for writing.", argv[2]);
-
-  info = vpx_video_reader_get_info(reader);
-
-  decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
-  if (!decoder)
-    die("Unknown input codec.");
-
-  printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
-
-  if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0))
-    die_codec(&codec, "Failed to initialize decoder.");
-
-  while (vpx_video_reader_read_frame(reader)) {
-    vpx_codec_iter_t iter = NULL;
-    vpx_image_t *img = NULL;
-    size_t frame_size = 0;
-    const unsigned char *frame = vpx_video_reader_get_frame(reader,
-                                                            &frame_size);
-    if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0))
-      die_codec(&codec, "Failed to decode frame.");
-
-    while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) {
-      vpx_img_write(img, outfile);
-      ++frame_cnt;
-    }
-  }
-
-  printf("Processed %d frames.\n", frame_cnt);
-  if (vpx_codec_destroy(&codec))
-    die_codec(&codec, "Failed to destroy codec");
-
-  printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n",
-         info->frame_width, info->frame_height, argv[2]);
-
-  vpx_video_reader_close(reader);
-
-  fclose(outfile);
-
-  return EXIT_SUCCESS;
-}
diff --git a/src/third_party/libvpx/examples/simple_encoder.c b/src/third_party/libvpx/examples/simple_encoder.c
deleted file mode 100644
index 64f0a01..0000000
--- a/src/third_party/libvpx/examples/simple_encoder.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-// Simple Encoder
-// ==============
-//
-// This is an example of a simple encoder loop. It takes an input file in
-// YV12 format, passes it through the encoder, and writes the compressed
-// frames to disk in IVF format. Other decoder examples build upon this
-// one.
-//
-// The details of the IVF format have been elided from this example for
-// simplicity of presentation, as IVF files will not generally be used by
-// your application. In general, an IVF file consists of a file header,
-// followed by a variable number of frames. Each frame consists of a frame
-// header followed by a variable length payload. The length of the payload
-// is specified in the first four bytes of the frame header. The payload is
-// the raw compressed data.
-//
-// Standard Includes
-// -----------------
-// For encoders, you only have to include `vpx_encoder.h` and then any
-// header files for the specific codecs you use. In this case, we're using
-// vp8.
-//
-// Getting The Default Configuration
-// ---------------------------------
-// Encoders have the notion of "usage profiles." For example, an encoder
-// may want to publish default configurations for both a video
-// conferencing application and a best quality offline encoder. These
-// obviously have very different default settings. Consult the
-// documentation for your codec to see if it provides any default
-// configurations. All codecs provide a default configuration, number 0,
-// which is valid for material in the vacinity of QCIF/QVGA.
-//
-// Updating The Configuration
-// ---------------------------------
-// Almost all applications will want to update the default configuration
-// with settings specific to their usage. Here we set the width and height
-// of the video file to that specified on the command line. We also scale
-// the default bitrate based on the ratio between the default resolution
-// and the resolution specified on the command line.
-//
-// Initializing The Codec
-// ----------------------
-// The encoder is initialized by the following code.
-//
-// Encoding A Frame
-// ----------------
-// The frame is read as a continuous block (size width * height * 3 / 2)
-// from the input file. If a frame was read (the input file has not hit
-// EOF) then the frame is passed to the encoder. Otherwise, a NULL
-// is passed, indicating the End-Of-Stream condition to the encoder. The
-// `frame_cnt` is reused as the presentation time stamp (PTS) and each
-// frame is shown for one frame-time in duration. The flags parameter is
-// unused in this example. The deadline is set to VPX_DL_REALTIME to
-// make the example run as quickly as possible.
-
-// Forced Keyframes
-// ----------------
-// Keyframes can be forced by setting the VPX_EFLAG_FORCE_KF bit of the
-// flags passed to `vpx_codec_control()`. In this example, we force a
-// keyframe every <keyframe-interval> frames. Note, the output stream can
-// contain additional keyframes beyond those that have been forced using the
-// VPX_EFLAG_FORCE_KF flag because of automatic keyframe placement by the
-// encoder.
-//
-// Processing The Encoded Data
-// ---------------------------
-// Each packet of type `VPX_CODEC_CX_FRAME_PKT` contains the encoded data
-// for this frame. We write a IVF frame header, followed by the raw data.
-//
-// Cleanup
-// -------
-// The `vpx_codec_destroy` call frees any memory allocated by the codec.
-//
-// Error Handling
-// --------------
-// This example does not special case any error return codes. If there was
-// an error, a descriptive message is printed and the program exits. With
-// few exeptions, vpx_codec functions return an enumerated error status,
-// with the value `0` indicating success.
-//
-// Error Resiliency Features
-// -------------------------
-// Error resiliency is controlled by the g_error_resilient member of the
-// configuration structure. Use the `decode_with_drops` example to decode with
-// frames 5-10 dropped. Compare the output for a file encoded with this example
-// versus one encoded with the `simple_encoder` example.
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "vpx/vpx_encoder.h"
-
-#include "../tools_common.h"
-#include "../video_writer.h"
-
-static const char *exec_name;
-
-void usage_exit(void) {
-  fprintf(stderr,
-          "Usage: %s <codec> <width> <height> <infile> <outfile> "
-              "<keyframe-interval> <error-resilient> <frames to encode>\n"
-              "See comments in simple_encoder.c for more information.\n",
-          exec_name);
-  exit(EXIT_FAILURE);
-}
-
-static int encode_frame(vpx_codec_ctx_t *codec,
-                        vpx_image_t *img,
-                        int frame_index,
-                        int flags,
-                        VpxVideoWriter *writer) {
-  int got_pkts = 0;
-  vpx_codec_iter_t iter = NULL;
-  const vpx_codec_cx_pkt_t *pkt = NULL;
-  const vpx_codec_err_t res = vpx_codec_encode(codec, img, frame_index, 1,
-                                               flags, VPX_DL_GOOD_QUALITY);
-  if (res != VPX_CODEC_OK)
-    die_codec(codec, "Failed to encode frame");
-
-  while ((pkt = vpx_codec_get_cx_data(codec, &iter)) != NULL) {
-    got_pkts = 1;
-
-    if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
-      const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
-      if (!vpx_video_writer_write_frame(writer,
-                                        pkt->data.frame.buf,
-                                        pkt->data.frame.sz,
-                                        pkt->data.frame.pts)) {
-        die_codec(codec, "Failed to write compressed frame");
-      }
-      printf(keyframe ? "K" : ".");
-      fflush(stdout);
-    }
-  }
-
-  return got_pkts;
-}
-
-// TODO(tomfinegan): Improve command line parsing and add args for bitrate/fps.
-int main(int argc, char **argv) {
-  FILE *infile = NULL;
-  vpx_codec_ctx_t codec;
-  vpx_codec_enc_cfg_t cfg;
-  int frame_count = 0;
-  vpx_image_t raw;
-  vpx_codec_err_t res;
-  VpxVideoInfo info = {0};
-  VpxVideoWriter *writer = NULL;
-  const VpxInterface *encoder = NULL;
-  const int fps = 30;
-  const int bitrate = 200;
-  int keyframe_interval = 0;
-  int max_frames = 0;
-  int frames_encoded = 0;
-  const char *codec_arg = NULL;
-  const char *width_arg = NULL;
-  const char *height_arg = NULL;
-  const char *infile_arg = NULL;
-  const char *outfile_arg = NULL;
-  const char *keyframe_interval_arg = NULL;
-
-  exec_name = argv[0];
-
-  if (argc != 9)
-    die("Invalid number of arguments");
-
-  codec_arg = argv[1];
-  width_arg = argv[2];
-  height_arg = argv[3];
-  infile_arg = argv[4];
-  outfile_arg = argv[5];
-  keyframe_interval_arg = argv[6];
-  max_frames = strtol(argv[8], NULL, 0);
-
-  encoder = get_vpx_encoder_by_name(codec_arg);
-  if (!encoder)
-     die("Unsupported codec.");
-
-  info.codec_fourcc = encoder->fourcc;
-  info.frame_width = strtol(width_arg, NULL, 0);
-  info.frame_height = strtol(height_arg, NULL, 0);
-  info.time_base.numerator = 1;
-  info.time_base.denominator = fps;
-
-  if (info.frame_width <= 0 ||
-      info.frame_height <= 0 ||
-      (info.frame_width % 2) != 0 ||
-      (info.frame_height % 2) != 0) {
-    die("Invalid frame size: %dx%d", info.frame_width, info.frame_height);
-  }
-
-  if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width,
-                                             info.frame_height, 1)) {
-    die("Failed to allocate image.");
-  }
-
-  keyframe_interval = strtol(keyframe_interval_arg, NULL, 0);
-  if (keyframe_interval < 0)
-    die("Invalid keyframe interval value.");
-
-  printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
-
-  res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
-  if (res)
-    die_codec(&codec, "Failed to get default codec config.");
-
-  cfg.g_w = info.frame_width;
-  cfg.g_h = info.frame_height;
-  cfg.g_timebase.num = info.time_base.numerator;
-  cfg.g_timebase.den = info.time_base.denominator;
-  cfg.rc_target_bitrate = bitrate;
-  cfg.g_error_resilient = strtol(argv[7], NULL, 0);
-
-  writer = vpx_video_writer_open(outfile_arg, kContainerIVF, &info);
-  if (!writer)
-    die("Failed to open %s for writing.", outfile_arg);
-
-  if (!(infile = fopen(infile_arg, "rb")))
-    die("Failed to open %s for reading.", infile_arg);
-
-  if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
-    die_codec(&codec, "Failed to initialize encoder");
-
-  // Encode frames.
-  while (vpx_img_read(&raw, infile)) {
-    int flags = 0;
-    if (keyframe_interval > 0 && frame_count % keyframe_interval == 0)
-      flags |= VPX_EFLAG_FORCE_KF;
-    encode_frame(&codec, &raw, frame_count++, flags, writer);
-    frames_encoded++;
-    if (max_frames > 0 && frames_encoded >= max_frames)
-      break;
-  }
-
-  // Flush encoder.
-  while (encode_frame(&codec, NULL, -1, 0, writer)) {};
-
-  printf("\n");
-  fclose(infile);
-  printf("Processed %d frames.\n", frame_count);
-
-  vpx_img_free(&raw);
-  if (vpx_codec_destroy(&codec))
-    die_codec(&codec, "Failed to destroy codec.");
-
-  vpx_video_writer_close(writer);
-
-  return EXIT_SUCCESS;
-}
diff --git a/src/third_party/libvpx/examples/twopass_encoder.c b/src/third_party/libvpx/examples/twopass_encoder.c
deleted file mode 100644
index 15a6617..0000000
--- a/src/third_party/libvpx/examples/twopass_encoder.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-// Two Pass Encoder
-// ================
-//
-// This is an example of a two pass encoder loop. It takes an input file in
-// YV12 format, passes it through the encoder twice, and writes the compressed
-// frames to disk in IVF format. It builds upon the simple_encoder example.
-//
-// Twopass Variables
-// -----------------
-// Twopass mode needs to track the current pass number and the buffer of
-// statistics packets.
-//
-// Updating The Configuration
-// ---------------------------------
-// In two pass mode, the configuration has to be updated on each pass. The
-// statistics buffer is passed on the last pass.
-//
-// Encoding A Frame
-// ----------------
-// Encoding a frame in two pass mode is identical to the simple encoder
-// example. To increase the quality while sacrificing encoding speed,
-// VPX_DL_BEST_QUALITY can be used in place of VPX_DL_GOOD_QUALITY.
-//
-// Processing Statistics Packets
-// -----------------------------
-// Each packet of type `VPX_CODEC_CX_FRAME_PKT` contains the encoded data
-// for this frame. We write a IVF frame header, followed by the raw data.
-//
-//
-// Pass Progress Reporting
-// -----------------------------
-// It's sometimes helpful to see when each pass completes.
-//
-//
-// Clean-up
-// -----------------------------
-// Destruction of the encoder instance must be done on each pass. The
-// raw image should be destroyed at the end as usual.
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "vpx/vpx_encoder.h"
-
-#include "../tools_common.h"
-#include "../video_writer.h"
-
-static const char *exec_name;
-
-void usage_exit(void) {
-  fprintf(stderr,
-          "Usage: %s <codec> <width> <height> <infile> <outfile> "
-              "<frame limit>\n",
-          exec_name);
-  exit(EXIT_FAILURE);
-}
-
-static int get_frame_stats(vpx_codec_ctx_t *ctx,
-                           const vpx_image_t *img,
-                           vpx_codec_pts_t pts,
-                           unsigned int duration,
-                           vpx_enc_frame_flags_t flags,
-                           unsigned int deadline,
-                           vpx_fixed_buf_t *stats) {
-  int got_pkts = 0;
-  vpx_codec_iter_t iter = NULL;
-  const vpx_codec_cx_pkt_t *pkt = NULL;
-  const vpx_codec_err_t res = vpx_codec_encode(ctx, img, pts, duration, flags,
-                                               deadline);
-  if (res != VPX_CODEC_OK)
-    die_codec(ctx, "Failed to get frame stats.");
-
-  while ((pkt = vpx_codec_get_cx_data(ctx, &iter)) != NULL) {
-    got_pkts = 1;
-
-    if (pkt->kind == VPX_CODEC_STATS_PKT) {
-      const uint8_t *const pkt_buf = pkt->data.twopass_stats.buf;
-      const size_t pkt_size = pkt->data.twopass_stats.sz;
-      stats->buf = realloc(stats->buf, stats->sz + pkt_size);
-      memcpy((uint8_t *)stats->buf + stats->sz, pkt_buf, pkt_size);
-      stats->sz += pkt_size;
-    }
-  }
-
-  return got_pkts;
-}
-
-static int encode_frame(vpx_codec_ctx_t *ctx,
-                        const vpx_image_t *img,
-                        vpx_codec_pts_t pts,
-                        unsigned int duration,
-                        vpx_enc_frame_flags_t flags,
-                        unsigned int deadline,
-                        VpxVideoWriter *writer) {
-  int got_pkts = 0;
-  vpx_codec_iter_t iter = NULL;
-  const vpx_codec_cx_pkt_t *pkt = NULL;
-  const vpx_codec_err_t res = vpx_codec_encode(ctx, img, pts, duration, flags,
-                                               deadline);
-  if (res != VPX_CODEC_OK)
-    die_codec(ctx, "Failed to encode frame.");
-
-  while ((pkt = vpx_codec_get_cx_data(ctx, &iter)) != NULL) {
-    got_pkts = 1;
-    if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
-      const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
-
-      if (!vpx_video_writer_write_frame(writer, pkt->data.frame.buf,
-                                                pkt->data.frame.sz,
-                                                pkt->data.frame.pts))
-        die_codec(ctx, "Failed to write compressed frame.");
-      printf(keyframe ? "K" : ".");
-      fflush(stdout);
-    }
-  }
-
-  return got_pkts;
-}
-
-static vpx_fixed_buf_t pass0(vpx_image_t *raw,
-                             FILE *infile,
-                             const VpxInterface *encoder,
-                             const vpx_codec_enc_cfg_t *cfg,
-                             int max_frames) {
-  vpx_codec_ctx_t codec;
-  int frame_count = 0;
-  vpx_fixed_buf_t stats = {NULL, 0};
-
-  if (vpx_codec_enc_init(&codec, encoder->codec_interface(), cfg, 0))
-    die_codec(&codec, "Failed to initialize encoder");
-
-  // Calculate frame statistics.
-  while (vpx_img_read(raw, infile)) {
-    ++frame_count;
-    get_frame_stats(&codec, raw, frame_count, 1, 0, VPX_DL_GOOD_QUALITY,
-                    &stats);
-    if (max_frames > 0 && frame_count >= max_frames)
-      break;
-  }
-
-  // Flush encoder.
-  while (get_frame_stats(&codec, NULL, frame_count, 1, 0,
-                         VPX_DL_GOOD_QUALITY, &stats)) {}
-
-  printf("Pass 0 complete. Processed %d frames.\n", frame_count);
-  if (vpx_codec_destroy(&codec))
-    die_codec(&codec, "Failed to destroy codec.");
-
-  return stats;
-}
-
-static void pass1(vpx_image_t *raw,
-                  FILE *infile,
-                  const char *outfile_name,
-                  const VpxInterface *encoder,
-                  const vpx_codec_enc_cfg_t *cfg,
-                  int max_frames) {
-  VpxVideoInfo info = {
-    encoder->fourcc,
-    cfg->g_w,
-    cfg->g_h,
-    {cfg->g_timebase.num, cfg->g_timebase.den}
-  };
-  VpxVideoWriter *writer = NULL;
-  vpx_codec_ctx_t codec;
-  int frame_count = 0;
-
-  writer = vpx_video_writer_open(outfile_name, kContainerIVF, &info);
-  if (!writer)
-    die("Failed to open %s for writing", outfile_name);
-
-  if (vpx_codec_enc_init(&codec, encoder->codec_interface(), cfg, 0))
-    die_codec(&codec, "Failed to initialize encoder");
-
-  // Encode frames.
-  while (vpx_img_read(raw, infile)) {
-    ++frame_count;
-    encode_frame(&codec, raw, frame_count, 1, 0, VPX_DL_GOOD_QUALITY, writer);
-
-    if (max_frames > 0 && frame_count >= max_frames)
-      break;
-  }
-
-  // Flush encoder.
-  while (encode_frame(&codec, NULL, -1, 1, 0, VPX_DL_GOOD_QUALITY, writer)) {}
-
-  printf("\n");
-
-  if (vpx_codec_destroy(&codec))
-    die_codec(&codec, "Failed to destroy codec.");
-
-  vpx_video_writer_close(writer);
-
-  printf("Pass 1 complete. Processed %d frames.\n", frame_count);
-}
-
-int main(int argc, char **argv) {
-  FILE *infile = NULL;
-  int w, h;
-  vpx_codec_ctx_t codec;
-  vpx_codec_enc_cfg_t cfg;
-  vpx_image_t raw;
-  vpx_codec_err_t res;
-  vpx_fixed_buf_t stats;
-
-  const VpxInterface *encoder = NULL;
-  const int fps = 30;        // TODO(dkovalev) add command line argument
-  const int bitrate = 200;   // kbit/s TODO(dkovalev) add command line argument
-  const char *const codec_arg = argv[1];
-  const char *const width_arg = argv[2];
-  const char *const height_arg = argv[3];
-  const char *const infile_arg = argv[4];
-  const char *const outfile_arg = argv[5];
-  int max_frames = 0;
-  exec_name = argv[0];
-
-  if (argc != 7)
-    die("Invalid number of arguments.");
-
-  max_frames = strtol(argv[6], NULL, 0);
-
-  encoder = get_vpx_encoder_by_name(codec_arg);
-  if (!encoder)
-    die("Unsupported codec.");
-
-  w = strtol(width_arg, NULL, 0);
-  h = strtol(height_arg, NULL, 0);
-
-  if (w  <= 0 || h <= 0 || (w % 2) != 0 || (h  % 2) != 0)
-    die("Invalid frame size: %dx%d", w, h);
-
-  if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, w, h, 1))
-    die("Failed to allocate image", w, h);
-
-  printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
-
-  // Configuration
-  res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
-  if (res)
-    die_codec(&codec, "Failed to get default codec config.");
-
-  cfg.g_w = w;
-  cfg.g_h = h;
-  cfg.g_timebase.num = 1;
-  cfg.g_timebase.den = fps;
-  cfg.rc_target_bitrate = bitrate;
-
-  if (!(infile = fopen(infile_arg, "rb")))
-    die("Failed to open %s for reading", infile_arg);
-
-  // Pass 0
-  cfg.g_pass = VPX_RC_FIRST_PASS;
-  stats = pass0(&raw, infile, encoder, &cfg, max_frames);
-
-  // Pass 1
-  rewind(infile);
-  cfg.g_pass = VPX_RC_LAST_PASS;
-  cfg.rc_twopass_stats_in = stats;
-  pass1(&raw, infile, outfile_arg, encoder, &cfg, max_frames);
-  free(stats.buf);
-
-  vpx_img_free(&raw);
-  fclose(infile);
-
-  return EXIT_SUCCESS;
-}
diff --git a/src/third_party/libvpx/examples/vp8_multi_resolution_encoder.c b/src/third_party/libvpx/examples/vp8_multi_resolution_encoder.c
deleted file mode 100644
index fc775ef..0000000
--- a/src/third_party/libvpx/examples/vp8_multi_resolution_encoder.c
+++ /dev/null
@@ -1,731 +0,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-/*
- * This is an example demonstrating multi-resolution encoding in VP8.
- * High-resolution input video is down-sampled to lower-resolutions. The
- * encoder then encodes the video and outputs multiple bitstreams with
- * different resolutions.
- *
- * This test also allows for settings temporal layers for each spatial layer.
- * Different number of temporal layers per spatial stream may be used.
- * Currently up to 3 temporal layers per spatial stream (encoder) are supported
- * in this test.
- */
-
-#include "./vpx_config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <math.h>
-#include <assert.h>
-#include <sys/time.h>
-#include "vpx_ports/vpx_timer.h"
-#include "vpx/vpx_encoder.h"
-#include "vpx/vp8cx.h"
-#include "vpx_ports/mem_ops.h"
-#include "../tools_common.h"
-#define interface (vpx_codec_vp8_cx())
-#define fourcc    0x30385056
-
-void usage_exit(void) {
-  exit(EXIT_FAILURE);
-}
-
-/*
- * The input video frame is downsampled several times to generate a multi-level
- * hierarchical structure. NUM_ENCODERS is defined as the number of encoding
- * levels required. For example, if the size of input video is 1280x720,
- * NUM_ENCODERS is 3, and down-sampling factor is 2, the encoder outputs 3
- * bitstreams with resolution of 1280x720(level 0), 640x360(level 1), and
- * 320x180(level 2) respectively.
- */
-
-/* Number of encoders (spatial resolutions) used in this test. */
-#define NUM_ENCODERS 3
-
-/* Maximum number of temporal layers allowed for this test. */
-#define MAX_NUM_TEMPORAL_LAYERS 3
-
-/* This example uses the scaler function in libyuv. */
-#include "third_party/libyuv/include/libyuv/basic_types.h"
-#include "third_party/libyuv/include/libyuv/scale.h"
-#include "third_party/libyuv/include/libyuv/cpu_id.h"
-
-int (*read_frame_p)(FILE *f, vpx_image_t *img);
-
-static int read_frame(FILE *f, vpx_image_t *img) {
-    size_t nbytes, to_read;
-    int    res = 1;
-
-    to_read = img->w*img->h*3/2;
-    nbytes = fread(img->planes[0], 1, to_read, f);
-    if(nbytes != to_read) {
-        res = 0;
-        if(nbytes > 0)
-            printf("Warning: Read partial frame. Check your width & height!\n");
-    }
-    return res;
-}
-
-static int read_frame_by_row(FILE *f, vpx_image_t *img) {
-    size_t nbytes, to_read;
-    int    res = 1;
-    int plane;
-
-    for (plane = 0; plane < 3; plane++)
-    {
-        unsigned char *ptr;
-        int w = (plane ? (1 + img->d_w) / 2 : img->d_w);
-        int h = (plane ? (1 + img->d_h) / 2 : img->d_h);
-        int r;
-
-        /* Determine the correct plane based on the image format. The for-loop
-         * always counts in Y,U,V order, but this may not match the order of
-         * the data on disk.
-         */
-        switch (plane)
-        {
-        case 1:
-            ptr = img->planes[img->fmt==VPX_IMG_FMT_YV12? VPX_PLANE_V : VPX_PLANE_U];
-            break;
-        case 2:
-            ptr = img->planes[img->fmt==VPX_IMG_FMT_YV12?VPX_PLANE_U : VPX_PLANE_V];
-            break;
-        default:
-            ptr = img->planes[plane];
-        }
-
-        for (r = 0; r < h; r++)
-        {
-            to_read = w;
-
-            nbytes = fread(ptr, 1, to_read, f);
-            if(nbytes != to_read) {
-                res = 0;
-                if(nbytes > 0)
-                    printf("Warning: Read partial frame. Check your width & height!\n");
-                break;
-            }
-
-            ptr += img->stride[plane];
-        }
-        if (!res)
-            break;
-    }
-
-    return res;
-}
-
-static void write_ivf_file_header(FILE *outfile,
-                                  const vpx_codec_enc_cfg_t *cfg,
-                                  int frame_cnt) {
-    char header[32];
-
-    if(cfg->g_pass != VPX_RC_ONE_PASS && cfg->g_pass != VPX_RC_LAST_PASS)
-        return;
-    header[0] = 'D';
-    header[1] = 'K';
-    header[2] = 'I';
-    header[3] = 'F';
-    mem_put_le16(header+4,  0);                   /* version */
-    mem_put_le16(header+6,  32);                  /* headersize */
-    mem_put_le32(header+8,  fourcc);              /* headersize */
-    mem_put_le16(header+12, cfg->g_w);            /* width */
-    mem_put_le16(header+14, cfg->g_h);            /* height */
-    mem_put_le32(header+16, cfg->g_timebase.den); /* rate */
-    mem_put_le32(header+20, cfg->g_timebase.num); /* scale */
-    mem_put_le32(header+24, frame_cnt);           /* length */
-    mem_put_le32(header+28, 0);                   /* unused */
-
-    (void) fwrite(header, 1, 32, outfile);
-}
-
-static void write_ivf_frame_header(FILE *outfile,
-                                   const vpx_codec_cx_pkt_t *pkt)
-{
-    char             header[12];
-    vpx_codec_pts_t  pts;
-
-    if(pkt->kind != VPX_CODEC_CX_FRAME_PKT)
-        return;
-
-    pts = pkt->data.frame.pts;
-    mem_put_le32(header, pkt->data.frame.sz);
-    mem_put_le32(header+4, pts&0xFFFFFFFF);
-    mem_put_le32(header+8, pts >> 32);
-
-    (void) fwrite(header, 1, 12, outfile);
-}
-
-/* Temporal scaling parameters */
-/* This sets all the temporal layer parameters given |num_temporal_layers|,
- * including the target bit allocation across temporal layers. Bit allocation
- * parameters will be passed in as user parameters in another version.
- */
-static void set_temporal_layer_pattern(int num_temporal_layers,
-                                       vpx_codec_enc_cfg_t *cfg,
-                                       int bitrate,
-                                       int *layer_flags)
-{
-    assert(num_temporal_layers <= MAX_NUM_TEMPORAL_LAYERS);
-    switch (num_temporal_layers)
-    {
-    case 1:
-    {
-        /* 1-layer */
-        cfg->ts_number_layers     = 1;
-        cfg->ts_periodicity       = 1;