Bug 1178215 - Update update.py for new libvpx. r=rillian, a=lmandel
authorJan Gerber <j@mailb.org>
Mon, 29 Jun 2015 23:06:04 +0200
changeset 281415 c3b64ca7c3c1706036ec5e0b97b74d3378e09062
parent 281414 dff3b096744376a87bcf063bb98ab55356f4694a
child 281416 f49571596d6f0c25c20e848c47f1d267ec503227
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian, lmandel
bugs1178215
milestone41.0a2
Bug 1178215 - Update update.py for new libvpx. r=rillian, a=lmandel libvpx dropped vpx_mem_set_functions, only use it if an external libvpx is used and still has it. update update.py add vpx_dsp_rtcd.h rebase disable_pthread_on_mingw.patch add vp9_filter_restore_aligment.patch drop msvc2015.patch
configure.in
layout/media/symbols.def.in
media/libvpx/README_MOZILLA
media/libvpx/disable_pthread_on_mingw.patch
media/libvpx/msvc2015.patch
media/libvpx/update.py
media/libvpx/vp9_filter_restore_aligment.patch
media/libvpx/vpx_dsp_rtcd.h
--- a/configure.in
+++ b/configure.in
@@ -5586,16 +5586,19 @@ if test -n "$MOZ_VPX" -a -z "$MOZ_NATIVE
 
     if test -n "$VPX_X86_ASM"; then
       AC_DEFINE(VPX_X86_ASM)
     elif test -n "$VPX_ARM_ASM"; then
       AC_DEFINE(VPX_ARM_ASM)
     else
       AC_MSG_WARN([No assembler or assembly support for libvpx. Using unoptimized C routines.])
     fi
+
+    dnl native libvpx no longer has vpx_mem_set_functions
+    AC_DEFINE(MOZ_VPX_NO_MEM_REPORTING)
 fi
 
 dnl ========================================================
 dnl = Disable Wave decoder support
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(wave,
 [  --disable-wave          Disable Wave decoder support],
     MOZ_WAVE=,
--- a/layout/media/symbols.def.in
+++ b/layout/media/symbols.def.in
@@ -57,17 +57,16 @@ vpx_codec_enc_init_ver
 vpx_codec_vp8_cx
 vpx_codec_vp9_cx
 vpx_img_set_rect
 vpx_img_wrap
 vpx_codec_get_cx_data
 vpx_codec_enc_config_default
 vpx_img_alloc
 vpx_codec_encode
-vpx_mem_set_functions
 #endif
 #endif
 #ifdef MOZ_VORBIS
 ogg_page_bos
 ogg_page_granulepos
 ogg_page_serialno
 ogg_set_mem_functions
 ogg_stream_check
--- a/media/libvpx/README_MOZILLA
+++ b/media/libvpx/README_MOZILLA
@@ -1,11 +1,11 @@
 The source from this directory was copied from the libvpx
 git repository using the update.py script. The only changes
 made were those applied by update.py and the addition of
 moz.build and Makefile.in build files for the
 Mozilla build system.
 
 The libvpx git repository is:
 
-    https://gerrit.chromium.org/gerrit/webm/libvpx
+    https://chromium.googlesource.com/webm/libvpx
 
 The git commit ID used was c74bf6d889992c3cabe017ec353ca85c323107cd
--- a/media/libvpx/disable_pthread_on_mingw.patch
+++ b/media/libvpx/disable_pthread_on_mingw.patch
@@ -1,52 +1,32 @@
 From: Jacek Caban <jacek@codeweavers.com>
 Don't use pthread for libvpx in mingw builds.
 
 
 diff --git a/media/libvpx/vpx_config_x86-win32-gcc.h b/media/libvpx/vpx_config_x86-win32-gcc.h
-index c5452c0..12b5c84 100644
+index 5bc3efb..e60f84d 100644
 --- a/media/libvpx/vpx_config_x86-win32-gcc.h
 +++ b/media/libvpx/vpx_config_x86-win32-gcc.h
-@@ -30,17 +30,18 @@
- #define HAVE_SSSE3 1
- #define HAVE_SSE4_1 1
- #define HAVE_AVX 1
+@@ -32,7 +32,8 @@
  #define HAVE_AVX2 1
- #define HAVE_ALTIVEC 0
  #define HAVE_VPX_PORTS 1
  #define HAVE_STDINT_H 1
- #define HAVE_ALT_TREE_LAYOUT 0
 -#define HAVE_PTHREAD_H 1
 +#undef HAVE_PTHREAD_H
 +#define HAVE_PTHREAD_H 0
  #define HAVE_SYS_MMAN_H 1
  #define HAVE_UNISTD_H 1
  #define CONFIG_DEPENDENCY_TRACKING 1
- #define CONFIG_EXTERNAL_BUILD 0
- #define CONFIG_INSTALL_DOCS 0
- #define CONFIG_INSTALL_BINS 1
- #define CONFIG_INSTALL_LIBS 1
- #define CONFIG_INSTALL_SRCS 0
 diff --git a/media/libvpx/vpx_config_x86_64-win64-gcc.h b/media/libvpx/vpx_config_x86_64-win64-gcc.h
-index 04f382b..4d75a4b 100644
+index 4ff4339..b056a0e 100644
 --- a/media/libvpx/vpx_config_x86_64-win64-gcc.h
 +++ b/media/libvpx/vpx_config_x86_64-win64-gcc.h
-@@ -30,17 +30,18 @@
- #define HAVE_SSSE3 1
- #define HAVE_SSE4_1 1
- #define HAVE_AVX 1
+@@ -32,7 +32,8 @@
  #define HAVE_AVX2 1
- #define HAVE_ALTIVEC 0
  #define HAVE_VPX_PORTS 1
  #define HAVE_STDINT_H 1
- #define HAVE_ALT_TREE_LAYOUT 0
 -#define HAVE_PTHREAD_H 1
 +#undef HAVE_PTHREAD_H
 +#define HAVE_PTHREAD_H 0
  #define HAVE_SYS_MMAN_H 1
  #define HAVE_UNISTD_H 1
  #define CONFIG_DEPENDENCY_TRACKING 1
- #define CONFIG_EXTERNAL_BUILD 0
- #define CONFIG_INSTALL_DOCS 0
- #define CONFIG_INSTALL_BINS 1
- #define CONFIG_INSTALL_LIBS 1
- #define CONFIG_INSTALL_SRCS 0
deleted file mode 100644
--- a/media/libvpx/msvc2015.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/vp9/common/vp9_systemdependent.h b/vp9/common/vp9_systemdependent.h
-index e971158..19d445d 100644
---- a/vp9/common/vp9_systemdependent.h
-+++ b/vp9/common/vp9_systemdependent.h
-@@ -17,7 +17,9 @@
- #  include <intrin.h>
- #  define USE_MSC_INTRIN
- # endif
--# define snprintf _snprintf
-+# if _MSC_VER < 1900
-+#  define snprintf _snprintf
-+# endif
- #endif
- 
- #ifdef __cplusplus
--- a/media/libvpx/update.py
+++ b/media/libvpx/update.py
@@ -22,37 +22,40 @@ PLATFORMS= [
   'armv7-android-gcc',
   'x86-win32-gcc',
   'x86_64-win64-gcc',
 ]
 
 
 mk_files = [
     'vp8/vp8_common.mk',
-    'vp8/vp8cx_arm.mk',
     'vp8/vp8cx.mk',
     'vp8/vp8dx.mk',
+    'vp8/vp8cx_arm.mk',
     'vp9/vp9_common.mk',
     'vp9/vp9cx.mk',
     'vp9/vp9dx.mk',
+    'vpx_dsp/vpx_dsp.mk',
     'vpx_mem/vpx_mem.mk',
     'vpx_ports/vpx_ports.mk',
     'vpx_scale/vpx_scale.mk',
     'vpx/vpx_codec.mk',
 ]
 
 extensions = ['.asm', '.c', '.h']
 
 MODULES = {
     'SOURCES': [
         'API_DOC_SRCS-$(CONFIG_VP8_DECODER)',
         'API_DOC_SRCS-yes',
         'API_EXPORTS',
         'API_SRCS-$(CONFIG_VP8_DECODER)',
         'API_SRCS-yes',
+        'DSP_SRCS-yes',
+        'DSP_SRCS-yes+$(CONFIG_ENCODERS)',
         'MEM_SRCS-yes',
         'PORTS_SRCS-yes',
         'SCALE_SRCS-$(CONFIG_SPATIAL_RESAMPLING)',
         'SCALE_SRCS-no',
         'SCALE_SRCS-yes',
         'VP8_COMMON_SRCS-yes',
         'VP8_DX_EXPORTS',
         'VP8_DX_SRCS-$(CONFIG_MULTITHREAD)',
@@ -81,18 +84,26 @@ MODULES = {
         'VP8_CX_SRCS-yes',
         'VP9_CX_EXPORTS',
         'VP9_CX_SRCS-no',
         'VP9_CX_SRCS_REMOVE-no',
         'VP9_CX_SRCS_REMOVE-yes',
         'VP9_CX_SRCS-yes',
     ],
     'X86_ASM': [
+        'DSP_SRCS-$(HAVE_MMX)',
+        'DSP_SRCS-$(HAVE_MMX)+$(CONFIG_ENCODERS)',
+        'DSP_SRCS-$(HAVE_SSE2)',
+        'DSP_SRCS-$(HAVE_SSE2)+$(CONFIG_ENCODERS)',
+        'DSP_SRCS-$(HAVE_SSE3)+$(CONFIG_ENCODERS)',
+        'DSP_SRCS-$(HAVE_SSE4_1)+$(CONFIG_ENCODERS)',
+        'DSP_SRCS-$(HAVE_SSSE3)+$(CONFIG_ENCODERS)',
         'PORTS_SRCS-$(BUILD_LIBVPX)',
         'PORTS_SRCS-$(BUILD_LIBVPX)+$(ARCH_X86)$(ARCH_X86_64)',
+        'PORTS_SRCS-yes+$(ARCH_X86)$(ARCH_X86_64)',
         'VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64)',
         'VP8_COMMON_SRCS-$(HAVE_MMX)',
         'VP8_COMMON_SRCS-$(HAVE_MMX)+$(CONFIG_POSTPROC)',
         'VP8_COMMON_SRCS-$(HAVE_SSE2)',
         'VP8_COMMON_SRCS-$(HAVE_SSE2)+$(CONFIG_POSTPROC)',
         'VP8_COMMON_SRCS-$(HAVE_SSE3)',
         'VP8_COMMON_SRCS-$(HAVE_SSE4_1)',
         'VP8_COMMON_SRCS-$(HAVE_SSSE3)',
@@ -122,16 +133,20 @@ MODULES = {
     'X86-64_ASM': [
         'VP8_COMMON_SRCS-$(HAVE_SSE2)+$(ARCH_X86_64)',
         'VP8_CX_SRCS-$(ARCH_X86_64)',
         'VP9_COMMON_SRCS-$(HAVE_SSSE3)+$(ARCH_X86_64)',
         'VP9_CX_SRCS-$(ARCH_X86_64)',
         'VP9_CX_SRCS-$(HAVE_SSSE3)+$(ARCH_X86_64)',
     ],
     'ARM_ASM': [
+        'DSP_SRCS-$(HAVE_MEDIA)',
+        'DSP_SRCS-$(HAVE_MEDIA)+$(CONFIG_ENCODERS)',
+        'DSP_SRCS-$(HAVE_NEON)',
+        'DSP_SRCS-$(HAVE_NEON)+$(CONFIG_ENCODERS)',
         'PORTS_SRCS-$(ARCH_ARM)',
         'SCALE_SRCS-$(HAVE_NEON)',
         'VP8_COMMON_SRCS-$(ARCH_ARM)',
         'VP8_COMMON_SRCS-$(HAVE_MEDIA)',
         'VP8_COMMON_SRCS-$(HAVE_NEON)',
         'VP9_COMMON_SRCS-$(HAVE_NEON)',
         'VP9_COMMON_SRCS-$(HAVE_NEON_ASM)',
         'VP9_COMMON_SRCS-yes+$(HAVE_NEON_ASM)',
@@ -141,16 +156,18 @@ MODULES = {
         'VP8_CX_SRCS-$(HAVE_NEON)',
         'VP8_CX_SRCS-$(HAVE_NEON_ASM)',
         'VP9_CX_SRCS-$(HAVE_NEON)',
     ],
     'ERROR_CONCEALMENT': [
         'VP8_DX_SRCS-$(CONFIG_ERROR_CONCEALMENT)',
     ],
     'AVX2': [
+        'DSP_SRCS-$(HAVE_AVX2)',
+        'DSP_SRCS-$(HAVE_AVX2)+$(CONFIG_ENCODERS)',
         'VP9_COMMON_SRCS-$(HAVE_AVX2)',
         'VP9_CX_SRCS-$(HAVE_AVX2)',
     ],
     'VP8_POSTPROC': [
         'VP8_COMMON_SRCS-$(CONFIG_POSTPROC)',
     ],
     'VP9_POSTPROC': [
         'VP9_COMMON_SRCS-$(CONFIG_VP9_POSTPROC)',
@@ -165,29 +182,34 @@ DISABLED_MODULES = [
     'MEM_SRCS-$(CONFIG_MEM_TRACKER)',
     'VP8_COMMON_SRCS-$(CONFIG_POSTPROC_VISUALIZER)',
     'VP9_COMMON_SRCS-$(CONFIG_POSTPROC_VISUALIZER)',
     'VP8_CX_SRCS-$(CONFIG_INTERNAL_STATS)',
     'VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS)',
     'VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS)+$(CONFIG_VP9_POSTPROC)',
     'VP9_CX_SRCS-$(CONFIG_VP9_TEMPORAL_DENOISING)',
     'VP9_CX_SRCS-$(HAVE_SSE2)+$(CONFIG_VP9_TEMPORAL_DENOISING)',
+
+    # VP9_HIGHBITDEPTH
+    'DSP_SRCS-$(HAVE_SSE2)+$(CONFIG_VP9_HIGHBITDEPTH)',
     'VP9_COMMON_SRCS-$(HAVE_SSE2)+$(CONFIG_VP9_HIGHBITDEPTH)',
     'VP9_CX_SRCS-$(HAVE_SSE2)+$(CONFIG_VP9_HIGHBITDEPTH)',
 
     # use asm implementations instead of intrinsics
     # neon exists as assembly and intrinsics implementations.
     # If both are available prefer assembly (HAVE_NEON_ASM)
     'VP9_COMMON_SRCS-yes+$(HAVE_NEON)',
 
     # mips files are also ignored via ignored_folders
     'SCALE_SRCS-$(HAVE_DSPR2)',
     'VP8_COMMON_SRCS-$(HAVE_DSPR2)',
     'VP9_COMMON_SRCS-$(HAVE_DSPR2)',
     'VP8_CX_SRCS_REMOVE-$(HAVE_EDSP)',
+    'VP9_COMMON_SRCS-$(HAVE_MSA)',
+    'VP9_CX_SRCS-$(HAVE_MSA)',
 ]
 
 libvpx_files = [
     'build/make/ads2gas.pl',
     'build/make/thumb.pm',
     'LICENSE',
     'PATENTS',
 ]
@@ -216,18 +238,22 @@ ignore_folders = [
     'nestegg/',
     'objdir/',
     'ppc/',
     'test/',
     'vpx_mem/memory_manager/',
 ]
 
 rename_files = {
+    #avoid clash between vpx_dsp/x86 and vp8/common/x86
+    'vp8/common/x86/variance_mmx.c': 'vp8/common/x86/vp8_variance_mmx.c',
+    'vp8/common/x86/variance_sse2.c': 'vp8/common/x86/vp8_variance_sse2.c',
+    'vp8/common/x86/variance_impl_mmx.asm': 'vp8/common/x86/vp8_variance_impl_mmx.asm',
     #avoid clash with common/arm/neon/vp9_avg_neon.c
-    'vp9/encoder/arm/neon/vp9_avg_neon.c': 'vp9/encoder/arm/neon/vp9enc_avg_neon.c'
+    'vp9/encoder/arm/neon/vp9_avg_neon.c': 'vp9/encoder/arm/neon/vp9enc_avg_neon.c',
 }
 
 files = {
     'EXPORTS': [
         'vpx_mem/include/vpx_mem_intrnl.h',
         'vpx_mem/vpx_mem.h',
         'vpx_ports/arm.h',
         'vpx_ports/mem.h',
@@ -245,17 +271,16 @@ files = {
         'vpx/vpx_image.h',
         'vpx/vpx_integer.h',
     ],
     'X86-64_ASM': [
         'third_party/x86inc/x86inc.asm',
     ],
     'SOURCES': [
         'vp8/common/rtcd.c',
-        'vp8/common/sad_c.c',
         'vp8/encoder/bitstream.c',
         'vp8/encoder/onyx_if.c',
         'vp8/vp8_dx_iface.c',
         'vp9/common/vp9_alloccommon.c',
         'vp9/common/vp9_blockd.c',
         'vp9/common/vp9_common_data.c',
         'vp9/common/vp9_convolve.c',
         'vp9/common/vp9_debugmodes.c',
@@ -295,17 +320,16 @@ files = {
         'vp9/encoder/vp9_mbgraph.c',
         'vp9/encoder/vp9_mcomp.c',
         'vp9/encoder/vp9_picklpf.c',
         'vp9/encoder/vp9_pickmode.c',
         'vp9/encoder/vp9_quantize.c',
         'vp9/encoder/vp9_ratectrl.c',
         'vp9/encoder/vp9_rdopt.c',
         'vp9/encoder/vp9_resize.c',
-        'vp9/encoder/vp9_sad.c',
         'vp9/encoder/vp9_segmentation.c',
         'vp9/encoder/vp9_subexp.c',
         'vp9/encoder/vp9_temporal_filter.c',
         'vp9/encoder/vp9_tokenize.c',
         'vp9/encoder/vp9_treewriter.c',
         'vp9/encoder/vp9_variance.c',
         'vp9/encoder/vp9_writer.c',
         'vp9/vp9_cx_iface.c',
@@ -343,37 +367,38 @@ manual = [
 ]
 
 platform_files = [
     'vp8_rtcd.h',
     'vp9_rtcd.h',
     'vpx_config.asm',
     'vpx_config.h',
     'vpx_scale_rtcd.h',
+    'vpx_dsp_rtcd.h',
 ]
 
 def prepare_upstream(prefix, commit=None):
     upstream_url = 'https://chromium.googlesource.com/webm/libvpx'
     if os.path.exists(prefix):
-        print "Using existing repo in '%s'" % prefix
         os.chdir(prefix)
-        subprocess.call(['git', 'fetch', upstream_url, prefix])
+        subprocess.call(['git', 'fetch', 'origin'])
     else:
         subprocess.call(['git', 'clone', upstream_url, prefix])
         os.chdir(prefix)
     if commit:
         subprocess.call(['git', 'checkout', commit])
     else:
         p = subprocess.Popen(['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE)
         stdout, stderr = p.communicate()
         commit = stdout.strip()
 
     for target in PLATFORMS:
         target_objdir = os.path.join(prefix, 'objdir', target)
-        os.makedirs(target_objdir)
+        if not os.path.exists(target_objdir):
+            os.makedirs(target_objdir)
         os.chdir(target_objdir)
         configure = ['../../configure', '--target=%s' % target,
             '--disable-examples', '--disable-install-docs',
             '--enable-multi-res-encoding',
         ]
 
         if 'darwin9' in target:
             configure += ['--enable-pic']
@@ -381,20 +406,24 @@ def prepare_upstream(prefix, commit=None
             configure += ['--enable-pic']
             configure += ['--disable-avx2']
         # x86inc.asm is not compatible with pic 32bit builds
         if target == 'x86-linux-gcc':
             configure += ['--disable-use-x86inc']
 
         if target == 'armv7-android-gcc':
             configure += ['--sdk-path=%s' % ndk_path]
-
+        print "\n" + target_objdir
+        print " ".join(configure)
+        sys.stdout.flush()
         subprocess.call(configure)
         make_targets = [f for f in platform_files if not os.path.exists(f)]
         if make_targets:
+            print " ".join(['make'] + make_targets)
+            sys.stdout.flush()
             subprocess.call(['make'] + make_targets)
         for f in make_targets:
             if not os.path.exists(f):
                 print "%s missing from %s, check toolchain" % (f, target)
                 sys.exit(1)
 
     os.chdir(base)
     return commit
@@ -538,31 +567,36 @@ def update_and_remove_files(prefix, libv
     # Copy vpx_version.h from one of the build targets
     s = os.path.join(prefix, 'objdir/x86-linux-gcc/vpx_version.h')
     f = 'vpx_version.h'
     if is_new(s, f):
         copy(s, f)
 
     # Remove unknown files from tree
     removed_files = [f for f in current_files if f not in libvpx_files and f not in rename_files.values()]
+    for f in rename_files:
+        if os.path.exists(f) and os.path.exists(rename_files[f]) and not f in removed_files:
+            removed_files.append(f)
+
     if removed_files:
         print "Remove files:"
         for f in removed_files:
             os.unlink(f)
             print '    ', f
 
 def apply_patches():
     # Patch to permit vpx users to specify their own <stdint.h> types.
     os.system("patch -p0 < stdint.patch")
-    # Patch to allow MSVC 2015 to compile libvpx
-    os.system("patch -p1 < msvc2015.patch")
     # Patch to fix a crash caused by MSVC 2013
     os.system("patch -p3 < bug1137614.patch")
     # Bug 1176730 - Don't use pthread for libvpx in mingw builds.
     os.system("patch -p3 < disable_pthread_on_mingw.patch")
+    # Cherry pick https://chromium-review.googlesource.com/#/c/276889/
+    # to fix crash on 32bit
+    os.system("patch -p1 < vp9_filter_restore_aligment.patch")
 
 def update_readme(commit):
     with open('README_MOZILLA') as f:
         readme = f.read()
 
     if 'The git commit ID used was' in readme:
         new_readme = re.sub('The git commit ID used was [a-f0-9]+',
             'The git commit ID used was %s' % commit, readme)
new file mode 100644
--- /dev/null
+++ b/media/libvpx/vp9_filter_restore_aligment.patch
@@ -0,0 +1,27 @@
+commit 33b3953c548a20c0aee705657df0440a740c28b7
+Author: James Zern <jzern@google.com>
+Date:   Thu Jun 11 15:12:22 2015 -0700
+
+    vp9_filter: restore vp9_bilinear_filters alignment
+    
+    the declaration containing the alignment in vp9_filter.h was removed in:
+    eb88b17 Make vp9 subpixel match vp8
+    
+    fixes a crash in 32-bit builds
+    
+    Change-Id: I9a97e6b4e8e94698e43ff79d0d8bb85043b73c61
+
+diff --git a/vp9/common/vp9_filter.c b/vp9/common/vp9_filter.c
+index afcdf22..b256d4a 100644
+--- a/vp9/common/vp9_filter.c
++++ b/vp9/common/vp9_filter.c
+@@ -12,7 +12,8 @@
+ 
+ #include "vp9/common/vp9_filter.h"
+ 
+-const InterpKernel vp9_bilinear_filters[SUBPEL_SHIFTS] = {
++DECLARE_ALIGNED(256, const InterpKernel,
++                vp9_bilinear_filters[SUBPEL_SHIFTS]) = {
+   { 0, 0, 0, 128,   0, 0, 0, 0 },
+   { 0, 0, 0, 120,   8, 0, 0, 0 },
+   { 0, 0, 0, 112,  16, 0, 0, 0 },
new file mode 100644
--- /dev/null
+++ b/media/libvpx/vpx_dsp_rtcd.h
@@ -0,0 +1,48 @@
+/*
+ *  Copyright (c) 2013 Mozilla Foundation. 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.
+ */
+
+#if defined(_WIN64)
+/* 64 bit Windows */
+#ifdef _MSC_VER
+#include "vpx_dsp_rtcd_x86_64-win64-vs12.h"
+#else
+#include "vpx_dsp_rtcd_x86_64-win64-gcc.h"
+#endif
+
+#elif defined(_WIN32)
+/* 32 bit Windows, MSVC. */
+#ifdef _MSC_VER
+#include "vpx_dsp_rtcd_x86-win32-vs12.h"
+#else
+#include "vpx_dsp_rtcd_x86-win32-gcc.h"
+#endif
+
+#elif defined(__APPLE__) && defined(__x86_64__)
+/* 64 bit MacOS. */
+#include "vpx_dsp_rtcd_x86_64-darwin9-gcc.h"
+
+#elif defined(__APPLE__) && defined(__i386__)
+/* 32 bit MacOS. */
+#include "vpx_dsp_rtcd_x86-darwin9-gcc.h"
+
+#elif defined(__ELF__) && (defined(__i386) || defined(__i386__))
+/* 32 bit ELF platforms. */
+#include "vpx_dsp_rtcd_x86-linux-gcc.h"
+
+#elif defined(__ELF__) && (defined(__x86_64) || defined(__x86_64__))
+/* 64 bit ELF platforms. */
+#include "vpx_dsp_rtcd_x86_64-linux-gcc.h"
+
+#elif defined(VPX_ARM_ASM)
+/* Android */
+#include "vpx_dsp_rtcd_armv7-android-gcc.h"
+
+#else
+/* Assume generic GNU/GCC configuration. */
+#include "vpx_dsp_rtcd_generic-gnu.h"
+#endif