Port folder renaming changes from AOM

Manually cherry-picked commits:
ceef058 libvpx->libaom part2
3d26d91 libvpx -> libaom
cfea7dd vp10/ -> av1/
3a8eff7 Fix a build issue for a test
bf4202e Rename vpx to aom

Change-Id: I1b0eb5a40796e3aaf41c58984b4229a439a597dc
diff --git a/.gitignore b/.gitignore
index 8c57982..f6bf5a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,8 +45,8 @@
 /ivfdec.dox
 /ivfenc
 /ivfenc.dox
-/libvpx.so*
-/libvpx.ver
+/libaom.so*
+/libaom.ver
 /samples.dox
 /test_intra_pred_speed
 /test_libvpx
diff --git a/README b/README
index 0f95a8f..fc71b77 100644
--- a/README
+++ b/README
@@ -33,13 +33,13 @@
 
     $ mkdir build
     $ cd build
-    $ ../libvpx/configure <options>
+    $ ../libaom/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
+    $ ../libaom/configure --help
 
   4. Cross development
   For cross development, the most notable option is the --target option. The
@@ -108,7 +108,7 @@
   toolchain, the following command could be used (note, POSIX SH syntax, adapt
   to your shell as necessary):
 
-    $ CROSS=mipsel-linux-uclibc- ../libvpx/configure
+    $ CROSS=mipsel-linux-uclibc- ../libaom/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
@@ -125,7 +125,7 @@
   LIBVPX_TEST_DATA_PATH environment variable can be used.
 
   $ ./configure --enable-unit-tests
-  $ LIBVPX_TEST_DATA_PATH=../libvpx-test-data make testdata
+  $ LIBVPX_TEST_DATA_PATH=../-test-data make testdata
 
 CODE STYLE:
   The coding style used by this project is enforced with clang-format using the
diff --git a/vpx/exports_com b/aom/exports_com
similarity index 100%
rename from vpx/exports_com
rename to aom/exports_com
diff --git a/vpx/exports_dec b/aom/exports_dec
similarity index 100%
rename from vpx/exports_dec
rename to aom/exports_dec
diff --git a/vpx/exports_enc b/aom/exports_enc
similarity index 100%
rename from vpx/exports_enc
rename to aom/exports_enc
diff --git a/vpx/internal/vpx_codec_internal.h b/aom/internal/vpx_codec_internal.h
similarity index 98%
rename from vpx/internal/vpx_codec_internal.h
rename to aom/internal/vpx_codec_internal.h
index 6a253a5..4ac77b7 100644
--- a/vpx/internal/vpx_codec_internal.h
+++ b/aom/internal/vpx_codec_internal.h
@@ -219,10 +219,10 @@
 
 /*!\brief Pass in external frame buffers for the decoder to use.
  *
- * Registers functions to be called when libvpx needs a frame buffer
- * to decode the current frame and a function to be called when libvpx does
+ * Registers functions to be called when libaom needs a frame buffer
+ * to decode the current frame and a function to be called when libaom does
  * not internally reference the frame buffer. This set function must
- * be called before the first call to decode or libvpx will assume the
+ * be called before the first call to decode or libaom will assume the
  * default behavior of allocating frame buffers internally.
  *
  * \param[in] ctx          Pointer to this instance's context
@@ -231,7 +231,7 @@
  * \param[in] cb_priv      Callback's private data
  *
  * \retval #VPX_CODEC_OK
- *     External frame buffers will be used by libvpx.
+ *     External frame buffers will be used by libaom.
  * \retval #VPX_CODEC_INVALID_PARAM
  *     One or more of the callbacks were NULL.
  * \retval #VPX_CODEC_ERROR
diff --git a/vpx/src/vpx_codec.c b/aom/src/vpx_codec.c
similarity index 97%
rename from vpx/src/vpx_codec.c
rename to aom/src/vpx_codec.c
index f222b9e..7bdc870 100644
--- a/vpx/src/vpx_codec.c
+++ b/aom/src/vpx_codec.c
@@ -14,8 +14,8 @@
  */
 #include <stdarg.h>
 #include <stdlib.h>
-#include "vpx/vpx_integer.h"
-#include "vpx/internal/vpx_codec_internal.h"
+#include "aom/vpx_integer.h"
+#include "aom/internal/vpx_codec_internal.h"
 #include "vpx_version.h"
 
 #define SAVE_STATUS(ctx, var) (ctx ? (ctx->err = var) : var)
diff --git a/vpx/src/vpx_decoder.c b/aom/src/vpx_decoder.c
similarity index 98%
rename from vpx/src/vpx_decoder.c
rename to aom/src/vpx_decoder.c
index fc1c2bc..97709d1 100644
--- a/vpx/src/vpx_decoder.c
+++ b/aom/src/vpx_decoder.c
@@ -13,7 +13,7 @@
  *
  */
 #include <string.h>
-#include "vpx/internal/vpx_codec_internal.h"
+#include "aom/internal/vpx_codec_internal.h"
 
 #define SAVE_STATUS(ctx, var) (ctx ? (ctx->err = var) : var)
 
diff --git a/vpx/src/vpx_encoder.c b/aom/src/vpx_encoder.c
similarity index 99%
rename from vpx/src/vpx_encoder.c
rename to aom/src/vpx_encoder.c
index 4390cf7..f3689e3 100644
--- a/vpx/src/vpx_encoder.c
+++ b/aom/src/vpx_encoder.c
@@ -15,7 +15,7 @@
 #include <limits.h>
 #include <string.h>
 #include "vpx_config.h"
-#include "vpx/internal/vpx_codec_internal.h"
+#include "aom/internal/vpx_codec_internal.h"
 
 #define SAVE_STATUS(ctx, var) (ctx ? (ctx->err = var) : var)
 
@@ -171,7 +171,7 @@
 /* On X86, disable the x87 unit's internal 80 bit precision for better
  * consistency with the SSE unit's 64 bit precision.
  */
-#include "vpx_ports/x86.h"
+#include "aom_ports/x86.h"
 #define FLOATING_POINT_INIT() \
   do {                        \
     unsigned short x87_orig_mode = x87_set_double_precision();
diff --git a/vpx/src/vpx_image.c b/aom/src/vpx_image.c
similarity index 98%
rename from vpx/src/vpx_image.c
rename to aom/src/vpx_image.c
index dba439c..0970b06 100644
--- a/vpx/src/vpx_image.c
+++ b/aom/src/vpx_image.c
@@ -11,9 +11,9 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "vpx/vpx_image.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom/vpx_image.h"
+#include "aom/vpx_integer.h"
+#include "aom_mem/vpx_mem.h"
 
 static vpx_image_t *img_alloc_helper(vpx_image_t *img, vpx_img_fmt_t fmt,
                                      unsigned int d_w, unsigned int d_h,
diff --git a/vpx/vp8.h b/aom/vp8.h
similarity index 100%
rename from vpx/vp8.h
rename to aom/vp8.h
diff --git a/vpx/vp8cx.h b/aom/vp8cx.h
similarity index 100%
rename from vpx/vp8cx.h
rename to aom/vp8cx.h
diff --git a/vpx/vp8dx.h b/aom/vp8dx.h
similarity index 100%
rename from vpx/vp8dx.h
rename to aom/vp8dx.h
diff --git a/vpx/vpx_codec.h b/aom/vpx_codec.h
similarity index 100%
rename from vpx/vpx_codec.h
rename to aom/vpx_codec.h
diff --git a/vpx/vpx_codec.mk b/aom/vpx_codec.mk
similarity index 100%
rename from vpx/vpx_codec.mk
rename to aom/vpx_codec.mk
diff --git a/vpx/vpx_decoder.h b/aom/vpx_decoder.h
similarity index 98%
rename from vpx/vpx_decoder.h
rename to aom/vpx_decoder.h
index 3d8dd6c..2fb3be1 100644
--- a/vpx/vpx_decoder.h
+++ b/aom/vpx_decoder.h
@@ -328,10 +328,10 @@
 
 /*!\brief Pass in external frame buffers for the decoder to use.
  *
- * Registers functions to be called when libvpx needs a frame buffer
- * to decode the current frame and a function to be called when libvpx does
+ * Registers functions to be called when libaom needs a frame buffer
+ * to decode the current frame and a function to be called when libaom does
  * not internally reference the frame buffer. This set function must
- * be called before the first call to decode or libvpx will assume the
+ * be called before the first call to decode or libaom will assume the
  * default behavior of allocating frame buffers internally.
  *
  * \param[in] ctx          Pointer to this instance's context
@@ -340,7 +340,7 @@
  * \param[in] cb_priv      Callback's private data
  *
  * \retval #VPX_CODEC_OK
- *     External frame buffers will be used by libvpx.
+ *     External frame buffers will be used by libaom.
  * \retval #VPX_CODEC_INVALID_PARAM
  *     One or more of the callbacks were NULL.
  * \retval #VPX_CODEC_ERROR
diff --git a/vpx/vpx_encoder.h b/aom/vpx_encoder.h
similarity index 100%
rename from vpx/vpx_encoder.h
rename to aom/vpx_encoder.h
diff --git a/vpx/vpx_frame_buffer.h b/aom/vpx_frame_buffer.h
similarity index 97%
rename from vpx/vpx_frame_buffer.h
rename to aom/vpx_frame_buffer.h
index 8adbe25..86945f7 100644
--- a/vpx/vpx_frame_buffer.h
+++ b/aom/vpx_frame_buffer.h
@@ -21,7 +21,7 @@
 
 #include "./vpx_integer.h"
 
-/*!\brief The maximum number of work buffers used by libvpx.
+/*!\brief The maximum number of work buffers used by libaom.
  *  Support maximum 4 threads to decode video in parallel.
  *  Each thread will use one work buffer.
  * TODO(hkuang): Add support to set number of worker threads dynamically.
diff --git a/vpx/vpx_image.h b/aom/vpx_image.h
similarity index 100%
rename from vpx/vpx_image.h
rename to aom/vpx_image.h
diff --git a/vpx/vpx_integer.h b/aom/vpx_integer.h
similarity index 100%
rename from vpx/vpx_integer.h
rename to aom/vpx_integer.h
diff --git a/vpx_dsp/add_noise.c b/aom_dsp/add_noise.c
similarity index 96%
rename from vpx_dsp/add_noise.c
rename to aom_dsp/add_noise.c
index 80b1af9..826d935 100644
--- a/vpx_dsp/add_noise.c
+++ b/aom_dsp/add_noise.c
@@ -14,8 +14,8 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
 
 void vpx_plane_add_noise_c(uint8_t *start, char *noise, char blackclamp[16],
                            char whiteclamp[16], char bothclamp[16],
diff --git a/vpx_dsp/arm/avg_neon.c b/aom_dsp/arm/avg_neon.c
similarity index 99%
rename from vpx_dsp/arm/avg_neon.c
rename to aom_dsp/arm/avg_neon.c
index 001517d..ff9cbb9 100644
--- a/vpx_dsp/arm/avg_neon.c
+++ b/aom_dsp/arm/avg_neon.c
@@ -14,7 +14,7 @@
 #include "./vpx_dsp_rtcd.h"
 #include "./vpx_config.h"
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 static INLINE unsigned int horizontal_add_u16x8(const uint16x8_t v_16x8) {
   const uint32x4_t a = vpaddlq_u16(v_16x8);
diff --git a/vpx_dsp/arm/bilinear_filter_media.asm b/aom_dsp/arm/bilinear_filter_media.asm
similarity index 100%
rename from vpx_dsp/arm/bilinear_filter_media.asm
rename to aom_dsp/arm/bilinear_filter_media.asm
diff --git a/vpx_dsp/arm/fwd_txfm_neon.c b/aom_dsp/arm/fwd_txfm_neon.c
similarity index 99%
rename from vpx_dsp/arm/fwd_txfm_neon.c
rename to aom_dsp/arm/fwd_txfm_neon.c
index 7cb2ba9..4763cdb 100644
--- a/vpx_dsp/arm/fwd_txfm_neon.c
+++ b/aom_dsp/arm/fwd_txfm_neon.c
@@ -11,7 +11,7 @@
 #include <arm_neon.h>
 
 #include "./vpx_config.h"
-#include "vpx_dsp/txfm_common.h"
+#include "aom_dsp/txfm_common.h"
 
 void vpx_fdct8x8_neon(const int16_t *input, int16_t *final_output, int stride) {
   int i;
diff --git a/vpx_dsp/arm/hadamard_neon.c b/aom_dsp/arm/hadamard_neon.c
similarity index 100%
rename from vpx_dsp/arm/hadamard_neon.c
rename to aom_dsp/arm/hadamard_neon.c
diff --git a/vpx_dsp/arm/idct16x16_1_add_neon.asm b/aom_dsp/arm/idct16x16_1_add_neon.asm
similarity index 100%
rename from vpx_dsp/arm/idct16x16_1_add_neon.asm
rename to aom_dsp/arm/idct16x16_1_add_neon.asm
diff --git a/vpx_dsp/arm/idct16x16_1_add_neon.c b/aom_dsp/arm/idct16x16_1_add_neon.c
similarity index 97%
rename from vpx_dsp/arm/idct16x16_1_add_neon.c
rename to aom_dsp/arm/idct16x16_1_add_neon.c
index 466b408..a37e53c 100644
--- a/vpx_dsp/arm/idct16x16_1_add_neon.c
+++ b/aom_dsp/arm/idct16x16_1_add_neon.c
@@ -10,8 +10,8 @@
 
 #include <arm_neon.h>
 
-#include "vpx_dsp/inv_txfm.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/inv_txfm.h"
+#include "aom_ports/mem.h"
 
 void vpx_idct16x16_1_add_neon(int16_t *input, uint8_t *dest, int dest_stride) {
   uint8x8_t d2u8, d3u8, d30u8, d31u8;
diff --git a/vpx_dsp/arm/idct16x16_add_neon.asm b/aom_dsp/arm/idct16x16_add_neon.asm
similarity index 100%
rename from vpx_dsp/arm/idct16x16_add_neon.asm
rename to aom_dsp/arm/idct16x16_add_neon.asm
diff --git a/vpx_dsp/arm/idct16x16_add_neon.c b/aom_dsp/arm/idct16x16_add_neon.c
similarity index 99%
rename from vpx_dsp/arm/idct16x16_add_neon.c
rename to aom_dsp/arm/idct16x16_add_neon.c
index 6c03aff..2bb92c6 100644
--- a/vpx_dsp/arm/idct16x16_add_neon.c
+++ b/aom_dsp/arm/idct16x16_add_neon.c
@@ -11,7 +11,7 @@
 #include <arm_neon.h>
 
 #include "./vpx_config.h"
-#include "vpx_dsp/txfm_common.h"
+#include "aom_dsp/txfm_common.h"
 
 static INLINE void TRANSPOSE8X8(int16x8_t *q8s16, int16x8_t *q9s16,
                                 int16x8_t *q10s16, int16x8_t *q11s16,
diff --git a/vpx_dsp/arm/idct16x16_neon.c b/aom_dsp/arm/idct16x16_neon.c
similarity index 99%
rename from vpx_dsp/arm/idct16x16_neon.c
rename to aom_dsp/arm/idct16x16_neon.c
index ecc263d..e205056 100644
--- a/vpx_dsp/arm/idct16x16_neon.c
+++ b/aom_dsp/arm/idct16x16_neon.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 void vpx_idct16x16_256_add_neon_pass1(const int16_t *input, int16_t *output,
                                       int output_stride);
diff --git a/vpx_dsp/arm/idct32x32_1_add_neon.asm b/aom_dsp/arm/idct32x32_1_add_neon.asm
similarity index 100%
rename from vpx_dsp/arm/idct32x32_1_add_neon.asm
rename to aom_dsp/arm/idct32x32_1_add_neon.asm
diff --git a/vpx_dsp/arm/idct32x32_1_add_neon.c b/aom_dsp/arm/idct32x32_1_add_neon.c
similarity index 98%
rename from vpx_dsp/arm/idct32x32_1_add_neon.c
rename to aom_dsp/arm/idct32x32_1_add_neon.c
index dab7d09..35bfc66 100644
--- a/vpx_dsp/arm/idct32x32_1_add_neon.c
+++ b/aom_dsp/arm/idct32x32_1_add_neon.c
@@ -12,8 +12,8 @@
 
 #include "./vpx_config.h"
 
-#include "vpx_dsp/inv_txfm.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/inv_txfm.h"
+#include "aom_ports/mem.h"
 
 static INLINE void LD_16x8(uint8_t *d, int d_stride, uint8x16_t *q8u8,
                            uint8x16_t *q9u8, uint8x16_t *q10u8,
diff --git a/vpx_dsp/arm/idct32x32_add_neon.asm b/aom_dsp/arm/idct32x32_add_neon.asm
similarity index 100%
rename from vpx_dsp/arm/idct32x32_add_neon.asm
rename to aom_dsp/arm/idct32x32_add_neon.asm
diff --git a/vpx_dsp/arm/idct32x32_add_neon.c b/aom_dsp/arm/idct32x32_add_neon.c
similarity index 99%
rename from vpx_dsp/arm/idct32x32_add_neon.c
rename to aom_dsp/arm/idct32x32_add_neon.c
index 88b3d01..644155c 100644
--- a/vpx_dsp/arm/idct32x32_add_neon.c
+++ b/aom_dsp/arm/idct32x32_add_neon.c
@@ -11,7 +11,7 @@
 #include <arm_neon.h>
 
 #include "./vpx_config.h"
-#include "vpx_dsp/txfm_common.h"
+#include "aom_dsp/txfm_common.h"
 
 #define LOAD_FROM_TRANSPOSED(prev, first, second) \
   q14s16 = vld1q_s16(trans_buf + first * 8);      \
diff --git a/vpx_dsp/arm/idct4x4_1_add_neon.asm b/aom_dsp/arm/idct4x4_1_add_neon.asm
similarity index 100%
rename from vpx_dsp/arm/idct4x4_1_add_neon.asm
rename to aom_dsp/arm/idct4x4_1_add_neon.asm
diff --git a/vpx_dsp/arm/idct4x4_1_add_neon.c b/aom_dsp/arm/idct4x4_1_add_neon.c
similarity index 95%
rename from vpx_dsp/arm/idct4x4_1_add_neon.c
rename to aom_dsp/arm/idct4x4_1_add_neon.c
index 9f999e9..0a2e827 100644
--- a/vpx_dsp/arm/idct4x4_1_add_neon.c
+++ b/aom_dsp/arm/idct4x4_1_add_neon.c
@@ -10,8 +10,8 @@
 
 #include <arm_neon.h>
 
-#include "vpx_dsp/inv_txfm.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/inv_txfm.h"
+#include "aom_ports/mem.h"
 
 void vpx_idct4x4_1_add_neon(int16_t *input, uint8_t *dest, int dest_stride) {
   uint8x8_t d6u8;
diff --git a/vpx_dsp/arm/idct4x4_add_neon.asm b/aom_dsp/arm/idct4x4_add_neon.asm
similarity index 100%
rename from vpx_dsp/arm/idct4x4_add_neon.asm
rename to aom_dsp/arm/idct4x4_add_neon.asm
diff --git a/vpx_dsp/arm/idct4x4_add_neon.c b/aom_dsp/arm/idct4x4_add_neon.c
similarity index 100%
rename from vpx_dsp/arm/idct4x4_add_neon.c
rename to aom_dsp/arm/idct4x4_add_neon.c
diff --git a/vpx_dsp/arm/idct8x8_1_add_neon.asm b/aom_dsp/arm/idct8x8_1_add_neon.asm
similarity index 100%
rename from vpx_dsp/arm/idct8x8_1_add_neon.asm
rename to aom_dsp/arm/idct8x8_1_add_neon.asm
diff --git a/vpx_dsp/arm/idct8x8_1_add_neon.c b/aom_dsp/arm/idct8x8_1_add_neon.c
similarity index 96%
rename from vpx_dsp/arm/idct8x8_1_add_neon.c
rename to aom_dsp/arm/idct8x8_1_add_neon.c
index e3db0b8..bda5998 100644
--- a/vpx_dsp/arm/idct8x8_1_add_neon.c
+++ b/aom_dsp/arm/idct8x8_1_add_neon.c
@@ -10,8 +10,8 @@
 
 #include <arm_neon.h>
 
-#include "vpx_dsp/inv_txfm.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/inv_txfm.h"
+#include "aom_ports/mem.h"
 
 void vpx_idct8x8_1_add_neon(int16_t *input, uint8_t *dest, int dest_stride) {
   uint8x8_t d2u8, d3u8, d30u8, d31u8;
diff --git a/vpx_dsp/arm/idct8x8_add_neon.asm b/aom_dsp/arm/idct8x8_add_neon.asm
similarity index 100%
rename from vpx_dsp/arm/idct8x8_add_neon.asm
rename to aom_dsp/arm/idct8x8_add_neon.asm
diff --git a/vpx_dsp/arm/idct8x8_add_neon.c b/aom_dsp/arm/idct8x8_add_neon.c
similarity index 99%
rename from vpx_dsp/arm/idct8x8_add_neon.c
rename to aom_dsp/arm/idct8x8_add_neon.c
index f1c2711..124c317 100644
--- a/vpx_dsp/arm/idct8x8_add_neon.c
+++ b/aom_dsp/arm/idct8x8_add_neon.c
@@ -11,7 +11,7 @@
 #include <arm_neon.h>
 
 #include "./vpx_config.h"
-#include "vpx_dsp/txfm_common.h"
+#include "aom_dsp/txfm_common.h"
 
 static INLINE void TRANSPOSE8X8(int16x8_t *q8s16, int16x8_t *q9s16,
                                 int16x8_t *q10s16, int16x8_t *q11s16,
diff --git a/vpx_dsp/arm/intrapred_neon.c b/aom_dsp/arm/intrapred_neon.c
similarity index 99%
rename from vpx_dsp/arm/intrapred_neon.c
rename to aom_dsp/arm/intrapred_neon.c
index 32dd1ba..3166a4e 100644
--- a/vpx_dsp/arm/intrapred_neon.c
+++ b/aom_dsp/arm/intrapred_neon.c
@@ -12,7 +12,7 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 //------------------------------------------------------------------------------
 // DC 4x4
diff --git a/vpx_dsp/arm/intrapred_neon_asm.asm b/aom_dsp/arm/intrapred_neon_asm.asm
similarity index 100%
rename from vpx_dsp/arm/intrapred_neon_asm.asm
rename to aom_dsp/arm/intrapred_neon_asm.asm
diff --git a/vpx_dsp/arm/loopfilter_16_neon.asm b/aom_dsp/arm/loopfilter_16_neon.asm
similarity index 100%
rename from vpx_dsp/arm/loopfilter_16_neon.asm
rename to aom_dsp/arm/loopfilter_16_neon.asm
diff --git a/vpx_dsp/arm/loopfilter_16_neon.c b/aom_dsp/arm/loopfilter_16_neon.c
similarity index 99%
rename from vpx_dsp/arm/loopfilter_16_neon.c
rename to aom_dsp/arm/loopfilter_16_neon.c
index 9607bb2..70087f9 100644
--- a/vpx_dsp/arm/loopfilter_16_neon.c
+++ b/aom_dsp/arm/loopfilter_16_neon.c
@@ -12,7 +12,7 @@
 
 #include "./vpx_dsp_rtcd.h"
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 static INLINE void loop_filter_neon_16(uint8x16_t qblimit,  // blimit
                                        uint8x16_t qlimit,   // limit
diff --git a/vpx_dsp/arm/loopfilter_4_neon.asm b/aom_dsp/arm/loopfilter_4_neon.asm
similarity index 100%
rename from vpx_dsp/arm/loopfilter_4_neon.asm
rename to aom_dsp/arm/loopfilter_4_neon.asm
diff --git a/vpx_dsp/arm/loopfilter_4_neon.c b/aom_dsp/arm/loopfilter_4_neon.c
similarity index 100%
rename from vpx_dsp/arm/loopfilter_4_neon.c
rename to aom_dsp/arm/loopfilter_4_neon.c
diff --git a/vpx_dsp/arm/loopfilter_8_neon.asm b/aom_dsp/arm/loopfilter_8_neon.asm
similarity index 100%
rename from vpx_dsp/arm/loopfilter_8_neon.asm
rename to aom_dsp/arm/loopfilter_8_neon.asm
diff --git a/vpx_dsp/arm/loopfilter_8_neon.c b/aom_dsp/arm/loopfilter_8_neon.c
similarity index 100%
rename from vpx_dsp/arm/loopfilter_8_neon.c
rename to aom_dsp/arm/loopfilter_8_neon.c
diff --git a/vpx_dsp/arm/loopfilter_mb_neon.asm b/aom_dsp/arm/loopfilter_mb_neon.asm
similarity index 100%
rename from vpx_dsp/arm/loopfilter_mb_neon.asm
rename to aom_dsp/arm/loopfilter_mb_neon.asm
diff --git a/vpx_dsp/arm/loopfilter_neon.c b/aom_dsp/arm/loopfilter_neon.c
similarity index 98%
rename from vpx_dsp/arm/loopfilter_neon.c
rename to aom_dsp/arm/loopfilter_neon.c
index 9129b5d..04c163a 100644
--- a/vpx_dsp/arm/loopfilter_neon.c
+++ b/aom_dsp/arm/loopfilter_neon.c
@@ -12,7 +12,7 @@
 
 #include "./vpx_dsp_rtcd.h"
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 void vpx_lpf_vertical_4_dual_neon(uint8_t *s, int p, const uint8_t *blimit0,
                                   const uint8_t *limit0, const uint8_t *thresh0,
diff --git a/vpx_dsp/arm/sad4d_neon.c b/aom_dsp/arm/sad4d_neon.c
similarity index 99%
rename from vpx_dsp/arm/sad4d_neon.c
rename to aom_dsp/arm/sad4d_neon.c
index dc20398..11f13be 100644
--- a/vpx_dsp/arm/sad4d_neon.c
+++ b/aom_dsp/arm/sad4d_neon.c
@@ -12,7 +12,7 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 static INLINE unsigned int horizontal_long_add_16x8(const uint16x8_t vec_lo,
                                                     const uint16x8_t vec_hi) {
diff --git a/vpx_dsp/arm/sad_media.asm b/aom_dsp/arm/sad_media.asm
similarity index 100%
rename from vpx_dsp/arm/sad_media.asm
rename to aom_dsp/arm/sad_media.asm
diff --git a/vpx_dsp/arm/sad_neon.c b/aom_dsp/arm/sad_neon.c
similarity index 99%
rename from vpx_dsp/arm/sad_neon.c
rename to aom_dsp/arm/sad_neon.c
index ff32287..19fa109 100644
--- a/vpx_dsp/arm/sad_neon.c
+++ b/aom_dsp/arm/sad_neon.c
@@ -12,7 +12,7 @@
 
 #include "./vpx_config.h"
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 unsigned int vpx_sad8x16_neon(unsigned char *src_ptr, int src_stride,
                               unsigned char *ref_ptr, int ref_stride) {
diff --git a/vpx_dsp/arm/save_reg_neon.asm b/aom_dsp/arm/save_reg_neon.asm
similarity index 100%
rename from vpx_dsp/arm/save_reg_neon.asm
rename to aom_dsp/arm/save_reg_neon.asm
diff --git a/vpx_dsp/arm/subpel_variance_media.c b/aom_dsp/arm/subpel_variance_media.c
similarity index 98%
rename from vpx_dsp/arm/subpel_variance_media.c
rename to aom_dsp/arm/subpel_variance_media.c
index ab53361..69b1b33 100644
--- a/vpx_dsp/arm/subpel_variance_media.c
+++ b/aom_dsp/arm/subpel_variance_media.c
@@ -10,8 +10,8 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_MEDIA
 static const int16_t bilinear_filters_media[8][2] = { { 128, 0 }, { 112, 16 },
diff --git a/vpx_dsp/arm/subpel_variance_neon.c b/aom_dsp/arm/subpel_variance_neon.c
similarity index 98%
rename from vpx_dsp/arm/subpel_variance_neon.c
rename to aom_dsp/arm/subpel_variance_neon.c
index f044e11..caa3f4a 100644
--- a/vpx_dsp/arm/subpel_variance_neon.c
+++ b/aom_dsp/arm/subpel_variance_neon.c
@@ -12,10 +12,10 @@
 #include "./vpx_dsp_rtcd.h"
 #include "./vpx_config.h"
 
-#include "vpx_ports/mem.h"
-#include "vpx/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom/vpx_integer.h"
 
-#include "vpx_dsp/variance.h"
+#include "aom_dsp/variance.h"
 
 static const uint8_t bilinear_filters[8][2] = {
   { 128, 0 }, { 112, 16 }, { 96, 32 }, { 80, 48 },
diff --git a/vpx_dsp/arm/subtract_neon.c b/aom_dsp/arm/subtract_neon.c
similarity index 98%
rename from vpx_dsp/arm/subtract_neon.c
rename to aom_dsp/arm/subtract_neon.c
index ce81fb6..ab7157c 100644
--- a/vpx_dsp/arm/subtract_neon.c
+++ b/aom_dsp/arm/subtract_neon.c
@@ -11,7 +11,7 @@
 #include <arm_neon.h>
 
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 void vpx_subtract_block_neon(int rows, int cols, int16_t *diff,
                              ptrdiff_t diff_stride, const uint8_t *src,
diff --git a/vpx_dsp/arm/variance_halfpixvar16x16_h_media.asm b/aom_dsp/arm/variance_halfpixvar16x16_h_media.asm
similarity index 100%
rename from vpx_dsp/arm/variance_halfpixvar16x16_h_media.asm
rename to aom_dsp/arm/variance_halfpixvar16x16_h_media.asm
diff --git a/vpx_dsp/arm/variance_halfpixvar16x16_hv_media.asm b/aom_dsp/arm/variance_halfpixvar16x16_hv_media.asm
similarity index 100%
rename from vpx_dsp/arm/variance_halfpixvar16x16_hv_media.asm
rename to aom_dsp/arm/variance_halfpixvar16x16_hv_media.asm
diff --git a/vpx_dsp/arm/variance_halfpixvar16x16_v_media.asm b/aom_dsp/arm/variance_halfpixvar16x16_v_media.asm
similarity index 100%
rename from vpx_dsp/arm/variance_halfpixvar16x16_v_media.asm
rename to aom_dsp/arm/variance_halfpixvar16x16_v_media.asm
diff --git a/vpx_dsp/arm/variance_media.asm b/aom_dsp/arm/variance_media.asm
similarity index 100%
rename from vpx_dsp/arm/variance_media.asm
rename to aom_dsp/arm/variance_media.asm
diff --git a/vpx_dsp/arm/variance_neon.c b/aom_dsp/arm/variance_neon.c
similarity index 99%
rename from vpx_dsp/arm/variance_neon.c
rename to aom_dsp/arm/variance_neon.c
index f469afc..fcf6e45 100644
--- a/vpx_dsp/arm/variance_neon.c
+++ b/aom_dsp/arm/variance_neon.c
@@ -13,8 +13,8 @@
 #include "./vpx_dsp_rtcd.h"
 #include "./vpx_config.h"
 
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
 
 static INLINE int horizontal_add_s16x8(const int16x8_t v_16x8) {
   const int32x4_t a = vpaddlq_s16(v_16x8);
diff --git a/vpx_dsp/arm/vpx_convolve8_avg_neon.c b/aom_dsp/arm/vpx_convolve8_avg_neon.c
similarity index 99%
rename from vpx_dsp/arm/vpx_convolve8_avg_neon.c
rename to aom_dsp/arm/vpx_convolve8_avg_neon.c
index 69cb284..c6b1831 100644
--- a/vpx_dsp/arm/vpx_convolve8_avg_neon.c
+++ b/aom_dsp/arm/vpx_convolve8_avg_neon.c
@@ -13,8 +13,8 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
 
 static INLINE int32x4_t MULTIPLY_BY_Q0(int16x4_t dsrc0, int16x4_t dsrc1,
                                        int16x4_t dsrc2, int16x4_t dsrc3,
diff --git a/vpx_dsp/arm/vpx_convolve8_avg_neon_asm.asm b/aom_dsp/arm/vpx_convolve8_avg_neon_asm.asm
similarity index 100%
rename from vpx_dsp/arm/vpx_convolve8_avg_neon_asm.asm
rename to aom_dsp/arm/vpx_convolve8_avg_neon_asm.asm
diff --git a/vpx_dsp/arm/vpx_convolve8_neon.c b/aom_dsp/arm/vpx_convolve8_neon.c
similarity index 99%
rename from vpx_dsp/arm/vpx_convolve8_neon.c
rename to aom_dsp/arm/vpx_convolve8_neon.c
index 5145256..b84be93 100644
--- a/vpx_dsp/arm/vpx_convolve8_neon.c
+++ b/aom_dsp/arm/vpx_convolve8_neon.c
@@ -13,8 +13,8 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
 
 static INLINE int32x4_t MULTIPLY_BY_Q0(int16x4_t dsrc0, int16x4_t dsrc1,
                                        int16x4_t dsrc2, int16x4_t dsrc3,
diff --git a/vpx_dsp/arm/vpx_convolve8_neon_asm.asm b/aom_dsp/arm/vpx_convolve8_neon_asm.asm
similarity index 100%
rename from vpx_dsp/arm/vpx_convolve8_neon_asm.asm
rename to aom_dsp/arm/vpx_convolve8_neon_asm.asm
diff --git a/vpx_dsp/arm/vpx_convolve_avg_neon.c b/aom_dsp/arm/vpx_convolve_avg_neon.c
similarity index 98%
rename from vpx_dsp/arm/vpx_convolve_avg_neon.c
rename to aom_dsp/arm/vpx_convolve_avg_neon.c
index abc2511..a04d384 100644
--- a/vpx_dsp/arm/vpx_convolve_avg_neon.c
+++ b/aom_dsp/arm/vpx_convolve_avg_neon.c
@@ -11,7 +11,7 @@
 #include <arm_neon.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 void vpx_convolve_avg_neon(const uint8_t *src,    // r0
                            ptrdiff_t src_stride,  // r1
diff --git a/vpx_dsp/arm/vpx_convolve_avg_neon_asm.asm b/aom_dsp/arm/vpx_convolve_avg_neon_asm.asm
similarity index 100%
rename from vpx_dsp/arm/vpx_convolve_avg_neon_asm.asm
rename to aom_dsp/arm/vpx_convolve_avg_neon_asm.asm
diff --git a/vpx_dsp/arm/vpx_convolve_copy_neon.c b/aom_dsp/arm/vpx_convolve_copy_neon.c
similarity index 98%
rename from vpx_dsp/arm/vpx_convolve_copy_neon.c
rename to aom_dsp/arm/vpx_convolve_copy_neon.c
index fec189e..8000eb7 100644
--- a/vpx_dsp/arm/vpx_convolve_copy_neon.c
+++ b/aom_dsp/arm/vpx_convolve_copy_neon.c
@@ -11,7 +11,7 @@
 #include <arm_neon.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 void vpx_convolve_copy_neon(const uint8_t *src,    // r0
                             ptrdiff_t src_stride,  // r1
diff --git a/vpx_dsp/arm/vpx_convolve_copy_neon_asm.asm b/aom_dsp/arm/vpx_convolve_copy_neon_asm.asm
similarity index 100%
rename from vpx_dsp/arm/vpx_convolve_copy_neon_asm.asm
rename to aom_dsp/arm/vpx_convolve_copy_neon_asm.asm
diff --git a/vpx_dsp/arm/vpx_convolve_neon.c b/aom_dsp/arm/vpx_convolve_neon.c
similarity index 97%
rename from vpx_dsp/arm/vpx_convolve_neon.c
rename to aom_dsp/arm/vpx_convolve_neon.c
index c2d5895..297b64b 100644
--- a/vpx_dsp/arm/vpx_convolve_neon.c
+++ b/aom_dsp/arm/vpx_convolve_neon.c
@@ -11,8 +11,8 @@
 #include <assert.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
 
 void vpx_convolve8_neon(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst,
                         ptrdiff_t dst_stride, const int16_t *filter_x,
diff --git a/vpx_dsp/avg.c b/aom_dsp/avg.c
similarity index 99%
rename from vpx_dsp/avg.c
rename to aom_dsp/avg.c
index b0c5e98..d3e4578 100644
--- a/vpx_dsp/avg.c
+++ b/aom_dsp/avg.c
@@ -10,7 +10,7 @@
 #include <stdlib.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
 unsigned int vpx_avg_8x8_c(const uint8_t *src, int stride) {
   int i, j;
diff --git a/vpx_dsp/bitreader.c b/aom_dsp/bitreader.c
similarity index 93%
rename from vpx_dsp/bitreader.c
rename to aom_dsp/bitreader.c
index 90cbbba..0942005 100644
--- a/vpx_dsp/bitreader.c
+++ b/aom_dsp/bitreader.c
@@ -11,12 +11,12 @@
 
 #include "./vpx_config.h"
 
-#include "vpx_dsp/bitreader.h"
-#include "vpx_dsp/prob.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_util/endian_inl.h"
+#include "aom_dsp/bitreader.h"
+#include "aom_dsp/prob.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_util/endian_inl.h"
 
 int vpx_reader_init(vpx_reader *r, const uint8_t *buffer, size_t size,
                     vpx_decrypt_cb decrypt_cb, void *decrypt_state) {
diff --git a/vpx_dsp/bitreader.h b/aom_dsp/bitreader.h
similarity index 96%
rename from vpx_dsp/bitreader.h
rename to aom_dsp/bitreader.h
index 1012454..d211511 100644
--- a/vpx_dsp/bitreader.h
+++ b/aom_dsp/bitreader.h
@@ -21,11 +21,11 @@
 #include <stdio.h>
 #endif  // CONFIG_BITSTREAM_DEBUG
 
-#include "vpx_ports/mem.h"
-#include "vpx/vp8dx.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/prob.h"
-#include "vpx_util/debug_util.h"
+#include "aom_ports/mem.h"
+#include "aom/vp8dx.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/prob.h"
+#include "aom_util/debug_util.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/bitreader_buffer.c b/aom_dsp/bitreader_buffer.c
similarity index 100%
rename from vpx_dsp/bitreader_buffer.c
rename to aom_dsp/bitreader_buffer.c
diff --git a/vpx_dsp/bitreader_buffer.h b/aom_dsp/bitreader_buffer.h
similarity index 97%
rename from vpx_dsp/bitreader_buffer.h
rename to aom_dsp/bitreader_buffer.h
index 8a48a95..5e557ea 100644
--- a/vpx_dsp/bitreader_buffer.h
+++ b/aom_dsp/bitreader_buffer.h
@@ -13,7 +13,7 @@
 
 #include <limits.h>
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/bitwriter.c b/aom_dsp/bitwriter.c
similarity index 100%
rename from vpx_dsp/bitwriter.c
rename to aom_dsp/bitwriter.c
diff --git a/vpx_dsp/bitwriter.h b/aom_dsp/bitwriter.h
similarity index 95%
rename from vpx_dsp/bitwriter.h
rename to aom_dsp/bitwriter.h
index 5e952a8..5b3634a 100644
--- a/vpx_dsp/bitwriter.h
+++ b/aom_dsp/bitwriter.h
@@ -11,9 +11,9 @@
 #ifndef VPX_DSP_BITWRITER_H_
 #define VPX_DSP_BITWRITER_H_
 
-#include "vpx_ports/mem.h"
-#include "vpx_dsp/prob.h"
-#include "vpx_util/debug_util.h"
+#include "aom_ports/mem.h"
+#include "aom_dsp/prob.h"
+#include "aom_util/debug_util.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/bitwriter_buffer.c b/aom_dsp/bitwriter_buffer.c
similarity index 100%
rename from vpx_dsp/bitwriter_buffer.c
rename to aom_dsp/bitwriter_buffer.c
diff --git a/vpx_dsp/bitwriter_buffer.h b/aom_dsp/bitwriter_buffer.h
similarity index 96%
rename from vpx_dsp/bitwriter_buffer.h
rename to aom_dsp/bitwriter_buffer.h
index a123a2f..2406abd 100644
--- a/vpx_dsp/bitwriter_buffer.h
+++ b/aom_dsp/bitwriter_buffer.h
@@ -11,7 +11,7 @@
 #ifndef VPX_DSP_BITWRITER_BUFFER_H_
 #define VPX_DSP_BITWRITER_BUFFER_H_
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/blend.h b/aom_dsp/blend.h
similarity index 97%
rename from vpx_dsp/blend.h
rename to aom_dsp/blend.h
index 2ceb4c7..e43149d 100644
--- a/vpx_dsp/blend.h
+++ b/aom_dsp/blend.h
@@ -11,7 +11,7 @@
 #ifndef VPX_DSP_BLEND_H_
 #define VPX_DSP_BLEND_H_
 
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
 // Various blending functions and macros.
 // See also the vpx_blend_* functions in vpx_dsp_rtcd.h
diff --git a/vpx_dsp/blend_a64_hmask.c b/aom_dsp/blend_a64_hmask.c
similarity index 94%
rename from vpx_dsp/blend_a64_hmask.c
rename to aom_dsp/blend_a64_hmask.c
index 46d73ff..cce5d88 100644
--- a/vpx_dsp/blend_a64_hmask.c
+++ b/aom_dsp/blend_a64_hmask.c
@@ -10,10 +10,10 @@
 
 #include <assert.h>
 
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/blend.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/blend.h"
 
 #include "./vpx_dsp_rtcd.h"
 
diff --git a/vpx_dsp/blend_a64_mask.c b/aom_dsp/blend_a64_mask.c
similarity index 96%
rename from vpx_dsp/blend_a64_mask.c
rename to aom_dsp/blend_a64_mask.c
index eee544c..939e729 100644
--- a/vpx_dsp/blend_a64_mask.c
+++ b/aom_dsp/blend_a64_mask.c
@@ -10,15 +10,15 @@
 
 #include <assert.h>
 
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
-#include "vpx_dsp/blend.h"
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom_dsp/blend.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 #include "./vpx_dsp_rtcd.h"
 
 // Blending with alpha mask. Mask values come from the range [0, 64],
-// as described for VPX_BLEND_A64 in vpx_dsp/blned.h. src0 or src1 can
+// as described for VPX_BLEND_A64 in aom_dsp/blned.h. src0 or src1 can
 // be the same as dst, or dst can be different from both sources.
 
 void vpx_blend_a64_mask_c(uint8_t *dst, uint32_t dst_stride,
diff --git a/vpx_dsp/blend_a64_vmask.c b/aom_dsp/blend_a64_vmask.c
similarity index 94%
rename from vpx_dsp/blend_a64_vmask.c
rename to aom_dsp/blend_a64_vmask.c
index 4a2ced7..b22dcd1 100644
--- a/vpx_dsp/blend_a64_vmask.c
+++ b/aom_dsp/blend_a64_vmask.c
@@ -10,10 +10,10 @@
 
 #include <assert.h>
 
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/blend.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/blend.h"
 
 #include "./vpx_dsp_rtcd.h"
 
diff --git a/vpx_dsp/deblock.c b/aom_dsp/deblock.c
similarity index 99%
rename from vpx_dsp/deblock.c
rename to aom_dsp/deblock.c
index 589b124..66995c1 100644
--- a/vpx_dsp/deblock.c
+++ b/aom_dsp/deblock.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 #include <stdlib.h>
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 const int16_t vpx_rv[] = {
   8,  5,  2,  2,  8,  12, 4,  9,  8,  3,  0,  3,  9,  0,  0,  0,  8,  3,  14,
diff --git a/vpx_dsp/fastssim.c b/aom_dsp/fastssim.c
similarity index 99%
rename from vpx_dsp/fastssim.c
rename to aom_dsp/fastssim.c
index 4d5eb5a..1bdec95 100644
--- a/vpx_dsp/fastssim.c
+++ b/aom_dsp/fastssim.c
@@ -16,8 +16,8 @@
 #include <string.h>
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/ssim.h"
-#include "vpx_ports/system_state.h"
+#include "aom_dsp/ssim.h"
+#include "aom_ports/system_state.h"
 
 typedef struct fs_level fs_level;
 typedef struct fs_ctx fs_ctx;
diff --git a/vpx_dsp/fwd_txfm.c b/aom_dsp/fwd_txfm.c
similarity index 99%
rename from vpx_dsp/fwd_txfm.c
rename to aom_dsp/fwd_txfm.c
index 4e7d405..aecaa93 100644
--- a/vpx_dsp/fwd_txfm.c
+++ b/aom_dsp/fwd_txfm.c
@@ -9,7 +9,7 @@
  */
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/fwd_txfm.h"
+#include "aom_dsp/fwd_txfm.h"
 
 void vpx_fdct4x4_c(const int16_t *input, tran_low_t *output, int stride) {
   // The 2D transform is done with two passes which are actually pretty
@@ -744,7 +744,7 @@
     for (j = 0; j < 32; ++j)
       // TODO(cd): see quality impact of only doing
       //           output[j * 32 + i] = (temp_out[j] + 1) >> 2;
-      //           PS: also change code in vpx_dsp/x86/vpx_dct_sse2.c
+      //           PS: also change code in aom_dsp/x86/vpx_dct_sse2.c
       output[j * 32 + i] = (temp_out[j] + 1 + (temp_out[j] > 0)) >> 2;
   }
 
diff --git a/vpx_dsp/fwd_txfm.h b/aom_dsp/fwd_txfm.h
similarity index 96%
rename from vpx_dsp/fwd_txfm.h
rename to aom_dsp/fwd_txfm.h
index 29e139c..b874dd4 100644
--- a/vpx_dsp/fwd_txfm.h
+++ b/aom_dsp/fwd_txfm.h
@@ -11,7 +11,7 @@
 #ifndef VPX_DSP_FWD_TXFM_H_
 #define VPX_DSP_FWD_TXFM_H_
 
-#include "vpx_dsp/txfm_common.h"
+#include "aom_dsp/txfm_common.h"
 
 static INLINE tran_high_t fdct_round_shift(tran_high_t input) {
   tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS);
diff --git a/vpx_dsp/intrapred.c b/aom_dsp/intrapred.c
similarity index 99%
rename from vpx_dsp/intrapred.c
rename to aom_dsp/intrapred.c
index 4179e0f..b57ba71 100644
--- a/vpx_dsp/intrapred.c
+++ b/aom_dsp/intrapred.c
@@ -11,8 +11,8 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
 
 #define DST(x, y) dst[(x) + (y)*stride]
 #define AVG3(a, b, c) (((a) + 2 * (b) + (c) + 2) >> 2)
diff --git a/vpx_dsp/inv_txfm.c b/aom_dsp/inv_txfm.c
similarity index 99%
rename from vpx_dsp/inv_txfm.c
rename to aom_dsp/inv_txfm.c
index d5be32e..6f92bee 100644
--- a/vpx_dsp/inv_txfm.c
+++ b/aom_dsp/inv_txfm.c
@@ -12,7 +12,7 @@
 #include <string.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/inv_txfm.h"
+#include "aom_dsp/inv_txfm.h"
 
 void vpx_iwht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride) {
   /* 4-point reversible, orthonormal inverse Walsh-Hadamard in 3.5 adds,
diff --git a/vpx_dsp/inv_txfm.h b/aom_dsp/inv_txfm.h
similarity index 98%
rename from vpx_dsp/inv_txfm.h
rename to aom_dsp/inv_txfm.h
index 0f31a79..6865eaf 100644
--- a/vpx_dsp/inv_txfm.h
+++ b/aom_dsp/inv_txfm.h
@@ -14,8 +14,8 @@
 #include <assert.h>
 
 #include "./vpx_config.h"
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/txfm_common.h"
+#include "aom_ports/mem.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/loopfilter.c b/aom_dsp/loopfilter.c
similarity index 99%
rename from vpx_dsp/loopfilter.c
rename to aom_dsp/loopfilter.c
index 40f02b4..53d028c 100644
--- a/vpx_dsp/loopfilter.c
+++ b/aom_dsp/loopfilter.c
@@ -12,8 +12,8 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
 
 static INLINE int8_t signed_char_clamp(int t) {
   return (int8_t)clamp(t, -128, 127);
diff --git a/vpx_dsp/mips/add_noise_msa.c b/aom_dsp/mips/add_noise_msa.c
similarity index 100%
rename from vpx_dsp/mips/add_noise_msa.c
rename to aom_dsp/mips/add_noise_msa.c
diff --git a/vpx_dsp/mips/avg_msa.c b/aom_dsp/mips/avg_msa.c
similarity index 97%
rename from vpx_dsp/mips/avg_msa.c
rename to aom_dsp/mips/avg_msa.c
index 52a24ed..5896708 100644
--- a/vpx_dsp/mips/avg_msa.c
+++ b/aom_dsp/mips/avg_msa.c
@@ -9,7 +9,7 @@
  */
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/macros_msa.h"
+#include "aom_dsp/mips/macros_msa.h"
 
 uint32_t vpx_avg_8x8_msa(const uint8_t *src, int32_t src_stride) {
   uint32_t sum_out;
diff --git a/vpx_dsp/mips/common_dspr2.c b/aom_dsp/mips/common_dspr2.c
similarity index 95%
rename from vpx_dsp/mips/common_dspr2.c
rename to aom_dsp/mips/common_dspr2.c
index b22f084..268bbcd 100644
--- a/vpx_dsp/mips/common_dspr2.c
+++ b/aom_dsp/mips/common_dspr2.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/mips/common_dspr2.h"
+#include "aom_dsp/mips/common_dspr2.h"
 
 #if HAVE_DSPR2
 uint8_t vpx_ff_cropTbl_a[256 + 2 * CROP_WIDTH];
diff --git a/vpx_dsp/mips/common_dspr2.h b/aom_dsp/mips/common_dspr2.h
similarity index 93%
rename from vpx_dsp/mips/common_dspr2.h
rename to aom_dsp/mips/common_dspr2.h
index 0a42f5c..1da490a 100644
--- a/vpx_dsp/mips/common_dspr2.h
+++ b/aom_dsp/mips/common_dspr2.h
@@ -13,7 +13,7 @@
 
 #include <assert.h>
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -21,7 +21,7 @@
 #if HAVE_DSPR2
 #define CROP_WIDTH 512
 
-extern uint8_t *vpx_ff_cropTbl;  // From "vpx_dsp/mips/intrapred4_dspr2.c"
+extern uint8_t *vpx_ff_cropTbl;  // From "aom_dsp/mips/intrapred4_dspr2.c"
 
 static INLINE void prefetch_load(const unsigned char *src) {
   __asm__ __volatile__("pref   0,  0(%[src])   \n\t" : : [src] "r"(src));
diff --git a/vpx_dsp/mips/convolve2_avg_dspr2.c b/aom_dsp/mips/convolve2_avg_dspr2.c
similarity index 98%
rename from vpx_dsp/mips/convolve2_avg_dspr2.c
rename to aom_dsp/mips/convolve2_avg_dspr2.c
index ae88edd..b73eba2 100644
--- a/vpx_dsp/mips/convolve2_avg_dspr2.c
+++ b/aom_dsp/mips/convolve2_avg_dspr2.c
@@ -12,10 +12,10 @@
 #include <stdio.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/convolve_common_dspr2.h"
-#include "vpx_dsp/vpx_convolve.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/mips/convolve_common_dspr2.h"
+#include "aom_dsp/vpx_convolve.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 static void convolve_bi_avg_vert_4_dspr2(const uint8_t *src, int32_t src_stride,
diff --git a/vpx_dsp/mips/convolve2_avg_horiz_dspr2.c b/aom_dsp/mips/convolve2_avg_horiz_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/convolve2_avg_horiz_dspr2.c
rename to aom_dsp/mips/convolve2_avg_horiz_dspr2.c
index e944207..765c902 100644
--- a/vpx_dsp/mips/convolve2_avg_horiz_dspr2.c
+++ b/aom_dsp/mips/convolve2_avg_horiz_dspr2.c
@@ -12,10 +12,10 @@
 #include <stdio.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/convolve_common_dspr2.h"
-#include "vpx_dsp/vpx_convolve.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/mips/convolve_common_dspr2.h"
+#include "aom_dsp/vpx_convolve.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 static void convolve_bi_avg_horiz_4_dspr2(const uint8_t *src,
diff --git a/vpx_dsp/mips/convolve2_dspr2.c b/aom_dsp/mips/convolve2_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/convolve2_dspr2.c
rename to aom_dsp/mips/convolve2_dspr2.c
index e355ba3..78ee6e0 100644
--- a/vpx_dsp/mips/convolve2_dspr2.c
+++ b/aom_dsp/mips/convolve2_dspr2.c
@@ -12,10 +12,10 @@
 #include <stdio.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/convolve_common_dspr2.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/vpx_filter.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/mips/convolve_common_dspr2.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_filter.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 static void convolve_bi_horiz_4_transposed_dspr2(
diff --git a/vpx_dsp/mips/convolve2_horiz_dspr2.c b/aom_dsp/mips/convolve2_horiz_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/convolve2_horiz_dspr2.c
rename to aom_dsp/mips/convolve2_horiz_dspr2.c
index 5cc06b5..0d6ebea 100644
--- a/vpx_dsp/mips/convolve2_horiz_dspr2.c
+++ b/aom_dsp/mips/convolve2_horiz_dspr2.c
@@ -12,10 +12,10 @@
 #include <stdio.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/convolve_common_dspr2.h"
-#include "vpx_dsp/vpx_convolve.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/mips/convolve_common_dspr2.h"
+#include "aom_dsp/vpx_convolve.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 static void convolve_bi_horiz_4_dspr2(const uint8_t *src, int32_t src_stride,
diff --git a/vpx_dsp/mips/convolve2_vert_dspr2.c b/aom_dsp/mips/convolve2_vert_dspr2.c
similarity index 98%
rename from vpx_dsp/mips/convolve2_vert_dspr2.c
rename to aom_dsp/mips/convolve2_vert_dspr2.c
index eb1975e..a9d0cbf 100644
--- a/vpx_dsp/mips/convolve2_vert_dspr2.c
+++ b/aom_dsp/mips/convolve2_vert_dspr2.c
@@ -12,10 +12,10 @@
 #include <stdio.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/convolve_common_dspr2.h"
-#include "vpx_dsp/vpx_convolve.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/mips/convolve_common_dspr2.h"
+#include "aom_dsp/vpx_convolve.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 static void convolve_bi_vert_4_dspr2(const uint8_t *src, int32_t src_stride,
diff --git a/vpx_dsp/mips/convolve8_avg_dspr2.c b/aom_dsp/mips/convolve8_avg_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/convolve8_avg_dspr2.c
rename to aom_dsp/mips/convolve8_avg_dspr2.c
index 3181229..8baf33a 100644
--- a/vpx_dsp/mips/convolve8_avg_dspr2.c
+++ b/aom_dsp/mips/convolve8_avg_dspr2.c
@@ -12,10 +12,10 @@
 #include <stdio.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/convolve_common_dspr2.h"
-#include "vpx_dsp/vpx_convolve.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/mips/convolve_common_dspr2.h"
+#include "aom_dsp/vpx_convolve.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 static void convolve_avg_vert_4_dspr2(const uint8_t *src, int32_t src_stride,
diff --git a/vpx_dsp/mips/convolve8_avg_horiz_dspr2.c b/aom_dsp/mips/convolve8_avg_horiz_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/convolve8_avg_horiz_dspr2.c
rename to aom_dsp/mips/convolve8_avg_horiz_dspr2.c
index 9a9bab2..d732d2e 100644
--- a/vpx_dsp/mips/convolve8_avg_horiz_dspr2.c
+++ b/aom_dsp/mips/convolve8_avg_horiz_dspr2.c
@@ -12,10 +12,10 @@
 #include <stdio.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/convolve_common_dspr2.h"
-#include "vpx_dsp/vpx_convolve.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/mips/convolve_common_dspr2.h"
+#include "aom_dsp/vpx_convolve.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 static void convolve_avg_horiz_4_dspr2(const uint8_t *src, int32_t src_stride,
diff --git a/vpx_dsp/mips/convolve8_dspr2.c b/aom_dsp/mips/convolve8_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/convolve8_dspr2.c
rename to aom_dsp/mips/convolve8_dspr2.c
index 789ec8d..09a9083 100644
--- a/vpx_dsp/mips/convolve8_dspr2.c
+++ b/aom_dsp/mips/convolve8_dspr2.c
@@ -12,10 +12,10 @@
 #include <stdio.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/convolve_common_dspr2.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/vpx_filter.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/mips/convolve_common_dspr2.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_filter.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 static void convolve_horiz_4_transposed_dspr2(const uint8_t *src,
diff --git a/vpx_dsp/mips/convolve8_horiz_dspr2.c b/aom_dsp/mips/convolve8_horiz_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/convolve8_horiz_dspr2.c
rename to aom_dsp/mips/convolve8_horiz_dspr2.c
index 196a0a2..66692be 100644
--- a/vpx_dsp/mips/convolve8_horiz_dspr2.c
+++ b/aom_dsp/mips/convolve8_horiz_dspr2.c
@@ -12,10 +12,10 @@
 #include <stdio.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/convolve_common_dspr2.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/vpx_filter.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/mips/convolve_common_dspr2.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_filter.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 static void convolve_horiz_4_dspr2(const uint8_t *src, int32_t src_stride,
diff --git a/vpx_dsp/mips/convolve8_vert_dspr2.c b/aom_dsp/mips/convolve8_vert_dspr2.c
similarity index 98%
rename from vpx_dsp/mips/convolve8_vert_dspr2.c
rename to aom_dsp/mips/convolve8_vert_dspr2.c
index ad107d5..1594f10 100644
--- a/vpx_dsp/mips/convolve8_vert_dspr2.c
+++ b/aom_dsp/mips/convolve8_vert_dspr2.c
@@ -12,10 +12,10 @@
 #include <stdio.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/convolve_common_dspr2.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/vpx_filter.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/mips/convolve_common_dspr2.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_filter.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 static void convolve_vert_4_dspr2(const uint8_t *src, int32_t src_stride,
diff --git a/vpx_dsp/mips/convolve_common_dspr2.h b/aom_dsp/mips/convolve_common_dspr2.h
similarity index 96%
rename from vpx_dsp/mips/convolve_common_dspr2.h
rename to aom_dsp/mips/convolve_common_dspr2.h
index 4eee3bd..b650019 100644
--- a/vpx_dsp/mips/convolve_common_dspr2.h
+++ b/aom_dsp/mips/convolve_common_dspr2.h
@@ -14,8 +14,8 @@
 #include <assert.h>
 
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/mips/common_dspr2.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/mips/common_dspr2.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/mips/deblock_msa.c b/aom_dsp/mips/deblock_msa.c
similarity index 100%
rename from vpx_dsp/mips/deblock_msa.c
rename to aom_dsp/mips/deblock_msa.c
diff --git a/vpx_dsp/mips/fwd_dct32x32_msa.c b/aom_dsp/mips/fwd_dct32x32_msa.c
similarity index 99%
rename from vpx_dsp/mips/fwd_dct32x32_msa.c
rename to aom_dsp/mips/fwd_dct32x32_msa.c
index e41a904..9dcde12 100644
--- a/vpx_dsp/mips/fwd_dct32x32_msa.c
+++ b/aom_dsp/mips/fwd_dct32x32_msa.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/mips/fwd_txfm_msa.h"
+#include "aom_dsp/mips/fwd_txfm_msa.h"
 
 static void fdct8x32_1d_column_load_butterfly(const int16_t *input,
                                               int32_t src_stride,
diff --git a/vpx_dsp/mips/fwd_txfm_msa.c b/aom_dsp/mips/fwd_txfm_msa.c
similarity index 99%
rename from vpx_dsp/mips/fwd_txfm_msa.c
rename to aom_dsp/mips/fwd_txfm_msa.c
index cb3d628..c95c1d0 100644
--- a/vpx_dsp/mips/fwd_txfm_msa.c
+++ b/aom_dsp/mips/fwd_txfm_msa.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/mips/fwd_txfm_msa.h"
+#include "aom_dsp/mips/fwd_txfm_msa.h"
 
 void fdct8x16_1d_column(const int16_t *input, int16_t *tmp_ptr,
                         int32_t src_stride) {
diff --git a/vpx_dsp/mips/fwd_txfm_msa.h b/aom_dsp/mips/fwd_txfm_msa.h
similarity index 99%
rename from vpx_dsp/mips/fwd_txfm_msa.h
rename to aom_dsp/mips/fwd_txfm_msa.h
index 6458dec..0911c3e 100644
--- a/vpx_dsp/mips/fwd_txfm_msa.h
+++ b/aom_dsp/mips/fwd_txfm_msa.h
@@ -11,8 +11,8 @@
 #ifndef VPX_DSP_MIPS_FWD_TXFM_MSA_H_
 #define VPX_DSP_MIPS_FWD_TXFM_MSA_H_
 
-#include "vpx_dsp/mips/txfm_macros_msa.h"
-#include "vpx_dsp/txfm_common.h"
+#include "aom_dsp/mips/txfm_macros_msa.h"
+#include "aom_dsp/txfm_common.h"
 
 #define LD_HADD(psrc, stride)                                                  \
   ({                                                                           \
diff --git a/vpx_dsp/mips/idct16x16_msa.c b/aom_dsp/mips/idct16x16_msa.c
similarity index 99%
rename from vpx_dsp/mips/idct16x16_msa.c
rename to aom_dsp/mips/idct16x16_msa.c
index 1cbeb35..977d794 100644
--- a/vpx_dsp/mips/idct16x16_msa.c
+++ b/aom_dsp/mips/idct16x16_msa.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/mips/inv_txfm_msa.h"
+#include "aom_dsp/mips/inv_txfm_msa.h"
 
 void vpx_idct16_1d_rows_msa(const int16_t *input, int16_t *output) {
   v8i16 loc0, loc1, loc2, loc3;
diff --git a/vpx_dsp/mips/idct32x32_msa.c b/aom_dsp/mips/idct32x32_msa.c
similarity index 99%
rename from vpx_dsp/mips/idct32x32_msa.c
rename to aom_dsp/mips/idct32x32_msa.c
index ed5cef18..e090c62 100644
--- a/vpx_dsp/mips/idct32x32_msa.c
+++ b/aom_dsp/mips/idct32x32_msa.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/mips/inv_txfm_msa.h"
+#include "aom_dsp/mips/inv_txfm_msa.h"
 
 static void idct32x8_row_transpose_store(const int16_t *input,
                                          int16_t *tmp_buf) {
diff --git a/vpx_dsp/mips/idct4x4_msa.c b/aom_dsp/mips/idct4x4_msa.c
similarity index 98%
rename from vpx_dsp/mips/idct4x4_msa.c
rename to aom_dsp/mips/idct4x4_msa.c
index 50e8248..956b5f5 100644
--- a/vpx_dsp/mips/idct4x4_msa.c
+++ b/aom_dsp/mips/idct4x4_msa.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/mips/inv_txfm_msa.h"
+#include "aom_dsp/mips/inv_txfm_msa.h"
 
 void vpx_iwht4x4_16_add_msa(const int16_t *input, uint8_t *dst,
                             int32_t dst_stride) {
diff --git a/vpx_dsp/mips/idct8x8_msa.c b/aom_dsp/mips/idct8x8_msa.c
similarity index 98%
rename from vpx_dsp/mips/idct8x8_msa.c
rename to aom_dsp/mips/idct8x8_msa.c
index c06330b..420433f 100644
--- a/vpx_dsp/mips/idct8x8_msa.c
+++ b/aom_dsp/mips/idct8x8_msa.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/mips/inv_txfm_msa.h"
+#include "aom_dsp/mips/inv_txfm_msa.h"
 
 void vpx_idct8x8_64_add_msa(const int16_t *input, uint8_t *dst,
                             int32_t dst_stride) {
diff --git a/vpx_dsp/mips/intrapred16_dspr2.c b/aom_dsp/mips/intrapred16_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/intrapred16_dspr2.c
rename to aom_dsp/mips/intrapred16_dspr2.c
index 3e29d0a..b9bb55c 100644
--- a/vpx_dsp/mips/intrapred16_dspr2.c
+++ b/aom_dsp/mips/intrapred16_dspr2.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/mips/common_dspr2.h"
+#include "aom_dsp/mips/common_dspr2.h"
 
 #if HAVE_DSPR2
 void vpx_h_predictor_16x16_dspr2(uint8_t *dst, ptrdiff_t stride,
diff --git a/vpx_dsp/mips/intrapred4_dspr2.c b/aom_dsp/mips/intrapred4_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/intrapred4_dspr2.c
rename to aom_dsp/mips/intrapred4_dspr2.c
index 9f51d50..4494bc8 100644
--- a/vpx_dsp/mips/intrapred4_dspr2.c
+++ b/aom_dsp/mips/intrapred4_dspr2.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/mips/common_dspr2.h"
+#include "aom_dsp/mips/common_dspr2.h"
 
 #if HAVE_DSPR2
 void vpx_h_predictor_4x4_dspr2(uint8_t *dst, ptrdiff_t stride,
diff --git a/vpx_dsp/mips/intrapred8_dspr2.c b/aom_dsp/mips/intrapred8_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/intrapred8_dspr2.c
rename to aom_dsp/mips/intrapred8_dspr2.c
index eac79d5..f85209b 100644
--- a/vpx_dsp/mips/intrapred8_dspr2.c
+++ b/aom_dsp/mips/intrapred8_dspr2.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/mips/common_dspr2.h"
+#include "aom_dsp/mips/common_dspr2.h"
 
 #if HAVE_DSPR2
 void vpx_h_predictor_8x8_dspr2(uint8_t *dst, ptrdiff_t stride,
diff --git a/vpx_dsp/mips/intrapred_msa.c b/aom_dsp/mips/intrapred_msa.c
similarity index 99%
rename from vpx_dsp/mips/intrapred_msa.c
rename to aom_dsp/mips/intrapred_msa.c
index b5ee943..17dd57b 100644
--- a/vpx_dsp/mips/intrapred_msa.c
+++ b/aom_dsp/mips/intrapred_msa.c
@@ -9,7 +9,7 @@
  */
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/macros_msa.h"
+#include "aom_dsp/mips/macros_msa.h"
 
 #define IPRED_SUBS_UH2_UH(in0, in1, out0, out1) \
   {                                             \
diff --git a/vpx_dsp/mips/inv_txfm_dspr2.h b/aom_dsp/mips/inv_txfm_dspr2.h
similarity index 97%
rename from vpx_dsp/mips/inv_txfm_dspr2.h
rename to aom_dsp/mips/inv_txfm_dspr2.h
index edd54ae..5c9a020 100644
--- a/vpx_dsp/mips/inv_txfm_dspr2.h
+++ b/aom_dsp/mips/inv_txfm_dspr2.h
@@ -14,9 +14,9 @@
 #include <assert.h>
 
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/inv_txfm.h"
-#include "vpx_dsp/mips/common_dspr2.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/inv_txfm.h"
+#include "aom_dsp/mips/common_dspr2.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/mips/inv_txfm_msa.h b/aom_dsp/mips/inv_txfm_msa.h
similarity index 99%
rename from vpx_dsp/mips/inv_txfm_msa.h
rename to aom_dsp/mips/inv_txfm_msa.h
index ee94782..14d38b8 100644
--- a/vpx_dsp/mips/inv_txfm_msa.h
+++ b/aom_dsp/mips/inv_txfm_msa.h
@@ -11,9 +11,9 @@
 #ifndef VPX_DSP_MIPS_INV_TXFM_MSA_H_
 #define VPX_DSP_MIPS_INV_TXFM_MSA_H_
 
-#include "vpx_dsp/mips/macros_msa.h"
-#include "vpx_dsp/mips/txfm_macros_msa.h"
-#include "vpx_dsp/txfm_common.h"
+#include "aom_dsp/mips/macros_msa.h"
+#include "aom_dsp/mips/txfm_macros_msa.h"
+#include "aom_dsp/txfm_common.h"
 
 #define VPX_ADST8(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, out2,  \
                   out3, out4, out5, out6, out7)                              \
diff --git a/vpx_dsp/mips/itrans16_dspr2.c b/aom_dsp/mips/itrans16_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/itrans16_dspr2.c
rename to aom_dsp/mips/itrans16_dspr2.c
index 0ec0c20..8d184cb 100644
--- a/vpx_dsp/mips/itrans16_dspr2.c
+++ b/aom_dsp/mips/itrans16_dspr2.c
@@ -10,8 +10,8 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/inv_txfm_dspr2.h"
-#include "vpx_dsp/txfm_common.h"
+#include "aom_dsp/mips/inv_txfm_dspr2.h"
+#include "aom_dsp/txfm_common.h"
 
 #if HAVE_DSPR2
 void idct16_rows_dspr2(const int16_t *input, int16_t *output,
diff --git a/vpx_dsp/mips/itrans32_cols_dspr2.c b/aom_dsp/mips/itrans32_cols_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/itrans32_cols_dspr2.c
rename to aom_dsp/mips/itrans32_cols_dspr2.c
index ce25d55..7997131 100644
--- a/vpx_dsp/mips/itrans32_cols_dspr2.c
+++ b/aom_dsp/mips/itrans32_cols_dspr2.c
@@ -9,8 +9,8 @@
  */
 
 #include "./vpx_config.h"
-#include "vpx_dsp/mips/inv_txfm_dspr2.h"
-#include "vpx_dsp/txfm_common.h"
+#include "aom_dsp/mips/inv_txfm_dspr2.h"
+#include "aom_dsp/txfm_common.h"
 
 #if HAVE_DSPR2
 void vpx_idct32_cols_add_blk_dspr2(int16_t *input, uint8_t *dest,
diff --git a/vpx_dsp/mips/itrans32_dspr2.c b/aom_dsp/mips/itrans32_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/itrans32_dspr2.c
rename to aom_dsp/mips/itrans32_dspr2.c
index d71c5ff..74248b3 100644
--- a/vpx_dsp/mips/itrans32_dspr2.c
+++ b/aom_dsp/mips/itrans32_dspr2.c
@@ -12,8 +12,8 @@
 #include <stdio.h>
 
 #include "./vpx_config.h"
-#include "vpx_dsp/mips/inv_txfm_dspr2.h"
-#include "vpx_dsp/txfm_common.h"
+#include "aom_dsp/mips/inv_txfm_dspr2.h"
+#include "aom_dsp/txfm_common.h"
 
 #if HAVE_DSPR2
 static void idct32_rows_dspr2(const int16_t *input, int16_t *output,
diff --git a/vpx_dsp/mips/itrans4_dspr2.c b/aom_dsp/mips/itrans4_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/itrans4_dspr2.c
rename to aom_dsp/mips/itrans4_dspr2.c
index 516ea80..d6ea667 100644
--- a/vpx_dsp/mips/itrans4_dspr2.c
+++ b/aom_dsp/mips/itrans4_dspr2.c
@@ -10,8 +10,8 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/inv_txfm_dspr2.h"
-#include "vpx_dsp/txfm_common.h"
+#include "aom_dsp/mips/inv_txfm_dspr2.h"
+#include "aom_dsp/txfm_common.h"
 
 #if HAVE_DSPR2
 void vpx_idct4_rows_dspr2(const int16_t *input, int16_t *output) {
diff --git a/vpx_dsp/mips/itrans8_dspr2.c b/aom_dsp/mips/itrans8_dspr2.c
similarity index 99%
rename from vpx_dsp/mips/itrans8_dspr2.c
rename to aom_dsp/mips/itrans8_dspr2.c
index 08a6c78..4cee3d0 100644
--- a/vpx_dsp/mips/itrans8_dspr2.c
+++ b/aom_dsp/mips/itrans8_dspr2.c
@@ -10,8 +10,8 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/inv_txfm_dspr2.h"
-#include "vpx_dsp/txfm_common.h"
+#include "aom_dsp/mips/inv_txfm_dspr2.h"
+#include "aom_dsp/txfm_common.h"
 
 #if HAVE_DSPR2
 void idct8_rows_dspr2(const int16_t *input, int16_t *output, uint32_t no_rows) {
diff --git a/vpx_dsp/mips/loopfilter_16_msa.c b/aom_dsp/mips/loopfilter_16_msa.c
similarity index 99%
rename from vpx_dsp/mips/loopfilter_16_msa.c
rename to aom_dsp/mips/loopfilter_16_msa.c
index 4aad863..ff7dc05 100644
--- a/vpx_dsp/mips/loopfilter_16_msa.c
+++ b/aom_dsp/mips/loopfilter_16_msa.c
@@ -8,8 +8,8 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_ports/mem.h"
-#include "vpx_dsp/mips/loopfilter_msa.h"
+#include "aom_ports/mem.h"
+#include "aom_dsp/mips/loopfilter_msa.h"
 
 int32_t vpx_hz_lpf_t4_and_t8_16w(uint8_t *src, int32_t pitch, uint8_t *filter48,
                                  const uint8_t *b_limit_ptr,
diff --git a/vpx_dsp/mips/loopfilter_4_msa.c b/aom_dsp/mips/loopfilter_4_msa.c
similarity index 98%
rename from vpx_dsp/mips/loopfilter_4_msa.c
rename to aom_dsp/mips/loopfilter_4_msa.c
index fe216c2..9411d96 100644
--- a/vpx_dsp/mips/loopfilter_4_msa.c
+++ b/aom_dsp/mips/loopfilter_4_msa.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/mips/loopfilter_msa.h"
+#include "aom_dsp/mips/loopfilter_msa.h"
 
 void vpx_lpf_horizontal_4_msa(uint8_t *src, int32_t pitch,
                               const uint8_t *b_limit_ptr,
diff --git a/vpx_dsp/mips/loopfilter_8_msa.c b/aom_dsp/mips/loopfilter_8_msa.c
similarity index 99%
rename from vpx_dsp/mips/loopfilter_8_msa.c
rename to aom_dsp/mips/loopfilter_8_msa.c
index af0d628..4f745da 100644
--- a/vpx_dsp/mips/loopfilter_8_msa.c
+++ b/aom_dsp/mips/loopfilter_8_msa.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/mips/loopfilter_msa.h"
+#include "aom_dsp/mips/loopfilter_msa.h"
 
 void vpx_lpf_horizontal_8_msa(uint8_t *src, int32_t pitch,
                               const uint8_t *b_limit_ptr,
diff --git a/vpx_dsp/mips/loopfilter_filters_dspr2.c b/aom_dsp/mips/loopfilter_filters_dspr2.c
similarity index 97%
rename from vpx_dsp/mips/loopfilter_filters_dspr2.c
rename to aom_dsp/mips/loopfilter_filters_dspr2.c
index f174367..dc59838 100644
--- a/vpx_dsp/mips/loopfilter_filters_dspr2.c
+++ b/aom_dsp/mips/loopfilter_filters_dspr2.c
@@ -11,12 +11,12 @@
 #include <stdlib.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/mips/common_dspr2.h"
-#include "vpx_dsp/mips/loopfilter_filters_dspr2.h"
-#include "vpx_dsp/mips/loopfilter_macros_dspr2.h"
-#include "vpx_dsp/mips/loopfilter_masks_dspr2.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/mips/common_dspr2.h"
+#include "aom_dsp/mips/loopfilter_filters_dspr2.h"
+#include "aom_dsp/mips/loopfilter_macros_dspr2.h"
+#include "aom_dsp/mips/loopfilter_masks_dspr2.h"
+#include "aom_mem/vpx_mem.h"
 
 #if HAVE_DSPR2
 void vpx_lpf_horizontal_4_dspr2(unsigned char *s, int pitch,
diff --git a/vpx_dsp/mips/loopfilter_filters_dspr2.h b/aom_dsp/mips/loopfilter_filters_dspr2.h
similarity index 99%
rename from vpx_dsp/mips/loopfilter_filters_dspr2.h
rename to aom_dsp/mips/loopfilter_filters_dspr2.h
index 11f286d..919618c 100644
--- a/vpx_dsp/mips/loopfilter_filters_dspr2.h
+++ b/aom_dsp/mips/loopfilter_filters_dspr2.h
@@ -14,9 +14,9 @@
 #include <stdlib.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/mips/loopfilter_macros_dspr2.h b/aom_dsp/mips/loopfilter_macros_dspr2.h
similarity index 99%
rename from vpx_dsp/mips/loopfilter_macros_dspr2.h
rename to aom_dsp/mips/loopfilter_macros_dspr2.h
index 769371d..3928263 100644
--- a/vpx_dsp/mips/loopfilter_macros_dspr2.h
+++ b/aom_dsp/mips/loopfilter_macros_dspr2.h
@@ -14,8 +14,8 @@
 #include <stdlib.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_mem/vpx_mem.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/mips/loopfilter_masks_dspr2.h b/aom_dsp/mips/loopfilter_masks_dspr2.h
similarity index 99%
rename from vpx_dsp/mips/loopfilter_masks_dspr2.h
rename to aom_dsp/mips/loopfilter_masks_dspr2.h
index 0a0cf57..986db05 100644
--- a/vpx_dsp/mips/loopfilter_masks_dspr2.h
+++ b/aom_dsp/mips/loopfilter_masks_dspr2.h
@@ -14,8 +14,8 @@
 #include <stdlib.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_mem/vpx_mem.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/mips/loopfilter_mb_dspr2.c b/aom_dsp/mips/loopfilter_mb_dspr2.c
similarity index 98%
rename from vpx_dsp/mips/loopfilter_mb_dspr2.c
rename to aom_dsp/mips/loopfilter_mb_dspr2.c
index e424792..ea30e16 100644
--- a/vpx_dsp/mips/loopfilter_mb_dspr2.c
+++ b/aom_dsp/mips/loopfilter_mb_dspr2.c
@@ -11,12 +11,12 @@
 #include <stdlib.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/mips/common_dspr2.h"
-#include "vpx_dsp/mips/loopfilter_filters_dspr2.h"
-#include "vpx_dsp/mips/loopfilter_macros_dspr2.h"
-#include "vpx_dsp/mips/loopfilter_masks_dspr2.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/mips/common_dspr2.h"
+#include "aom_dsp/mips/loopfilter_filters_dspr2.h"
+#include "aom_dsp/mips/loopfilter_macros_dspr2.h"
+#include "aom_dsp/mips/loopfilter_masks_dspr2.h"
+#include "aom_mem/vpx_mem.h"
 
 #if HAVE_DSPR2
 void vpx_lpf_horizontal_8_dspr2(unsigned char *s, int pitch,
diff --git a/vpx_dsp/mips/loopfilter_mb_horiz_dspr2.c b/aom_dsp/mips/loopfilter_mb_horiz_dspr2.c
similarity index 98%
rename from vpx_dsp/mips/loopfilter_mb_horiz_dspr2.c
rename to aom_dsp/mips/loopfilter_mb_horiz_dspr2.c
index 6325762..82a44c5 100644
--- a/vpx_dsp/mips/loopfilter_mb_horiz_dspr2.c
+++ b/aom_dsp/mips/loopfilter_mb_horiz_dspr2.c
@@ -11,12 +11,12 @@
 #include <stdlib.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/mips/common_dspr2.h"
-#include "vpx_dsp/mips/loopfilter_filters_dspr2.h"
-#include "vpx_dsp/mips/loopfilter_macros_dspr2.h"
-#include "vpx_dsp/mips/loopfilter_masks_dspr2.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/mips/common_dspr2.h"
+#include "aom_dsp/mips/loopfilter_filters_dspr2.h"
+#include "aom_dsp/mips/loopfilter_macros_dspr2.h"
+#include "aom_dsp/mips/loopfilter_masks_dspr2.h"
+#include "aom_mem/vpx_mem.h"
 
 #if HAVE_DSPR2
 static void mb_lpf_horizontal_edge(unsigned char *s, int pitch,
diff --git a/vpx_dsp/mips/loopfilter_mb_vert_dspr2.c b/aom_dsp/mips/loopfilter_mb_vert_dspr2.c
similarity index 98%
rename from vpx_dsp/mips/loopfilter_mb_vert_dspr2.c
rename to aom_dsp/mips/loopfilter_mb_vert_dspr2.c
index 96e8d88..22d7261 100644
--- a/vpx_dsp/mips/loopfilter_mb_vert_dspr2.c
+++ b/aom_dsp/mips/loopfilter_mb_vert_dspr2.c
@@ -11,12 +11,12 @@
 #include <stdlib.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/mips/common_dspr2.h"
-#include "vpx_dsp/mips/loopfilter_filters_dspr2.h"
-#include "vpx_dsp/mips/loopfilter_macros_dspr2.h"
-#include "vpx_dsp/mips/loopfilter_masks_dspr2.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/mips/common_dspr2.h"
+#include "aom_dsp/mips/loopfilter_filters_dspr2.h"
+#include "aom_dsp/mips/loopfilter_macros_dspr2.h"
+#include "aom_dsp/mips/loopfilter_masks_dspr2.h"
+#include "aom_mem/vpx_mem.h"
 
 #if HAVE_DSPR2
 void vpx_lpf_vertical_16_dspr2(uint8_t *s, int pitch, const uint8_t *blimit,
diff --git a/vpx_dsp/mips/loopfilter_msa.h b/aom_dsp/mips/loopfilter_msa.h
similarity index 99%
rename from vpx_dsp/mips/loopfilter_msa.h
rename to aom_dsp/mips/loopfilter_msa.h
index d3c2bd4..d977f34 100644
--- a/vpx_dsp/mips/loopfilter_msa.h
+++ b/aom_dsp/mips/loopfilter_msa.h
@@ -11,7 +11,7 @@
 #ifndef VPX_DSP_LOOPFILTER_MSA_H_
 #define VPX_DSP_LOOPFILTER_MSA_H_
 
-#include "vpx_dsp/mips/macros_msa.h"
+#include "aom_dsp/mips/macros_msa.h"
 
 #define VPX_LPF_FILTER4_8W(p1_in, p0_in, q0_in, q1_in, mask_in, hev_in, \
                            p1_out, p0_out, q0_out, q1_out)              \
diff --git a/vpx_dsp/mips/macros_msa.h b/aom_dsp/mips/macros_msa.h
similarity index 99%
rename from vpx_dsp/mips/macros_msa.h
rename to aom_dsp/mips/macros_msa.h
index f498fbe..f21b895 100644
--- a/vpx_dsp/mips/macros_msa.h
+++ b/aom_dsp/mips/macros_msa.h
@@ -14,7 +14,7 @@
 #include <msa.h>
 
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #define LD_B(RTYPE, psrc) *((const RTYPE *)(psrc))
 #define LD_UB(...) LD_B(v16u8, __VA_ARGS__)
diff --git a/vpx_dsp/mips/sad_msa.c b/aom_dsp/mips/sad_msa.c
similarity index 99%
rename from vpx_dsp/mips/sad_msa.c
rename to aom_dsp/mips/sad_msa.c
index 6455814..30123d6 100644
--- a/vpx_dsp/mips/sad_msa.c
+++ b/aom_dsp/mips/sad_msa.c
@@ -9,7 +9,7 @@
  */
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/macros_msa.h"
+#include "aom_dsp/mips/macros_msa.h"
 
 #define SAD_INSVE_W4(RTYPE, in0, in1, in2, in3, out)       \
   {                                                        \
diff --git a/vpx_dsp/mips/sub_pixel_variance_msa.c b/aom_dsp/mips/sub_pixel_variance_msa.c
similarity index 99%
rename from vpx_dsp/mips/sub_pixel_variance_msa.c
rename to aom_dsp/mips/sub_pixel_variance_msa.c
index 313e06f..4352ff5 100644
--- a/vpx_dsp/mips/sub_pixel_variance_msa.c
+++ b/aom_dsp/mips/sub_pixel_variance_msa.c
@@ -9,9 +9,9 @@
  */
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_ports/mem.h"
-#include "vpx_dsp/mips/macros_msa.h"
-#include "vpx_dsp/variance.h"
+#include "aom_ports/mem.h"
+#include "aom_dsp/mips/macros_msa.h"
+#include "aom_dsp/variance.h"
 
 static const uint8_t bilinear_filters_msa[8][2] = {
   { 128, 0 }, { 112, 16 }, { 96, 32 }, { 80, 48 },
diff --git a/vpx_dsp/mips/subtract_msa.c b/aom_dsp/mips/subtract_msa.c
similarity index 99%
rename from vpx_dsp/mips/subtract_msa.c
rename to aom_dsp/mips/subtract_msa.c
index 391a7eb..04cb922 100644
--- a/vpx_dsp/mips/subtract_msa.c
+++ b/aom_dsp/mips/subtract_msa.c
@@ -9,7 +9,7 @@
  */
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/macros_msa.h"
+#include "aom_dsp/mips/macros_msa.h"
 
 static void sub_blk_4x4_msa(const uint8_t *src_ptr, int32_t src_stride,
                             const uint8_t *pred_ptr, int32_t pred_stride,
diff --git a/vpx_dsp/mips/txfm_macros_msa.h b/aom_dsp/mips/txfm_macros_msa.h
similarity index 99%
rename from vpx_dsp/mips/txfm_macros_msa.h
rename to aom_dsp/mips/txfm_macros_msa.h
index da100f6..a7da24e 100644
--- a/vpx_dsp/mips/txfm_macros_msa.h
+++ b/aom_dsp/mips/txfm_macros_msa.h
@@ -11,7 +11,7 @@
 #ifndef VPX_DSP_MIPS_TXFM_MACROS_MIPS_MSA_H_
 #define VPX_DSP_MIPS_TXFM_MACROS_MIPS_MSA_H_
 
-#include "vpx_dsp/mips/macros_msa.h"
+#include "aom_dsp/mips/macros_msa.h"
 
 #define DOTP_CONST_PAIR(reg0, reg1, cnst0, cnst1, out0, out1) \
   {                                                           \
diff --git a/vpx_dsp/mips/variance_msa.c b/aom_dsp/mips/variance_msa.c
similarity index 99%
rename from vpx_dsp/mips/variance_msa.c
rename to aom_dsp/mips/variance_msa.c
index 085990e..767dcf0 100644
--- a/vpx_dsp/mips/variance_msa.c
+++ b/aom_dsp/mips/variance_msa.c
@@ -9,7 +9,7 @@
  */
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/macros_msa.h"
+#include "aom_dsp/mips/macros_msa.h"
 
 #define CALC_MSE_B(src, ref, var)                                   \
   {                                                                 \
diff --git a/vpx_dsp/mips/vpx_convolve8_avg_horiz_msa.c b/aom_dsp/mips/vpx_convolve8_avg_horiz_msa.c
similarity index 99%
rename from vpx_dsp/mips/vpx_convolve8_avg_horiz_msa.c
rename to aom_dsp/mips/vpx_convolve8_avg_horiz_msa.c
index ad2af28..300656c 100644
--- a/vpx_dsp/mips/vpx_convolve8_avg_horiz_msa.c
+++ b/aom_dsp/mips/vpx_convolve8_avg_horiz_msa.c
@@ -10,7 +10,7 @@
 
 #include <assert.h>
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/vpx_convolve_msa.h"
+#include "aom_dsp/mips/vpx_convolve_msa.h"
 
 static void common_hz_8t_and_aver_dst_4x4_msa(const uint8_t *src,
                                               int32_t src_stride, uint8_t *dst,
diff --git a/vpx_dsp/mips/vpx_convolve8_avg_msa.c b/aom_dsp/mips/vpx_convolve8_avg_msa.c
similarity index 99%
rename from vpx_dsp/mips/vpx_convolve8_avg_msa.c
rename to aom_dsp/mips/vpx_convolve8_avg_msa.c
index 1cfa632..8037661 100644
--- a/vpx_dsp/mips/vpx_convolve8_avg_msa.c
+++ b/aom_dsp/mips/vpx_convolve8_avg_msa.c
@@ -10,7 +10,7 @@
 
 #include <assert.h>
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/vpx_convolve_msa.h"
+#include "aom_dsp/mips/vpx_convolve_msa.h"
 
 static void common_hv_8ht_8vt_and_aver_dst_4w_msa(
     const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride,
diff --git a/vpx_dsp/mips/vpx_convolve8_avg_vert_msa.c b/aom_dsp/mips/vpx_convolve8_avg_vert_msa.c
similarity index 99%
rename from vpx_dsp/mips/vpx_convolve8_avg_vert_msa.c
rename to aom_dsp/mips/vpx_convolve8_avg_vert_msa.c
index 146ce3b..b3c9b6b 100644
--- a/vpx_dsp/mips/vpx_convolve8_avg_vert_msa.c
+++ b/aom_dsp/mips/vpx_convolve8_avg_vert_msa.c
@@ -10,7 +10,7 @@
 
 #include <assert.h>
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/vpx_convolve_msa.h"
+#include "aom_dsp/mips/vpx_convolve_msa.h"
 
 static void common_vt_8t_and_aver_dst_4w_msa(const uint8_t *src,
                                              int32_t src_stride, uint8_t *dst,
diff --git a/vpx_dsp/mips/vpx_convolve8_horiz_msa.c b/aom_dsp/mips/vpx_convolve8_horiz_msa.c
similarity index 99%
rename from vpx_dsp/mips/vpx_convolve8_horiz_msa.c
rename to aom_dsp/mips/vpx_convolve8_horiz_msa.c
index 9e8bf7b..256abd5 100644
--- a/vpx_dsp/mips/vpx_convolve8_horiz_msa.c
+++ b/aom_dsp/mips/vpx_convolve8_horiz_msa.c
@@ -10,7 +10,7 @@
 
 #include <assert.h>
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/vpx_convolve_msa.h"
+#include "aom_dsp/mips/vpx_convolve_msa.h"
 
 static void common_hz_8t_4x4_msa(const uint8_t *src, int32_t src_stride,
                                  uint8_t *dst, int32_t dst_stride,
diff --git a/vpx_dsp/mips/vpx_convolve8_msa.c b/aom_dsp/mips/vpx_convolve8_msa.c
similarity index 99%
rename from vpx_dsp/mips/vpx_convolve8_msa.c
rename to aom_dsp/mips/vpx_convolve8_msa.c
index b16ec57..81d4f14 100644
--- a/vpx_dsp/mips/vpx_convolve8_msa.c
+++ b/aom_dsp/mips/vpx_convolve8_msa.c
@@ -10,7 +10,7 @@
 
 #include <assert.h>
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/vpx_convolve_msa.h"
+#include "aom_dsp/mips/vpx_convolve_msa.h"
 
 const uint8_t mc_filt_mask_arr[16 * 3] = {
   /* 8 width cases */
diff --git a/vpx_dsp/mips/vpx_convolve8_vert_msa.c b/aom_dsp/mips/vpx_convolve8_vert_msa.c
similarity index 99%
rename from vpx_dsp/mips/vpx_convolve8_vert_msa.c
rename to aom_dsp/mips/vpx_convolve8_vert_msa.c
index 4106822..0404575 100644
--- a/vpx_dsp/mips/vpx_convolve8_vert_msa.c
+++ b/aom_dsp/mips/vpx_convolve8_vert_msa.c
@@ -10,7 +10,7 @@
 
 #include <assert.h>
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/mips/vpx_convolve_msa.h"
+#include "aom_dsp/mips/vpx_convolve_msa.h"
 
 static void common_vt_8t_4w_msa(const uint8_t *src, int32_t src_stride,
                                 uint8_t *dst, int32_t dst_stride,
diff --git a/vpx_dsp/mips/vpx_convolve_avg_msa.c b/aom_dsp/mips/vpx_convolve_avg_msa.c
similarity index 99%
rename from vpx_dsp/mips/vpx_convolve_avg_msa.c
rename to aom_dsp/mips/vpx_convolve_avg_msa.c
index 45399ba..313223b 100644
--- a/vpx_dsp/mips/vpx_convolve_avg_msa.c
+++ b/aom_dsp/mips/vpx_convolve_avg_msa.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/mips/macros_msa.h"
+#include "aom_dsp/mips/macros_msa.h"
 
 static void avg_width4_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst,
                            int32_t dst_stride, int32_t height) {
diff --git a/vpx_dsp/mips/vpx_convolve_copy_msa.c b/aom_dsp/mips/vpx_convolve_copy_msa.c
similarity index 99%
rename from vpx_dsp/mips/vpx_convolve_copy_msa.c
rename to aom_dsp/mips/vpx_convolve_copy_msa.c
index c3d87a4..520a706 100644
--- a/vpx_dsp/mips/vpx_convolve_copy_msa.c
+++ b/aom_dsp/mips/vpx_convolve_copy_msa.c
@@ -9,7 +9,7 @@
  */
 
 #include <string.h>
-#include "vpx_dsp/mips/macros_msa.h"
+#include "aom_dsp/mips/macros_msa.h"
 
 static void copy_width8_msa(const uint8_t *src, int32_t src_stride,
                             uint8_t *dst, int32_t dst_stride, int32_t height) {
diff --git a/vpx_dsp/mips/vpx_convolve_msa.h b/aom_dsp/mips/vpx_convolve_msa.h
similarity index 98%
rename from vpx_dsp/mips/vpx_convolve_msa.h
rename to aom_dsp/mips/vpx_convolve_msa.h
index 198c21e..6b48879 100644
--- a/vpx_dsp/mips/vpx_convolve_msa.h
+++ b/aom_dsp/mips/vpx_convolve_msa.h
@@ -11,8 +11,8 @@
 #ifndef VPX_DSP_MIPS_VPX_CONVOLVE_MSA_H_
 #define VPX_DSP_MIPS_VPX_CONVOLVE_MSA_H_
 
-#include "vpx_dsp/mips/macros_msa.h"
-#include "vpx_dsp/vpx_filter.h"
+#include "aom_dsp/mips/macros_msa.h"
+#include "aom_dsp/vpx_filter.h"
 
 extern const uint8_t mc_filt_mask_arr[16 * 3];
 
diff --git a/vpx_dsp/postproc.h b/aom_dsp/postproc.h
similarity index 100%
rename from vpx_dsp/postproc.h
rename to aom_dsp/postproc.h
diff --git a/vpx_dsp/prob.c b/aom_dsp/prob.c
similarity index 100%
rename from vpx_dsp/prob.c
rename to aom_dsp/prob.c
diff --git a/vpx_dsp/prob.h b/aom_dsp/prob.h
similarity index 98%
rename from vpx_dsp/prob.h
rename to aom_dsp/prob.h
index 148116e..3de6463 100644
--- a/vpx_dsp/prob.h
+++ b/aom_dsp/prob.h
@@ -14,7 +14,7 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_common.h"
 
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/psnr.c b/aom_dsp/psnr.c
similarity index 99%
rename from vpx_dsp/psnr.c
rename to aom_dsp/psnr.c
index 65997c7..f237ca4 100644
--- a/vpx_dsp/psnr.c
+++ b/aom_dsp/psnr.c
@@ -11,8 +11,8 @@
 #include <math.h>
 #include <assert.h>
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/psnr.h"
-#include "vpx_scale/yv12config.h"
+#include "aom_dsp/psnr.h"
+#include "aom_scale/yv12config.h"
 
 double vpx_sse_to_psnr(double samples, double peak, double sse) {
   if (sse > 0.0) {
diff --git a/vpx_dsp/psnr.h b/aom_dsp/psnr.h
similarity index 98%
rename from vpx_dsp/psnr.h
rename to aom_dsp/psnr.h
index fe97782..ba70407 100644
--- a/vpx_dsp/psnr.h
+++ b/aom_dsp/psnr.h
@@ -11,7 +11,7 @@
 #ifndef VPX_DSP_PSNR_H_
 #define VPX_DSP_PSNR_H_
 
-#include "vpx_scale/yv12config.h"
+#include "aom_scale/yv12config.h"
 
 #define MAX_PSNR 100.0
 
diff --git a/vpx_dsp/psnrhvs.c b/aom_dsp/psnrhvs.c
similarity index 98%
rename from vpx_dsp/psnrhvs.c
rename to aom_dsp/psnrhvs.c
index b391015..333ff63 100644
--- a/vpx_dsp/psnrhvs.c
+++ b/aom_dsp/psnrhvs.c
@@ -17,9 +17,9 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/ssim.h"
-#include "vpx_ports/system_state.h"
-#include "vpx_dsp/psnr.h"
+#include "aom_dsp/ssim.h"
+#include "aom_ports/system_state.h"
+#include "aom_dsp/psnr.h"
 
 #if !defined(M_PI)
 #define M_PI (3.141592653589793238462643)
diff --git a/vpx_dsp/quantize.c b/aom_dsp/quantize.c
similarity index 99%
rename from vpx_dsp/quantize.c
rename to aom_dsp/quantize.c
index 78a7c2b..c901aa0 100644
--- a/vpx_dsp/quantize.c
+++ b/aom_dsp/quantize.c
@@ -9,8 +9,8 @@
  */
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/quantize.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom_dsp/quantize.h"
+#include "aom_mem/vpx_mem.h"
 
 #if CONFIG_AOM_QM
 void vpx_quantize_dc(const tran_low_t *coeff_ptr, int n_coeffs, int skip_block,
diff --git a/vpx_dsp/quantize.h b/aom_dsp/quantize.h
similarity index 98%
rename from vpx_dsp/quantize.h
rename to aom_dsp/quantize.h
index 81f5566..b994d9a 100644
--- a/vpx_dsp/quantize.h
+++ b/aom_dsp/quantize.h
@@ -12,7 +12,7 @@
 #define VPX_DSP_QUANTIZE_H_
 
 #include "./vpx_config.h"
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/sad.c b/aom_dsp/sad.c
similarity index 99%
rename from vpx_dsp/sad.c
rename to aom_dsp/sad.c
index 7306e8f..8bbf83f 100644
--- a/vpx_dsp/sad.c
+++ b/aom_dsp/sad.c
@@ -13,8 +13,8 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
 
 /* Sum the difference between every corresponding element of the buffers. */
 static INLINE unsigned int sad(const uint8_t *a, int a_stride, const uint8_t *b,
diff --git a/vpx_dsp/ssim.c b/aom_dsp/ssim.c
similarity index 99%
rename from vpx_dsp/ssim.c
rename to aom_dsp/ssim.c
index 7a29bd2..c111ead 100644
--- a/vpx_dsp/ssim.c
+++ b/aom_dsp/ssim.c
@@ -11,9 +11,9 @@
 #include <assert.h>
 #include <math.h>
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/ssim.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/system_state.h"
+#include "aom_dsp/ssim.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/system_state.h"
 
 void vpx_ssim_parms_16x16_c(const uint8_t *s, int sp, const uint8_t *r, int rp,
                             uint32_t *sum_s, uint32_t *sum_r,
diff --git a/vpx_dsp/ssim.h b/aom_dsp/ssim.h
similarity index 98%
rename from vpx_dsp/ssim.h
rename to aom_dsp/ssim.h
index 4f2bb1d..0127d3f 100644
--- a/vpx_dsp/ssim.h
+++ b/aom_dsp/ssim.h
@@ -18,7 +18,7 @@
 #endif
 
 #include "./vpx_config.h"
-#include "vpx_scale/yv12config.h"
+#include "aom_scale/yv12config.h"
 
 // metrics used for calculating ssim, ssim2, dssim, and ssimc
 typedef struct {
diff --git a/vpx_dsp/subtract.c b/aom_dsp/subtract.c
similarity index 96%
rename from vpx_dsp/subtract.c
rename to aom_dsp/subtract.c
index 95e7071..5d048ed 100644
--- a/vpx_dsp/subtract.c
+++ b/aom_dsp/subtract.c
@@ -13,8 +13,8 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
 
 void vpx_subtract_block_c(int rows, int cols, int16_t *diff,
                           ptrdiff_t diff_stride, const uint8_t *src,
diff --git a/vpx_dsp/sum_squares.c b/aom_dsp/sum_squares.c
similarity index 100%
rename from vpx_dsp/sum_squares.c
rename to aom_dsp/sum_squares.c
diff --git a/vpx_dsp/txfm_common.h b/aom_dsp/txfm_common.h
similarity index 98%
rename from vpx_dsp/txfm_common.h
rename to aom_dsp/txfm_common.h
index 3559b91..38fe2b7 100644
--- a/vpx_dsp/txfm_common.h
+++ b/aom_dsp/txfm_common.h
@@ -11,7 +11,7 @@
 #ifndef VPX_DSP_TXFM_COMMON_H_
 #define VPX_DSP_TXFM_COMMON_H_
 
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 // Constants and Macros used by all idct/dct functions
 #define DCT_CONST_BITS 14
diff --git a/vpx_dsp/variance.c b/aom_dsp/variance.c
similarity index 99%
rename from vpx_dsp/variance.c
rename to aom_dsp/variance.c
index 79b6760..5df2aa5 100644
--- a/vpx_dsp/variance.c
+++ b/aom_dsp/variance.c
@@ -12,11 +12,11 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vpx_ports/mem.h"
-#include "vpx/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom/vpx_integer.h"
 
-#include "vpx_dsp/variance.h"
-#include "vpx_dsp/vpx_filter.h"
+#include "aom_dsp/variance.h"
+#include "aom_dsp/vpx_filter.h"
 
 uint32_t vpx_get4x4sse_cs_c(const uint8_t *a, int a_stride, const uint8_t *b,
                             int b_stride) {
diff --git a/vpx_dsp/variance.h b/aom_dsp/variance.h
similarity index 99%
rename from vpx_dsp/variance.h
rename to aom_dsp/variance.h
index 18b62db..088e09c 100644
--- a/vpx_dsp/variance.h
+++ b/aom_dsp/variance.h
@@ -13,7 +13,7 @@
 
 #include "./vpx_config.h"
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/vpx_convolve.c b/aom_dsp/vpx_convolve.c
similarity index 99%
rename from vpx_dsp/vpx_convolve.c
rename to aom_dsp/vpx_convolve.c
index 20d8364..370ad77 100644
--- a/vpx_dsp/vpx_convolve.c
+++ b/aom_dsp/vpx_convolve.c
@@ -13,11 +13,11 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/vpx_convolve.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/vpx_filter.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/vpx_convolve.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_filter.h"
+#include "aom_ports/mem.h"
 
 static void convolve_horiz(const uint8_t *src, ptrdiff_t src_stride,
                            uint8_t *dst, ptrdiff_t dst_stride,
diff --git a/vpx_dsp/vpx_convolve.h b/aom_dsp/vpx_convolve.h
similarity index 98%
rename from vpx_dsp/vpx_convolve.h
rename to aom_dsp/vpx_convolve.h
index 1da2c1f..20bef23 100644
--- a/vpx_dsp/vpx_convolve.h
+++ b/aom_dsp/vpx_convolve.h
@@ -11,7 +11,7 @@
 #define VPX_DSP_VPX_CONVOLVE_H_
 
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/vpx_dsp.mk b/aom_dsp/vpx_dsp.mk
similarity index 99%
rename from vpx_dsp/vpx_dsp.mk
rename to aom_dsp/vpx_dsp.mk
index 983506d..c8933dd 100644
--- a/vpx_dsp/vpx_dsp.mk
+++ b/aom_dsp/vpx_dsp.mk
@@ -366,4 +366,4 @@
 DSP_SRCS-yes += vpx_dsp_rtcd.c
 DSP_SRCS-yes += vpx_dsp_rtcd_defs.pl
 
-$(eval $(call rtcd_h_template,vpx_dsp_rtcd,vpx_dsp/vpx_dsp_rtcd_defs.pl))
+$(eval $(call rtcd_h_template,vpx_dsp_rtcd,aom_dsp/vpx_dsp_rtcd_defs.pl))
diff --git a/vpx_dsp/vpx_dsp_common.h b/aom_dsp/vpx_dsp_common.h
similarity index 97%
rename from vpx_dsp/vpx_dsp_common.h
rename to aom_dsp/vpx_dsp_common.h
index b41c7d2..8f911dd 100644
--- a/vpx_dsp/vpx_dsp_common.h
+++ b/aom_dsp/vpx_dsp_common.h
@@ -12,8 +12,8 @@
 #define VPX_DSP_VPX_DSP_COMMON_H_
 
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/vpx_dsp_rtcd.c b/aom_dsp/vpx_dsp_rtcd.c
similarity index 94%
rename from vpx_dsp/vpx_dsp_rtcd.c
rename to aom_dsp/vpx_dsp_rtcd.c
index 030c456..3cd0cc1 100644
--- a/vpx_dsp/vpx_dsp_rtcd.c
+++ b/aom_dsp/vpx_dsp_rtcd.c
@@ -10,6 +10,6 @@
 #include "./vpx_config.h"
 #define RTCD_C
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_ports/vpx_once.h"
+#include "aom_ports/vpx_once.h"
 
 void vpx_dsp_rtcd() { once(setup_rtcd_internal); }
diff --git a/vpx_dsp/vpx_dsp_rtcd_defs.pl b/aom_dsp/vpx_dsp_rtcd_defs.pl
similarity index 99%
rename from vpx_dsp/vpx_dsp_rtcd_defs.pl
rename to aom_dsp/vpx_dsp_rtcd_defs.pl
index 1030c4d..509fba6 100644
--- a/vpx_dsp/vpx_dsp_rtcd_defs.pl
+++ b/aom_dsp/vpx_dsp_rtcd_defs.pl
@@ -4,8 +4,8 @@
  * DSP
  */
 
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 EOF
 }
diff --git a/vpx_dsp/vpx_filter.h b/aom_dsp/vpx_filter.h
similarity index 97%
rename from vpx_dsp/vpx_filter.h
rename to aom_dsp/vpx_filter.h
index 157daea..d977bd3 100644
--- a/vpx_dsp/vpx_filter.h
+++ b/aom_dsp/vpx_filter.h
@@ -11,7 +11,7 @@
 #ifndef VPX_DSP_VPX_FILTER_H_
 #define VPX_DSP_VPX_FILTER_H_
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_dsp/x86/add_noise_sse2.asm b/aom_dsp/x86/add_noise_sse2.asm
similarity index 96%
rename from vpx_dsp/x86/add_noise_sse2.asm
rename to aom_dsp/x86/add_noise_sse2.asm
index ff61b19..a86ca72 100644
--- a/vpx_dsp/x86/add_noise_sse2.asm
+++ b/aom_dsp/x86/add_noise_sse2.asm
@@ -9,7 +9,7 @@
 ;
 
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 ;void vpx_plane_add_noise_sse2(unsigned char *start, unsigned char *noise,
 ;                              unsigned char blackclamp[16],
@@ -36,7 +36,7 @@
     movdqu  xmm5, [rdx]
 
 .addnoise_loop:
-    call sym(LIBVPX_RAND) WRT_PLT
+    call sym(LIBAOM_RAND) WRT_PLT
     mov     rcx, arg(1) ;noise
     and     rax, 0xff
     add     rcx, rax
diff --git a/vpx_dsp/x86/avg_intrin_sse2.c b/aom_dsp/x86/avg_intrin_sse2.c
similarity index 99%
rename from vpx_dsp/x86/avg_intrin_sse2.c
rename to aom_dsp/x86/avg_intrin_sse2.c
index 9eafc6c..c778f09 100644
--- a/vpx_dsp/x86/avg_intrin_sse2.c
+++ b/aom_dsp/x86/avg_intrin_sse2.c
@@ -10,10 +10,10 @@
 
 #include <emmintrin.h>
 
-#include "vpx_dsp/x86/synonyms.h"
+#include "aom_dsp/x86/synonyms.h"
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
 void vpx_minmax_8x8_sse2(const uint8_t *s, int p, const uint8_t *d, int dp,
                          int *min, int *max) {
diff --git a/vpx_dsp/x86/avg_ssse3_x86_64.asm b/aom_dsp/x86/avg_ssse3_x86_64.asm
similarity index 100%
rename from vpx_dsp/x86/avg_ssse3_x86_64.asm
rename to aom_dsp/x86/avg_ssse3_x86_64.asm
diff --git a/vpx_dsp/x86/blend_a64_hmask_sse4.c b/aom_dsp/x86/blend_a64_hmask_sse4.c
similarity index 97%
rename from vpx_dsp/x86/blend_a64_hmask_sse4.c
rename to aom_dsp/x86/blend_a64_hmask_sse4.c
index 8923234..1e452e5 100644
--- a/vpx_dsp/x86/blend_a64_hmask_sse4.c
+++ b/aom_dsp/x86/blend_a64_hmask_sse4.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #include "./vpx_dsp_rtcd.h"
 
diff --git a/vpx_dsp/x86/blend_a64_mask_sse4.c b/aom_dsp/x86/blend_a64_mask_sse4.c
similarity index 99%
rename from vpx_dsp/x86/blend_a64_mask_sse4.c
rename to aom_dsp/x86/blend_a64_mask_sse4.c
index a5c6de5..2384556 100644
--- a/vpx_dsp/x86/blend_a64_mask_sse4.c
+++ b/aom_dsp/x86/blend_a64_mask_sse4.c
@@ -12,13 +12,13 @@
 
 #include <assert.h>
 
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/blend.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/blend.h"
 
-#include "vpx_dsp/x86/synonyms.h"
-#include "vpx_dsp/x86/blend_sse4.h"
+#include "aom_dsp/x86/synonyms.h"
+#include "aom_dsp/x86/blend_sse4.h"
 
 #include "./vpx_dsp_rtcd.h"
 
diff --git a/vpx_dsp/x86/blend_a64_vmask_sse4.c b/aom_dsp/x86/blend_a64_vmask_sse4.c
similarity index 97%
rename from vpx_dsp/x86/blend_a64_vmask_sse4.c
rename to aom_dsp/x86/blend_a64_vmask_sse4.c
index e7fe1bb..0108d02 100644
--- a/vpx_dsp/x86/blend_a64_vmask_sse4.c
+++ b/aom_dsp/x86/blend_a64_vmask_sse4.c
@@ -12,13 +12,13 @@
 
 #include <assert.h>
 
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/blend.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/blend.h"
 
-#include "vpx_dsp/x86/synonyms.h"
-#include "vpx_dsp/x86/blend_sse4.h"
+#include "aom_dsp/x86/synonyms.h"
+#include "aom_dsp/x86/blend_sse4.h"
 
 #include "./vpx_dsp_rtcd.h"
 
diff --git a/vpx_dsp/x86/blend_sse4.h b/aom_dsp/x86/blend_sse4.h
similarity index 98%
rename from vpx_dsp/x86/blend_sse4.h
rename to aom_dsp/x86/blend_sse4.h
index e3b0319..068518c 100644
--- a/vpx_dsp/x86/blend_sse4.h
+++ b/aom_dsp/x86/blend_sse4.h
@@ -11,8 +11,8 @@
 #ifndef VPX_DSP_X86_BLEND_SSE4_H_
 #define VPX_DSP_X86_BLEND_SSE4_H_
 
-#include "vpx_dsp/blend.h"
-#include "vpx_dsp/x86/synonyms.h"
+#include "aom_dsp/blend.h"
+#include "aom_dsp/x86/synonyms.h"
 
 //////////////////////////////////////////////////////////////////////////////
 // Common kernels
diff --git a/vpx_dsp/x86/convolve.h b/aom_dsp/x86/convolve.h
similarity index 99%
rename from vpx_dsp/x86/convolve.h
rename to aom_dsp/x86/convolve.h
index ae1089e..9f1f10f 100644
--- a/vpx_dsp/x86/convolve.h
+++ b/aom_dsp/x86/convolve.h
@@ -13,9 +13,9 @@
 #include <assert.h>
 
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
-#include "vpx_dsp/vpx_convolve.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom_dsp/vpx_convolve.h"
 
 typedef void filter8_1dfunction(const uint8_t *src_ptr, ptrdiff_t src_pitch,
                                 uint8_t *output_ptr, ptrdiff_t out_pitch,
diff --git a/vpx_dsp/x86/deblock_sse2.asm b/aom_dsp/x86/deblock_sse2.asm
similarity index 99%
rename from vpx_dsp/x86/deblock_sse2.asm
rename to aom_dsp/x86/deblock_sse2.asm
index 6df360d..c3d23a3 100644
--- a/vpx_dsp/x86/deblock_sse2.asm
+++ b/aom_dsp/x86/deblock_sse2.asm
@@ -9,7 +9,7 @@
 ;
 
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 ;macro in deblock functions
 %macro FIRST_2_ROWS 0
diff --git a/vpx_dsp/x86/fwd_dct32x32_impl_avx2.h b/aom_dsp/x86/fwd_dct32x32_impl_avx2.h
similarity index 99%
rename from vpx_dsp/x86/fwd_dct32x32_impl_avx2.h
rename to aom_dsp/x86/fwd_dct32x32_impl_avx2.h
index 39d3a3f..1d129bf 100644
--- a/vpx_dsp/x86/fwd_dct32x32_impl_avx2.h
+++ b/aom_dsp/x86/fwd_dct32x32_impl_avx2.h
@@ -11,7 +11,7 @@
 #include <immintrin.h>  // AVX2
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/txfm_common.h"
+#include "aom_dsp/txfm_common.h"
 
 #define pair256_set_epi16(a, b)                                            \
   _mm256_set_epi16((int16_t)(b), (int16_t)(a), (int16_t)(b), (int16_t)(a), \
diff --git a/vpx_dsp/x86/fwd_dct32x32_impl_sse2.h b/aom_dsp/x86/fwd_dct32x32_impl_sse2.h
similarity index 99%
copy from vpx_dsp/x86/fwd_dct32x32_impl_sse2.h
copy to aom_dsp/x86/fwd_dct32x32_impl_sse2.h
index 3744333..04e3e37 100644
--- a/vpx_dsp/x86/fwd_dct32x32_impl_sse2.h
+++ b/aom_dsp/x86/fwd_dct32x32_impl_sse2.h
@@ -10,9 +10,9 @@
 
 #include <emmintrin.h>  // SSE2
 
-#include "vpx_dsp/fwd_txfm.h"
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_dsp/x86/txfm_common_sse2.h"
+#include "aom_dsp/fwd_txfm.h"
+#include "aom_dsp/txfm_common.h"
+#include "aom_dsp/x86/txfm_common_sse2.h"
 
 // TODO(jingning) The high bit-depth version needs re-work for performance.
 // The current SSE2 implementation also causes cross reference to the static
diff --git a/vpx_dsp/x86/fwd_txfm_avx2.c b/aom_dsp/x86/fwd_txfm_avx2.c
similarity index 86%
rename from vpx_dsp/x86/fwd_txfm_avx2.c
rename to aom_dsp/x86/fwd_txfm_avx2.c
index 21f11f0..325a5e9 100644
--- a/vpx_dsp/x86/fwd_txfm_avx2.c
+++ b/aom_dsp/x86/fwd_txfm_avx2.c
@@ -12,12 +12,12 @@
 
 #define FDCT32x32_2D_AVX2 vpx_fdct32x32_rd_avx2
 #define FDCT32x32_HIGH_PRECISION 0
-#include "vpx_dsp/x86/fwd_dct32x32_impl_avx2.h"
+#include "aom_dsp/x86/fwd_dct32x32_impl_avx2.h"
 #undef FDCT32x32_2D_AVX2
 #undef FDCT32x32_HIGH_PRECISION
 
 #define FDCT32x32_2D_AVX2 vpx_fdct32x32_avx2
 #define FDCT32x32_HIGH_PRECISION 1
-#include "vpx_dsp/x86/fwd_dct32x32_impl_avx2.h"  // NOLINT
+#include "aom_dsp/x86/fwd_dct32x32_impl_avx2.h"  // NOLINT
 #undef FDCT32x32_2D_AVX2
 #undef FDCT32x32_HIGH_PRECISION
diff --git a/vpx_dsp/x86/fwd_txfm_impl_sse2.h b/aom_dsp/x86/fwd_txfm_impl_sse2.h
similarity index 99%
rename from vpx_dsp/x86/fwd_txfm_impl_sse2.h
rename to aom_dsp/x86/fwd_txfm_impl_sse2.h
index 743e55e..8b57fab 100644
--- a/vpx_dsp/x86/fwd_txfm_impl_sse2.h
+++ b/aom_dsp/x86/fwd_txfm_impl_sse2.h
@@ -11,10 +11,10 @@
 #include <emmintrin.h>  // SSE2
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_dsp/x86/fwd_txfm_sse2.h"
-#include "vpx_dsp/x86/txfm_common_sse2.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/txfm_common.h"
+#include "aom_dsp/x86/fwd_txfm_sse2.h"
+#include "aom_dsp/x86/txfm_common_sse2.h"
+#include "aom_ports/mem.h"
 
 // TODO(jingning) The high bit-depth functions need rework for performance.
 // After we properly fix the high bit-depth function implementations, this
diff --git a/vpx_dsp/x86/fwd_txfm_sse2.c b/aom_dsp/x86/fwd_txfm_sse2.c
similarity index 95%
rename from vpx_dsp/x86/fwd_txfm_sse2.c
rename to aom_dsp/x86/fwd_txfm_sse2.c
index e14b991..d5b2f0d 100644
--- a/vpx_dsp/x86/fwd_txfm_sse2.c
+++ b/aom_dsp/x86/fwd_txfm_sse2.c
@@ -12,8 +12,8 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/x86/fwd_txfm_sse2.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/x86/fwd_txfm_sse2.h"
 
 void vpx_fdct4x4_1_sse2(const int16_t *input, tran_low_t *output, int stride) {
   __m128i in0, in1;
@@ -229,20 +229,20 @@
 #define FDCT4x4_2D vpx_fdct4x4_sse2
 #define FDCT8x8_2D vpx_fdct8x8_sse2
 #define FDCT16x16_2D vpx_fdct16x16_sse2
-#include "vpx_dsp/x86/fwd_txfm_impl_sse2.h"
+#include "aom_dsp/x86/fwd_txfm_impl_sse2.h"
 #undef FDCT4x4_2D
 #undef FDCT8x8_2D
 #undef FDCT16x16_2D
 
 #define FDCT32x32_2D vpx_fdct32x32_rd_sse2
 #define FDCT32x32_HIGH_PRECISION 0
-#include "vpx_dsp/x86/fwd_dct32x32_impl_sse2.h"
+#include "aom_dsp/x86/fwd_dct32x32_impl_sse2.h"
 #undef FDCT32x32_2D
 #undef FDCT32x32_HIGH_PRECISION
 
 #define FDCT32x32_2D vpx_fdct32x32_sse2
 #define FDCT32x32_HIGH_PRECISION 1
-#include "vpx_dsp/x86/fwd_dct32x32_impl_sse2.h"  // NOLINT
+#include "aom_dsp/x86/fwd_dct32x32_impl_sse2.h"  // NOLINT
 #undef FDCT32x32_2D
 #undef FDCT32x32_HIGH_PRECISION
 #undef DCT_HIGH_BIT_DEPTH
@@ -252,20 +252,20 @@
 #define FDCT4x4_2D vpx_highbd_fdct4x4_sse2
 #define FDCT8x8_2D vpx_highbd_fdct8x8_sse2
 #define FDCT16x16_2D vpx_highbd_fdct16x16_sse2
-#include "vpx_dsp/x86/fwd_txfm_impl_sse2.h"  // NOLINT
+#include "aom_dsp/x86/fwd_txfm_impl_sse2.h"  // NOLINT
 #undef FDCT4x4_2D
 #undef FDCT8x8_2D
 #undef FDCT16x16_2D
 
 #define FDCT32x32_2D vpx_highbd_fdct32x32_rd_sse2
 #define FDCT32x32_HIGH_PRECISION 0
-#include "vpx_dsp/x86/fwd_dct32x32_impl_sse2.h"  // NOLINT
+#include "aom_dsp/x86/fwd_dct32x32_impl_sse2.h"  // NOLINT
 #undef FDCT32x32_2D
 #undef FDCT32x32_HIGH_PRECISION
 
 #define FDCT32x32_2D vpx_highbd_fdct32x32_sse2
 #define FDCT32x32_HIGH_PRECISION 1
-#include "vpx_dsp/x86/fwd_dct32x32_impl_sse2.h"  // NOLINT
+#include "aom_dsp/x86/fwd_dct32x32_impl_sse2.h"  // NOLINT
 #undef FDCT32x32_2D
 #undef FDCT32x32_HIGH_PRECISION
 #undef DCT_HIGH_BIT_DEPTH
diff --git a/vpx_dsp/x86/fwd_txfm_sse2.h b/aom_dsp/x86/fwd_txfm_sse2.h
similarity index 100%
rename from vpx_dsp/x86/fwd_txfm_sse2.h
rename to aom_dsp/x86/fwd_txfm_sse2.h
diff --git a/vpx_dsp/x86/fwd_txfm_ssse3_x86_64.asm b/aom_dsp/x86/fwd_txfm_ssse3_x86_64.asm
similarity index 100%
rename from vpx_dsp/x86/fwd_txfm_ssse3_x86_64.asm
rename to aom_dsp/x86/fwd_txfm_ssse3_x86_64.asm
diff --git a/vpx_dsp/x86/halfpix_variance_impl_sse2.asm b/aom_dsp/x86/halfpix_variance_impl_sse2.asm
similarity index 99%
rename from vpx_dsp/x86/halfpix_variance_impl_sse2.asm
rename to aom_dsp/x86/halfpix_variance_impl_sse2.asm
index cc26bb6..b91d1dc 100644
--- a/vpx_dsp/x86/halfpix_variance_impl_sse2.asm
+++ b/aom_dsp/x86/halfpix_variance_impl_sse2.asm
@@ -8,7 +8,7 @@
 ;  be found in the AUTHORS file in the root of the source tree.
 ;
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 ;void vpx_half_horiz_vert_variance16x_h_sse2(unsigned char *ref,
 ;                                            int ref_stride,
diff --git a/vpx_dsp/x86/halfpix_variance_sse2.c b/aom_dsp/x86/halfpix_variance_sse2.c
similarity index 98%
rename from vpx_dsp/x86/halfpix_variance_sse2.c
rename to aom_dsp/x86/halfpix_variance_sse2.c
index b5c3f5f..8d26b75 100644
--- a/vpx_dsp/x86/halfpix_variance_sse2.c
+++ b/aom_dsp/x86/halfpix_variance_sse2.c
@@ -12,7 +12,7 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 void vpx_half_horiz_vert_variance16x_h_sse2(const unsigned char *ref,
                                             int ref_stride,
diff --git a/vpx_dsp/x86/highbd_intrapred_sse2.asm b/aom_dsp/x86/highbd_intrapred_sse2.asm
similarity index 100%
rename from vpx_dsp/x86/highbd_intrapred_sse2.asm
rename to aom_dsp/x86/highbd_intrapred_sse2.asm
diff --git a/vpx_dsp/x86/highbd_loopfilter_sse2.c b/aom_dsp/x86/highbd_loopfilter_sse2.c
similarity index 99%
rename from vpx_dsp/x86/highbd_loopfilter_sse2.c
rename to aom_dsp/x86/highbd_loopfilter_sse2.c
index 7d66411..15b8283 100644
--- a/vpx_dsp/x86/highbd_loopfilter_sse2.c
+++ b/aom_dsp/x86/highbd_loopfilter_sse2.c
@@ -11,8 +11,8 @@
 #include <emmintrin.h>  // SSE2
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/emmintrin_compat.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/emmintrin_compat.h"
 
 static INLINE __m128i signed_char_clamp_bd_sse2(__m128i value, int bd) {
   __m128i ubounded;
diff --git a/vpx_dsp/x86/highbd_quantize_intrin_sse2.c b/aom_dsp/x86/highbd_quantize_intrin_sse2.c
similarity index 98%
rename from vpx_dsp/x86/highbd_quantize_intrin_sse2.c
rename to aom_dsp/x86/highbd_quantize_intrin_sse2.c
index dad00df..ecde8c2 100644
--- a/vpx_dsp/x86/highbd_quantize_intrin_sse2.c
+++ b/aom_dsp/x86/highbd_quantize_intrin_sse2.c
@@ -11,9 +11,9 @@
 #include <emmintrin.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
 #if CONFIG_VP9_HIGHBITDEPTH
 void vpx_highbd_quantize_b_sse2(const tran_low_t *coeff_ptr, intptr_t count,
diff --git a/vpx_dsp/x86/highbd_sad4d_sse2.asm b/aom_dsp/x86/highbd_sad4d_sse2.asm
similarity index 100%
rename from vpx_dsp/x86/highbd_sad4d_sse2.asm
rename to aom_dsp/x86/highbd_sad4d_sse2.asm
diff --git a/vpx_dsp/x86/highbd_sad_sse2.asm b/aom_dsp/x86/highbd_sad_sse2.asm
similarity index 100%
rename from vpx_dsp/x86/highbd_sad_sse2.asm
rename to aom_dsp/x86/highbd_sad_sse2.asm
diff --git a/vpx_dsp/x86/highbd_subpel_variance_impl_sse2.asm b/aom_dsp/x86/highbd_subpel_variance_impl_sse2.asm
similarity index 100%
rename from vpx_dsp/x86/highbd_subpel_variance_impl_sse2.asm
rename to aom_dsp/x86/highbd_subpel_variance_impl_sse2.asm
diff --git a/vpx_dsp/x86/highbd_subtract_sse2.c b/aom_dsp/x86/highbd_subtract_sse2.c
similarity index 100%
rename from vpx_dsp/x86/highbd_subtract_sse2.c
rename to aom_dsp/x86/highbd_subtract_sse2.c
diff --git a/vpx_dsp/x86/highbd_variance_impl_sse2.asm b/aom_dsp/x86/highbd_variance_impl_sse2.asm
similarity index 99%
rename from vpx_dsp/x86/highbd_variance_impl_sse2.asm
rename to aom_dsp/x86/highbd_variance_impl_sse2.asm
index 923418a..1bf3abb 100644
--- a/vpx_dsp/x86/highbd_variance_impl_sse2.asm
+++ b/aom_dsp/x86/highbd_variance_impl_sse2.asm
@@ -9,7 +9,7 @@
 ;
 
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 ;unsigned int vpx_highbd_calc16x16var_sse2
 ;(
diff --git a/vpx_dsp/x86/highbd_variance_sse2.c b/aom_dsp/x86/highbd_variance_sse2.c
similarity index 99%
rename from vpx_dsp/x86/highbd_variance_sse2.c
rename to aom_dsp/x86/highbd_variance_sse2.c
index 76e8816..90ef4d4 100644
--- a/vpx_dsp/x86/highbd_variance_sse2.c
+++ b/aom_dsp/x86/highbd_variance_sse2.c
@@ -13,7 +13,7 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
 typedef uint32_t (*high_variance_fn_t)(const uint16_t *src, int src_stride,
                                        const uint16_t *ref, int ref_stride,
diff --git a/vpx_dsp/x86/highbd_variance_sse4.c b/aom_dsp/x86/highbd_variance_sse4.c
similarity index 98%
rename from vpx_dsp/x86/highbd_variance_sse4.c
rename to aom_dsp/x86/highbd_variance_sse4.c
index d1d2146..fb4bd8b 100644
--- a/vpx_dsp/x86/highbd_variance_sse4.c
+++ b/aom_dsp/x86/highbd_variance_sse4.c
@@ -13,8 +13,8 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vpx_dsp/variance.h"
-#include "vpx_dsp/vpx_filter.h"
+#include "aom_dsp/variance.h"
+#include "aom_dsp/vpx_filter.h"
 
 static INLINE void variance4x4_64_sse4_1(const uint8_t *a8, int a_stride,
                                          const uint8_t *b8, int b_stride,
diff --git a/vpx_dsp/x86/intrapred_sse2.asm b/aom_dsp/x86/intrapred_sse2.asm
similarity index 100%
rename from vpx_dsp/x86/intrapred_sse2.asm
rename to aom_dsp/x86/intrapred_sse2.asm
diff --git a/vpx_dsp/x86/intrapred_ssse3.asm b/aom_dsp/x86/intrapred_ssse3.asm
similarity index 100%
rename from vpx_dsp/x86/intrapred_ssse3.asm
rename to aom_dsp/x86/intrapred_ssse3.asm
diff --git a/vpx_dsp/x86/inv_txfm_sse2.c b/aom_dsp/x86/inv_txfm_sse2.c
similarity index 99%
rename from vpx_dsp/x86/inv_txfm_sse2.c
rename to aom_dsp/x86/inv_txfm_sse2.c
index a6fc116..97ae44b 100644
--- a/vpx_dsp/x86/inv_txfm_sse2.c
+++ b/aom_dsp/x86/inv_txfm_sse2.c
@@ -9,8 +9,8 @@
  */
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/x86/inv_txfm_sse2.h"
-#include "vpx_dsp/x86/txfm_common_sse2.h"
+#include "aom_dsp/x86/inv_txfm_sse2.h"
+#include "aom_dsp/x86/txfm_common_sse2.h"
 
 #define RECON_AND_STORE4X4(dest, in_x)                    \
   {                                                       \
diff --git a/vpx_dsp/x86/inv_txfm_sse2.h b/aom_dsp/x86/inv_txfm_sse2.h
similarity index 98%
rename from vpx_dsp/x86/inv_txfm_sse2.h
rename to aom_dsp/x86/inv_txfm_sse2.h
index d762a04..d7841bb 100644
--- a/vpx_dsp/x86/inv_txfm_sse2.h
+++ b/aom_dsp/x86/inv_txfm_sse2.h
@@ -13,9 +13,9 @@
 
 #include <emmintrin.h>  // SSE2
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/inv_txfm.h"
-#include "vpx_dsp/x86/txfm_common_sse2.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/inv_txfm.h"
+#include "aom_dsp/x86/txfm_common_sse2.h"
 
 // perform 8x8 transpose
 static INLINE void array_transpose_8x8(__m128i *in, __m128i *res) {
diff --git a/vpx_dsp/x86/inv_txfm_ssse3_x86_64.asm b/aom_dsp/x86/inv_txfm_ssse3_x86_64.asm
similarity index 100%
rename from vpx_dsp/x86/inv_txfm_ssse3_x86_64.asm
rename to aom_dsp/x86/inv_txfm_ssse3_x86_64.asm
diff --git a/vpx_dsp/x86/inv_wht_sse2.asm b/aom_dsp/x86/inv_wht_sse2.asm
similarity index 100%
rename from vpx_dsp/x86/inv_wht_sse2.asm
rename to aom_dsp/x86/inv_wht_sse2.asm
diff --git a/vpx_dsp/x86/loopfilter_avx2.c b/aom_dsp/x86/loopfilter_avx2.c
similarity index 99%
rename from vpx_dsp/x86/loopfilter_avx2.c
rename to aom_dsp/x86/loopfilter_avx2.c
index 85923b4..f444c5d 100644
--- a/vpx_dsp/x86/loopfilter_avx2.c
+++ b/aom_dsp/x86/loopfilter_avx2.c
@@ -11,7 +11,7 @@
 #include <immintrin.h> /* AVX2 */
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
 void vpx_lpf_horizontal_edge_8_avx2(unsigned char *s, int p,
                                     const unsigned char *_blimit,
diff --git a/vpx_dsp/x86/loopfilter_sse2.c b/aom_dsp/x86/loopfilter_sse2.c
similarity index 99%
rename from vpx_dsp/x86/loopfilter_sse2.c
rename to aom_dsp/x86/loopfilter_sse2.c
index e13334a..aaa42f3 100644
--- a/vpx_dsp/x86/loopfilter_sse2.c
+++ b/aom_dsp/x86/loopfilter_sse2.c
@@ -11,8 +11,8 @@
 #include <emmintrin.h>  // SSE2
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/emmintrin_compat.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/emmintrin_compat.h"
 
 static INLINE __m128i abs_diff(__m128i a, __m128i b) {
   return _mm_or_si128(_mm_subs_epu8(a, b), _mm_subs_epu8(b, a));
diff --git a/vpx_dsp/x86/masked_sad_intrin_ssse3.c b/aom_dsp/x86/masked_sad_intrin_ssse3.c
similarity index 99%
rename from vpx_dsp/x86/masked_sad_intrin_ssse3.c
rename to aom_dsp/x86/masked_sad_intrin_ssse3.c
index e07ff5f..cf1fd76 100644
--- a/vpx_dsp/x86/masked_sad_intrin_ssse3.c
+++ b/aom_dsp/x86/masked_sad_intrin_ssse3.c
@@ -12,9 +12,9 @@
 #include <emmintrin.h>
 #include <tmmintrin.h>
 
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 static INLINE __m128i width8_load_2rows(const uint8_t *ptr, int stride) {
   __m128i temp1 = _mm_loadl_epi64((const __m128i *)ptr);
diff --git a/vpx_dsp/x86/masked_variance_intrin_ssse3.c b/aom_dsp/x86/masked_variance_intrin_ssse3.c
similarity index 99%
rename from vpx_dsp/x86/masked_variance_intrin_ssse3.c
rename to aom_dsp/x86/masked_variance_intrin_ssse3.c
index ae08422..c18f870 100644
--- a/vpx_dsp/x86/masked_variance_intrin_ssse3.c
+++ b/aom_dsp/x86/masked_variance_intrin_ssse3.c
@@ -14,9 +14,9 @@
 #include <tmmintrin.h>
 
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
-#include "vpx_dsp/vpx_filter.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom_dsp/vpx_filter.h"
 
 // Half pixel shift
 #define HALF_PIXEL_OFFSET (BIL_SUBPEL_SHIFTS / 2)
diff --git a/vpx_dsp/x86/obmc_sad_sse4.c b/aom_dsp/x86/obmc_sad_sse4.c
similarity index 98%
rename from vpx_dsp/x86/obmc_sad_sse4.c
rename to aom_dsp/x86/obmc_sad_sse4.c
index 8a1581c..b4c839b 100644
--- a/vpx_dsp/x86/obmc_sad_sse4.c
+++ b/aom_dsp/x86/obmc_sad_sse4.c
@@ -12,11 +12,11 @@
 #include <immintrin.h>
 
 #include "./vpx_config.h"
-#include "vpx_ports/mem.h"
-#include "vpx/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom/vpx_integer.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/x86/synonyms.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/x86/synonyms.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 // 8 bit
diff --git a/vpx_dsp/x86/obmc_variance_sse4.c b/aom_dsp/x86/obmc_variance_sse4.c
similarity index 98%
rename from vpx_dsp/x86/obmc_variance_sse4.c
rename to aom_dsp/x86/obmc_variance_sse4.c
index 616db27..71c3c7e 100644
--- a/vpx_dsp/x86/obmc_variance_sse4.c
+++ b/aom_dsp/x86/obmc_variance_sse4.c
@@ -12,12 +12,12 @@
 #include <immintrin.h>
 
 #include "./vpx_config.h"
-#include "vpx_ports/mem.h"
-#include "vpx/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom/vpx_integer.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/x86/synonyms.h"
-#include "vpx_dsp/vpx_filter.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/x86/synonyms.h"
+#include "aom_dsp/vpx_filter.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 // 8 bit
diff --git a/vpx_dsp/x86/quantize_avx_x86_64.asm b/aom_dsp/x86/quantize_avx_x86_64.asm
similarity index 100%
rename from vpx_dsp/x86/quantize_avx_x86_64.asm
rename to aom_dsp/x86/quantize_avx_x86_64.asm
diff --git a/vpx_dsp/x86/quantize_sse2.c b/aom_dsp/x86/quantize_sse2.c
similarity index 99%
rename from vpx_dsp/x86/quantize_sse2.c
rename to aom_dsp/x86/quantize_sse2.c
index 2c7e431..c6ff06d 100644
--- a/vpx_dsp/x86/quantize_sse2.c
+++ b/aom_dsp/x86/quantize_sse2.c
@@ -12,7 +12,7 @@
 #include <xmmintrin.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 static INLINE __m128i load_coefficients(const tran_low_t *coeff_ptr) {
 #if CONFIG_VP9_HIGHBITDEPTH
diff --git a/vpx_dsp/x86/quantize_ssse3_x86_64.asm b/aom_dsp/x86/quantize_ssse3_x86_64.asm
similarity index 100%
rename from vpx_dsp/x86/quantize_ssse3_x86_64.asm
rename to aom_dsp/x86/quantize_ssse3_x86_64.asm
diff --git a/vpx_dsp/x86/sad4d_avx2.c b/aom_dsp/x86/sad4d_avx2.c
similarity index 99%
rename from vpx_dsp/x86/sad4d_avx2.c
rename to aom_dsp/x86/sad4d_avx2.c
index 962b8fb..585d473 100644
--- a/vpx_dsp/x86/sad4d_avx2.c
+++ b/aom_dsp/x86/sad4d_avx2.c
@@ -9,7 +9,7 @@
  */
 #include <immintrin.h>  // AVX2
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 void vpx_sad32x32x4d_avx2(const uint8_t *src, int src_stride,
                           const uint8_t *const ref[4], int ref_stride,
diff --git a/vpx_dsp/x86/sad4d_sse2.asm b/aom_dsp/x86/sad4d_sse2.asm
similarity index 100%
rename from vpx_dsp/x86/sad4d_sse2.asm
rename to aom_dsp/x86/sad4d_sse2.asm
diff --git a/vpx_dsp/x86/sad_avx2.c b/aom_dsp/x86/sad_avx2.c
similarity index 99%
rename from vpx_dsp/x86/sad_avx2.c
rename to aom_dsp/x86/sad_avx2.c
index d944134..c66ab7c 100644
--- a/vpx_dsp/x86/sad_avx2.c
+++ b/aom_dsp/x86/sad_avx2.c
@@ -9,7 +9,7 @@
  */
 #include <immintrin.h>
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
 #define FSAD64_H(h)                                                           \
   unsigned int vpx_sad64x##h##_avx2(const uint8_t *src_ptr, int src_stride,   \
diff --git a/vpx_dsp/x86/sad_sse2.asm b/aom_dsp/x86/sad_sse2.asm
similarity index 100%
rename from vpx_dsp/x86/sad_sse2.asm
rename to aom_dsp/x86/sad_sse2.asm
diff --git a/vpx_dsp/x86/sad_sse3.asm b/aom_dsp/x86/sad_sse3.asm
similarity index 98%
rename from vpx_dsp/x86/sad_sse3.asm
rename to aom_dsp/x86/sad_sse3.asm
index 18279bd..4665fb9 100644
--- a/vpx_dsp/x86/sad_sse3.asm
+++ b/aom_dsp/x86/sad_sse3.asm
@@ -8,7 +8,7 @@
 ;  be found in the AUTHORS file in the root of the source tree.
 ;
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 %macro STACK_FRAME_CREATE_X3 0
 %if ABI_IS_32BIT
@@ -32,7 +32,7 @@
     movsxd      rax,        dword ptr arg(1)    ; src_stride
     movsxd      rdx,        dword ptr arg(3)    ; ref_stride
 %else
-  %if LIBVPX_YASM_WIN64
+  %if LIBAOM_YASM_WIN64
     SAVE_XMM 7, u
     %define     src_ptr     rcx
     %define     src_stride  rdx
@@ -72,7 +72,7 @@
     pop         rsi
     pop         rbp
 %else
-  %if LIBVPX_YASM_WIN64
+  %if LIBAOM_YASM_WIN64
     RESTORE_XMM
   %endif
 %endif
diff --git a/vpx_dsp/x86/sad_sse4.asm b/aom_dsp/x86/sad_sse4.asm
similarity index 99%
rename from vpx_dsp/x86/sad_sse4.asm
rename to aom_dsp/x86/sad_sse4.asm
index bc67447..07e28b4 100644
--- a/vpx_dsp/x86/sad_sse4.asm
+++ b/aom_dsp/x86/sad_sse4.asm
@@ -9,7 +9,7 @@
 ;
 
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 %macro PROCESS_16X2X8 1
 %if %1
diff --git a/vpx_dsp/x86/sad_ssse3.asm b/aom_dsp/x86/sad_ssse3.asm
similarity index 99%
rename from vpx_dsp/x86/sad_ssse3.asm
rename to aom_dsp/x86/sad_ssse3.asm
index 49f204f..8315f97 100644
--- a/vpx_dsp/x86/sad_ssse3.asm
+++ b/aom_dsp/x86/sad_ssse3.asm
@@ -9,7 +9,7 @@
 ;
 
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 %macro PROCESS_16X2X3 1
 %if %1
diff --git a/vpx_dsp/x86/ssim_opt_x86_64.asm b/aom_dsp/x86/ssim_opt_x86_64.asm
similarity index 99%
rename from vpx_dsp/x86/ssim_opt_x86_64.asm
rename to aom_dsp/x86/ssim_opt_x86_64.asm
index 6d58321..fc49c30 100644
--- a/vpx_dsp/x86/ssim_opt_x86_64.asm
+++ b/aom_dsp/x86/ssim_opt_x86_64.asm
@@ -8,7 +8,7 @@
 ;  be found in the AUTHORS file in the root of the source tree.
 ;
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 ; tabulate_ssim - sums sum_s,sum_r,sum_sq_s,sum_sq_r, sum_sxr
 %macro TABULATE_SSIM 0
diff --git a/vpx_dsp/x86/subpel_variance_sse2.asm b/aom_dsp/x86/subpel_variance_sse2.asm
similarity index 100%
rename from vpx_dsp/x86/subpel_variance_sse2.asm
rename to aom_dsp/x86/subpel_variance_sse2.asm
diff --git a/vpx_dsp/x86/subtract_sse2.asm b/aom_dsp/x86/subtract_sse2.asm
similarity index 100%
rename from vpx_dsp/x86/subtract_sse2.asm
rename to aom_dsp/x86/subtract_sse2.asm
diff --git a/vpx_dsp/x86/sum_squares_sse2.c b/aom_dsp/x86/sum_squares_sse2.c
similarity index 99%
rename from vpx_dsp/x86/sum_squares_sse2.c
rename to aom_dsp/x86/sum_squares_sse2.c
index 3d24716..958493c 100644
--- a/vpx_dsp/x86/sum_squares_sse2.c
+++ b/aom_dsp/x86/sum_squares_sse2.c
@@ -12,7 +12,7 @@
 #include <emmintrin.h>
 #include <stdio.h>
 
-#include "vpx_dsp/x86/synonyms.h"
+#include "aom_dsp/x86/synonyms.h"
 
 #include "./vpx_dsp_rtcd.h"
 
diff --git a/vpx_dsp/x86/synonyms.h b/aom_dsp/x86/synonyms.h
similarity index 98%
rename from vpx_dsp/x86/synonyms.h
rename to aom_dsp/x86/synonyms.h
index fb4b942..e815f7e 100644
--- a/vpx_dsp/x86/synonyms.h
+++ b/aom_dsp/x86/synonyms.h
@@ -14,7 +14,7 @@
 #include <immintrin.h>
 
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 /**
  * Various reusable shorthands for x86 SIMD intrinsics.
diff --git a/vpx_dsp/x86/txfm_common_sse2.h b/aom_dsp/x86/txfm_common_sse2.h
similarity index 97%
rename from vpx_dsp/x86/txfm_common_sse2.h
rename to aom_dsp/x86/txfm_common_sse2.h
index e148f5c..aed7d4e 100644
--- a/vpx_dsp/x86/txfm_common_sse2.h
+++ b/aom_dsp/x86/txfm_common_sse2.h
@@ -12,7 +12,7 @@
 #define VPX_DSP_X86_TXFM_COMMON_SSE2_H_
 
 #include <emmintrin.h>
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #define pair_set_epi16(a, b)                                            \
   _mm_set_epi16((int16_t)(b), (int16_t)(a), (int16_t)(b), (int16_t)(a), \
diff --git a/vpx_dsp/x86/variance_avx2.c b/aom_dsp/x86/variance_avx2.c
similarity index 100%
rename from vpx_dsp/x86/variance_avx2.c
rename to aom_dsp/x86/variance_avx2.c
diff --git a/vpx_dsp/x86/variance_impl_avx2.c b/aom_dsp/x86/variance_impl_avx2.c
similarity index 99%
rename from vpx_dsp/x86/variance_impl_avx2.c
rename to aom_dsp/x86/variance_impl_avx2.c
index f26eda3..3166025 100644
--- a/vpx_dsp/x86/variance_impl_avx2.c
+++ b/aom_dsp/x86/variance_impl_avx2.c
@@ -11,7 +11,7 @@
 #include <immintrin.h>  // AVX2
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
 /* clang-format off */
 DECLARE_ALIGNED(32, static const uint8_t, bilinear_filters_avx2[512]) = {
diff --git a/vpx_dsp/x86/variance_sse2.c b/aom_dsp/x86/variance_sse2.c
similarity index 99%
rename from vpx_dsp/x86/variance_sse2.c
rename to aom_dsp/x86/variance_sse2.c
index e40eed7..0788850 100644
--- a/vpx_dsp/x86/variance_sse2.c
+++ b/aom_dsp/x86/variance_sse2.c
@@ -13,7 +13,7 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
 typedef void (*getNxMvar_fn_t)(const unsigned char *src, int src_stride,
                                const unsigned char *ref, int ref_stride,
diff --git a/vpx_dsp/x86/vpx_asm_stubs.c b/aom_dsp/x86/vpx_asm_stubs.c
similarity index 99%
rename from vpx_dsp/x86/vpx_asm_stubs.c
rename to aom_dsp/x86/vpx_asm_stubs.c
index 727d9d1..be56a69 100644
--- a/vpx_dsp/x86/vpx_asm_stubs.c
+++ b/aom_dsp/x86/vpx_asm_stubs.c
@@ -10,7 +10,7 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/x86/convolve.h"
+#include "aom_dsp/x86/convolve.h"
 
 #if HAVE_SSE2
 filter8_1dfunction vpx_filter_block1d16_v8_sse2;
diff --git a/vpx_dsp/x86/vpx_convolve_copy_sse2.asm b/aom_dsp/x86/vpx_convolve_copy_sse2.asm
similarity index 100%
rename from vpx_dsp/x86/vpx_convolve_copy_sse2.asm
rename to aom_dsp/x86/vpx_convolve_copy_sse2.asm
diff --git a/vpx_dsp/x86/vpx_high_subpixel_8t_sse2.asm b/aom_dsp/x86/vpx_high_subpixel_8t_sse2.asm
similarity index 99%
rename from vpx_dsp/x86/vpx_high_subpixel_8t_sse2.asm
rename to aom_dsp/x86/vpx_high_subpixel_8t_sse2.asm
index bfc816f..f02845e 100644
--- a/vpx_dsp/x86/vpx_high_subpixel_8t_sse2.asm
+++ b/aom_dsp/x86/vpx_high_subpixel_8t_sse2.asm
@@ -9,7 +9,7 @@
 ;
 
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 ;Note: tap3 and tap4 have to be applied and added after other taps to avoid
 ;overflow.
diff --git a/vpx_dsp/x86/vpx_high_subpixel_bilinear_sse2.asm b/aom_dsp/x86/vpx_high_subpixel_bilinear_sse2.asm
similarity index 99%
rename from vpx_dsp/x86/vpx_high_subpixel_bilinear_sse2.asm
rename to aom_dsp/x86/vpx_high_subpixel_bilinear_sse2.asm
index 72f2ff7..eacedc5 100644
--- a/vpx_dsp/x86/vpx_high_subpixel_bilinear_sse2.asm
+++ b/aom_dsp/x86/vpx_high_subpixel_bilinear_sse2.asm
@@ -8,7 +8,7 @@
 ;  be found in the AUTHORS file in the root of the source tree.
 ;
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 %macro HIGH_GET_PARAM_4 0
     mov         rdx, arg(5)                 ;filter ptr
diff --git a/vpx_dsp/x86/vpx_subpixel_8t_intrin_avx2.c b/aom_dsp/x86/vpx_subpixel_8t_intrin_avx2.c
similarity index 99%
rename from vpx_dsp/x86/vpx_subpixel_8t_intrin_avx2.c
rename to aom_dsp/x86/vpx_subpixel_8t_intrin_avx2.c
index 6d53b87..2453bca 100644
--- a/vpx_dsp/x86/vpx_subpixel_8t_intrin_avx2.c
+++ b/aom_dsp/x86/vpx_subpixel_8t_intrin_avx2.c
@@ -11,8 +11,8 @@
 #include <immintrin.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/x86/convolve.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/x86/convolve.h"
+#include "aom_ports/mem.h"
 
 // filters for 16_h8 and 16_v8
 DECLARE_ALIGNED(32, static const uint8_t, filt1_global_avx2[32]) = {
diff --git a/vpx_dsp/x86/vpx_subpixel_8t_intrin_ssse3.c b/aom_dsp/x86/vpx_subpixel_8t_intrin_ssse3.c
similarity index 99%
rename from vpx_dsp/x86/vpx_subpixel_8t_intrin_ssse3.c
rename to aom_dsp/x86/vpx_subpixel_8t_intrin_ssse3.c
index 36af4dd..bd472ff 100644
--- a/vpx_dsp/x86/vpx_subpixel_8t_intrin_ssse3.c
+++ b/aom_dsp/x86/vpx_subpixel_8t_intrin_ssse3.c
@@ -11,11 +11,11 @@
 #include <tmmintrin.h>
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/vpx_filter.h"
-#include "vpx_dsp/x86/convolve.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/emmintrin_compat.h"
+#include "aom_dsp/vpx_filter.h"
+#include "aom_dsp/x86/convolve.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/emmintrin_compat.h"
 
 // filters only for the 4_h8 convolution
 DECLARE_ALIGNED(16, static const uint8_t, filt1_4_h8[16]) = {
diff --git a/vpx_dsp/x86/vpx_subpixel_8t_sse2.asm b/aom_dsp/x86/vpx_subpixel_8t_sse2.asm
similarity index 99%
rename from vpx_dsp/x86/vpx_subpixel_8t_sse2.asm
rename to aom_dsp/x86/vpx_subpixel_8t_sse2.asm
index 08f3d6a..b197150 100644
--- a/vpx_dsp/x86/vpx_subpixel_8t_sse2.asm
+++ b/aom_dsp/x86/vpx_subpixel_8t_sse2.asm
@@ -9,7 +9,7 @@
 ;
 
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 ;Note: tap3 and tap4 have to be applied and added after other taps to avoid
 ;overflow.
diff --git a/vpx_dsp/x86/vpx_subpixel_8t_ssse3.asm b/aom_dsp/x86/vpx_subpixel_8t_ssse3.asm
similarity index 100%
rename from vpx_dsp/x86/vpx_subpixel_8t_ssse3.asm
rename to aom_dsp/x86/vpx_subpixel_8t_ssse3.asm
diff --git a/vpx_dsp/x86/vpx_subpixel_bilinear_sse2.asm b/aom_dsp/x86/vpx_subpixel_bilinear_sse2.asm
similarity index 99%
rename from vpx_dsp/x86/vpx_subpixel_bilinear_sse2.asm
rename to aom_dsp/x86/vpx_subpixel_bilinear_sse2.asm
index a378dd0..7de58ff 100644
--- a/vpx_dsp/x86/vpx_subpixel_bilinear_sse2.asm
+++ b/aom_dsp/x86/vpx_subpixel_bilinear_sse2.asm
@@ -8,7 +8,7 @@
 ;  be found in the AUTHORS file in the root of the source tree.
 ;
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 %macro GET_PARAM_4 0
     mov         rdx, arg(5)                 ;filter ptr
diff --git a/vpx_dsp/x86/vpx_subpixel_bilinear_ssse3.asm b/aom_dsp/x86/vpx_subpixel_bilinear_ssse3.asm
similarity index 99%
rename from vpx_dsp/x86/vpx_subpixel_bilinear_ssse3.asm
rename to aom_dsp/x86/vpx_subpixel_bilinear_ssse3.asm
index 538b212..318c7c4 100644
--- a/vpx_dsp/x86/vpx_subpixel_bilinear_ssse3.asm
+++ b/aom_dsp/x86/vpx_subpixel_bilinear_ssse3.asm
@@ -8,7 +8,7 @@
 ;  be found in the AUTHORS file in the root of the source tree.
 ;
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 %macro GET_PARAM_4 0
     mov         rdx, arg(5)                 ;filter ptr
diff --git a/vpx_mem/include/vpx_mem_intrnl.h b/aom_mem/include/vpx_mem_intrnl.h
similarity index 100%
rename from vpx_mem/include/vpx_mem_intrnl.h
rename to aom_mem/include/vpx_mem_intrnl.h
diff --git a/vpx_mem/vpx_mem.c b/aom_mem/vpx_mem.c
similarity index 98%
rename from vpx_mem/vpx_mem.c
rename to aom_mem/vpx_mem.c
index cfced2f..e8aaf6d 100644
--- a/vpx_mem/vpx_mem.c
+++ b/aom_mem/vpx_mem.c
@@ -13,7 +13,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include "include/vpx_mem_intrnl.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 void *vpx_memalign(size_t align, size_t size) {
   void *addr, *x = NULL;
diff --git a/vpx_mem/vpx_mem.h b/aom_mem/vpx_mem.h
similarity index 100%
rename from vpx_mem/vpx_mem.h
rename to aom_mem/vpx_mem.h
diff --git a/vpx_mem/vpx_mem.mk b/aom_mem/vpx_mem.mk
similarity index 100%
rename from vpx_mem/vpx_mem.mk
rename to aom_mem/vpx_mem.mk
diff --git a/vpx_ports/arm.h b/aom_ports/arm.h
similarity index 100%
rename from vpx_ports/arm.h
rename to aom_ports/arm.h
diff --git a/vpx_ports/arm_cpudetect.c b/aom_ports/arm_cpudetect.c
similarity index 99%
rename from vpx_ports/arm_cpudetect.c
rename to aom_ports/arm_cpudetect.c
index e446702..fe98662 100644
--- a/vpx_ports/arm_cpudetect.c
+++ b/aom_ports/arm_cpudetect.c
@@ -10,7 +10,7 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include "vpx_ports/arm.h"
+#include "aom_ports/arm.h"
 #include "./vpx_config.h"
 
 #ifdef WINAPI_FAMILY
diff --git a/vpx_ports/bitops.h b/aom_ports/bitops.h
similarity index 98%
rename from vpx_ports/bitops.h
rename to aom_ports/bitops.h
index 0ed7189..3c76547 100644
--- a/vpx_ports/bitops.h
+++ b/aom_ports/bitops.h
@@ -13,7 +13,7 @@
 
 #include <assert.h>
 
-#include "vpx_ports/msvc.h"
+#include "aom_ports/msvc.h"
 
 #ifdef _MSC_VER
 #if defined(_M_X64) || defined(_M_IX86)
diff --git a/vpx_ports/config.h b/aom_ports/config.h
similarity index 100%
rename from vpx_ports/config.h
rename to aom_ports/config.h
diff --git a/vpx_ports/emmintrin_compat.h b/aom_ports/emmintrin_compat.h
similarity index 100%
rename from vpx_ports/emmintrin_compat.h
rename to aom_ports/emmintrin_compat.h
diff --git a/vpx_ports/emms.asm b/aom_ports/emms.asm
similarity index 92%
rename from vpx_ports/emms.asm
rename to aom_ports/emms.asm
index db8da28..e26ec9a 100644
--- a/vpx_ports/emms.asm
+++ b/aom_ports/emms.asm
@@ -9,7 +9,7 @@
 ;
 
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 section .text
 global sym(vpx_reset_mmx_state) PRIVATE
@@ -18,7 +18,7 @@
     ret
 
 
-%if LIBVPX_YASM_WIN64
+%if LIBAOM_YASM_WIN64
 global sym(vpx_winx64_fldcw) PRIVATE
 sym(vpx_winx64_fldcw):
     sub   rsp, 8
diff --git a/vpx_ports/mem.h b/aom_ports/mem.h
similarity index 98%
rename from vpx_ports/mem.h
rename to aom_ports/mem.h
index 76390f2..34b7455 100644
--- a/vpx_ports/mem.h
+++ b/aom_ports/mem.h
@@ -12,7 +12,7 @@
 #define VPX_PORTS_MEM_H_
 
 #include "vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #if (defined(__GNUC__) && __GNUC__) || defined(__SUNPRO_C)
 #define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))
diff --git a/vpx_ports/mem_ops.h b/aom_ports/mem_ops.h
similarity index 100%
rename from vpx_ports/mem_ops.h
rename to aom_ports/mem_ops.h
diff --git a/vpx_ports/mem_ops_aligned.h b/aom_ports/mem_ops_aligned.h
similarity index 99%
rename from vpx_ports/mem_ops_aligned.h
rename to aom_ports/mem_ops_aligned.h
index ccac391..d352992 100644
--- a/vpx_ports/mem_ops_aligned.h
+++ b/aom_ports/mem_ops_aligned.h
@@ -11,7 +11,7 @@
 #ifndef VPX_PORTS_MEM_OPS_ALIGNED_H_
 #define VPX_PORTS_MEM_OPS_ALIGNED_H_
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 /* \file
  * \brief Provides portable memory access primitives for operating on aligned
diff --git a/vpx_ports/msvc.h b/aom_ports/msvc.h
similarity index 100%
rename from vpx_ports/msvc.h
rename to aom_ports/msvc.h
diff --git a/vpx_ports/system_state.h b/aom_ports/system_state.h
similarity index 100%
rename from vpx_ports/system_state.h
rename to aom_ports/system_state.h
diff --git a/vpx_ports/vpx_once.h b/aom_ports/vpx_once.h
similarity index 100%
rename from vpx_ports/vpx_once.h
rename to aom_ports/vpx_once.h
diff --git a/vpx_ports/vpx_ports.mk b/aom_ports/vpx_ports.mk
similarity index 100%
rename from vpx_ports/vpx_ports.mk
rename to aom_ports/vpx_ports.mk
diff --git a/vpx_ports/vpx_timer.h b/aom_ports/vpx_timer.h
similarity index 98%
rename from vpx_ports/vpx_timer.h
rename to aom_ports/vpx_timer.h
index 4aae30e..6d145da 100644
--- a/vpx_ports/vpx_timer.h
+++ b/aom_ports/vpx_timer.h
@@ -13,7 +13,7 @@
 
 #include "./vpx_config.h"
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #if CONFIG_OS_SUPPORT
 
diff --git a/vpx_ports/x86.h b/aom_ports/x86.h
similarity index 99%
rename from vpx_ports/x86.h
rename to aom_ports/x86.h
index a28807b..3b8ba10 100644
--- a/vpx_ports/x86.h
+++ b/aom_ports/x86.h
@@ -17,7 +17,7 @@
 #endif
 
 #include "vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpx_ports/x86_abi_support.asm b/aom_ports/x86_abi_support.asm
similarity index 96%
rename from vpx_ports/x86_abi_support.asm
rename to aom_ports/x86_abi_support.asm
index d5f7ecc..a2281a9 100644
--- a/vpx_ports/x86_abi_support.asm
+++ b/aom_ports/x86_abi_support.asm
@@ -78,15 +78,15 @@
 %endif
 
 
-; LIBVPX_YASM_WIN64
-; Set LIBVPX_YASM_WIN64 if output is Windows 64bit so the code will work if x64
+; LIBAOM_YASM_WIN64
+; Set LIBAOM_YASM_WIN64 if output is Windows 64bit so the code will work if x64
 ; or win64 is defined on the Yasm command line.
 %ifidn __OUTPUT_FORMAT__,win64
-%define LIBVPX_YASM_WIN64 1
+%define LIBAOM_YASM_WIN64 1
 %elifidn __OUTPUT_FORMAT__,x64
-%define LIBVPX_YASM_WIN64 1
+%define LIBAOM_YASM_WIN64 1
 %else
-%define LIBVPX_YASM_WIN64 0
+%define LIBAOM_YASM_WIN64 0
 %endif
 
 ; sym()
@@ -101,7 +101,7 @@
 %define sym(x) x
 %elifidn __OUTPUT_FORMAT__,elfx32
 %define sym(x) x
-%elif LIBVPX_YASM_WIN64
+%elif LIBAOM_YASM_WIN64
 %define sym(x) x
 %else
 %define sym(x) _ %+ x
@@ -125,7 +125,7 @@
     %define PRIVATE :hidden
   %elifidn __OUTPUT_FORMAT__,elfx32
     %define PRIVATE :hidden
-  %elif LIBVPX_YASM_WIN64
+  %elif LIBAOM_YASM_WIN64
     %define PRIVATE
   %else
     %define PRIVATE :private_extern
@@ -142,7 +142,7 @@
 %else
   ; 64 bit ABI passes arguments in registers. This is a workaround to get up
   ; and running quickly. Relies on SHADOW_ARGS_TO_STACK
-  %if LIBVPX_YASM_WIN64
+  %if LIBAOM_YASM_WIN64
     %define arg(x) [rbp+16+8*x]
   %else
     %define arg(x) [rbp-8-8*x]
@@ -266,7 +266,7 @@
   %endm
   %define UNSHADOW_ARGS
 %else
-%if LIBVPX_YASM_WIN64
+%if LIBAOM_YASM_WIN64
   %macro SHADOW_ARGS_TO_STACK 1 ; argc
     %if %1 > 0
         mov arg(0),rcx
@@ -322,7 +322,7 @@
 ; Win64 ABI requires 16 byte stack alignment, but then pushes an 8 byte return
 ; value. Typically we follow this up with 'push rbp' - re-aligning the stack -
 ; but in some cases this is not done and unaligned movs must be used.
-%if LIBVPX_YASM_WIN64
+%if LIBAOM_YASM_WIN64
 %macro SAVE_XMM 1-2 a
   %if %1 < 6
     %error Only xmm registers 6-15 must be preserved
diff --git a/vpx_scale/generic/gen_scalers.c b/aom_scale/generic/gen_scalers.c
similarity index 98%
rename from vpx_scale/generic/gen_scalers.c
rename to aom_scale/generic/gen_scalers.c
index 5d4dcfc..c4cf255 100644
--- a/vpx_scale/generic/gen_scalers.c
+++ b/aom_scale/generic/gen_scalers.c
@@ -9,8 +9,8 @@
  */
 
 #include "./vpx_scale_rtcd.h"
-#include "vpx_scale/vpx_scale.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom_scale/vpx_scale.h"
+#include "aom_mem/vpx_mem.h"
 /****************************************************************************
 *  Imports
 ****************************************************************************/
diff --git a/vpx_scale/generic/vpx_scale.c b/aom_scale/generic/vpx_scale.c
similarity index 99%
rename from vpx_scale/generic/vpx_scale.c
rename to aom_scale/generic/vpx_scale.c
index dee6a9d..5bf5835 100644
--- a/vpx_scale/generic/vpx_scale.c
+++ b/aom_scale/generic/vpx_scale.c
@@ -20,9 +20,9 @@
 *  Header Files
 ****************************************************************************/
 #include "./vpx_scale_rtcd.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_scale/vpx_scale.h"
-#include "vpx_scale/yv12config.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_scale/vpx_scale.h"
+#include "aom_scale/yv12config.h"
 
 typedef struct {
   int expanded_frame_width;
diff --git a/vpx_scale/generic/yv12config.c b/aom_scale/generic/yv12config.c
similarity index 98%
rename from vpx_scale/generic/yv12config.c
rename to aom_scale/generic/yv12config.c
index 13fbd28..a2ee28e 100644
--- a/vpx_scale/generic/yv12config.c
+++ b/aom_scale/generic/yv12config.c
@@ -10,9 +10,9 @@
 
 #include <assert.h>
 
-#include "vpx_scale/yv12config.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom_scale/yv12config.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
 /****************************************************************************
 *  Exports
diff --git a/vpx_scale/generic/yv12extend.c b/aom_scale/generic/yv12extend.c
similarity index 98%
rename from vpx_scale/generic/yv12extend.c
rename to aom_scale/generic/yv12extend.c
index f172699..fec6ec4 100644
--- a/vpx_scale/generic/yv12extend.c
+++ b/aom_scale/generic/yv12extend.c
@@ -11,10 +11,10 @@
 #include <assert.h>
 #include "./vpx_config.h"
 #include "./vpx_scale_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
-#include "vpx_scale/yv12config.h"
+#include "aom/vpx_integer.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
+#include "aom_scale/yv12config.h"
 
 static void extend_plane(uint8_t *const src, int src_stride, int width,
                          int height, int extend_top, int extend_left,
@@ -234,7 +234,7 @@
   uint8_t *dst = dst_ybc->y_buffer;
 
 #if 0
-  /* These assertions are valid in the codec, but the libvpx-tester uses
+  /* These assertions are valid in the codec, but the libaom-tester uses
    * this code slightly differently.
    */
   assert(src_ybc->y_width == dst_ybc->y_width);
diff --git a/vpx_scale/mips/dspr2/yv12extend_dspr2.c b/aom_scale/mips/dspr2/yv12extend_dspr2.c
similarity index 97%
rename from vpx_scale/mips/dspr2/yv12extend_dspr2.c
rename to aom_scale/mips/dspr2/yv12extend_dspr2.c
index 8a76c60..27a2605 100644
--- a/vpx_scale/mips/dspr2/yv12extend_dspr2.c
+++ b/aom_scale/mips/dspr2/yv12extend_dspr2.c
@@ -11,9 +11,9 @@
 #include <assert.h>
 
 #include "./vpx_config.h"
-#include "vpx_scale/yv12config.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_scale/vpx_scale.h"
+#include "aom_scale/yv12config.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_scale/vpx_scale.h"
 
 #if HAVE_DSPR2
 static void extend_plane(uint8_t *const src, int src_stride, int width,
diff --git a/vpx_scale/vpx_scale.h b/aom_scale/vpx_scale.h
similarity index 95%
rename from vpx_scale/vpx_scale.h
rename to aom_scale/vpx_scale.h
index 478a483..19bb09e 100644
--- a/vpx_scale/vpx_scale.h
+++ b/aom_scale/vpx_scale.h
@@ -11,7 +11,7 @@
 #ifndef VPX_SCALE_VPX_SCALE_H_
 #define VPX_SCALE_VPX_SCALE_H_
 
-#include "vpx_scale/yv12config.h"
+#include "aom_scale/yv12config.h"
 
 extern void vpx_scale_frame(YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
                             unsigned char *temp_area, unsigned char temp_height,
diff --git a/vpx_scale/vpx_scale.mk b/aom_scale/vpx_scale.mk
similarity index 88%
rename from vpx_scale/vpx_scale.mk
rename to aom_scale/vpx_scale.mk
index a49abf3..2ae0d84 100644
--- a/vpx_scale/vpx_scale.mk
+++ b/aom_scale/vpx_scale.mk
@@ -13,4 +13,4 @@
 
 SCALE_SRCS-no += $(SCALE_SRCS_REMOVE-yes)
 
-$(eval $(call rtcd_h_template,vpx_scale_rtcd,vpx_scale/vpx_scale_rtcd.pl))
+$(eval $(call rtcd_h_template,vpx_scale_rtcd,aom_scale/vpx_scale_rtcd.pl))
diff --git a/vpx_scale/vpx_scale_rtcd.c b/aom_scale/vpx_scale_rtcd.c
similarity index 94%
rename from vpx_scale/vpx_scale_rtcd.c
rename to aom_scale/vpx_scale_rtcd.c
index dc4d959..ed32e12 100644
--- a/vpx_scale/vpx_scale_rtcd.c
+++ b/aom_scale/vpx_scale_rtcd.c
@@ -10,6 +10,6 @@
 #include "./vpx_config.h"
 #define RTCD_C
 #include "./vpx_scale_rtcd.h"
-#include "vpx_ports/vpx_once.h"
+#include "aom_ports/vpx_once.h"
 
 void vpx_scale_rtcd() { once(setup_rtcd_internal); }
diff --git a/vpx_scale/vpx_scale_rtcd.pl b/aom_scale/vpx_scale_rtcd.pl
similarity index 100%
rename from vpx_scale/vpx_scale_rtcd.pl
rename to aom_scale/vpx_scale_rtcd.pl
diff --git a/vpx_scale/yv12config.h b/aom_scale/yv12config.h
similarity index 89%
rename from vpx_scale/yv12config.h
rename to aom_scale/yv12config.h
index d581db9..cd7822a 100644
--- a/vpx_scale/yv12config.h
+++ b/aom_scale/yv12config.h
@@ -16,9 +16,9 @@
 #endif
 
 #include "./vpx_config.h"
-#include "vpx/vpx_codec.h"
-#include "vpx/vpx_frame_buffer.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_codec.h"
+#include "aom/vpx_frame_buffer.h"
+#include "aom/vpx_integer.h"
 
 #define VP8BORDERINPIXELS 32
 #if CONFIG_EXT_PARTITION
@@ -79,9 +79,9 @@
 
 // Updates the yv12 buffer config with the frame buffer. |byte_alignment| must
 // be a power of 2, from 32 to 1024. 0 sets legacy alignment. If cb is not
-// NULL, then libvpx is using the frame buffer callbacks to handle memory.
-// If cb is not NULL, libvpx will call cb with minimum size in bytes needed
-// to decode the current frame. If cb is NULL, libvpx will allocate memory
+// NULL, then libaom is using the frame buffer callbacks to handle memory.
+// If cb is not NULL, libaom will call cb with minimum size in bytes needed
+// to decode the current frame. If cb is NULL, libaom will allocate memory
 // internally to decode the current frame. Returns 0 on success. Returns < 0
 // on failure.
 int vpx_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
diff --git a/vpx_util/debug_util.c b/aom_util/debug_util.c
similarity index 97%
rename from vpx_util/debug_util.c
rename to aom_util/debug_util.c
index c05a333..5fe88db 100644
--- a/vpx_util/debug_util.c
+++ b/aom_util/debug_util.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_util/debug_util.h"
+#include "aom_util/debug_util.h"
 #include <assert.h>
 #include <stdio.h>
 #if CONFIG_BITSTREAM_DEBUG
diff --git a/vpx_util/debug_util.h b/aom_util/debug_util.h
similarity index 100%
rename from vpx_util/debug_util.h
rename to aom_util/debug_util.h
diff --git a/vpx_util/endian_inl.h b/aom_util/endian_inl.h
similarity index 98%
rename from vpx_util/endian_inl.h
rename to aom_util/endian_inl.h
index dc38774..36b8138 100644
--- a/vpx_util/endian_inl.h
+++ b/aom_util/endian_inl.h
@@ -14,7 +14,7 @@
 
 #include <stdlib.h>
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #if defined(__GNUC__)
 #define LOCAL_GCC_VERSION ((__GNUC__ << 8) | __GNUC_MINOR__)
diff --git a/vpx_util/vpx_thread.c b/aom_util/vpx_thread.c
similarity index 99%
rename from vpx_util/vpx_thread.c
rename to aom_util/vpx_thread.c
index 04c5fb6..01930b6 100644
--- a/vpx_util/vpx_thread.c
+++ b/aom_util/vpx_thread.c
@@ -15,7 +15,7 @@
 #include <assert.h>
 #include <string.h>  // for memset()
 #include "./vpx_thread.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom_mem/vpx_mem.h"
 
 #if CONFIG_MULTITHREAD
 
diff --git a/vpx_util/vpx_thread.h b/aom_util/vpx_thread.h
similarity index 100%
rename from vpx_util/vpx_thread.h
rename to aom_util/vpx_thread.h
diff --git a/vpx_util/vpx_util.mk b/aom_util/vpx_util.mk
similarity index 100%
rename from vpx_util/vpx_util.mk
rename to aom_util/vpx_util.mk
diff --git a/args.c b/args.c
index 51c0fb9..fb23c88 100644
--- a/args.c
+++ b/args.c
@@ -13,7 +13,7 @@
 #include <limits.h>
 #include "args.h"
 
-#include "vpx_ports/msvc.h"
+#include "aom_ports/msvc.h"
 
 #if defined(__GNUC__) && __GNUC__
 extern void die(const char *fmt, ...) __attribute__((noreturn));
diff --git a/vp10/common/alloccommon.c b/av1/common/alloccommon.c
similarity index 96%
rename from vp10/common/alloccommon.c
rename to av1/common/alloccommon.c
index 2706dad..b6ff12a 100644
--- a/vp10/common/alloccommon.c
+++ b/av1/common/alloccommon.c
@@ -9,13 +9,13 @@
  */
 
 #include "./vpx_config.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom_mem/vpx_mem.h"
 
-#include "vp10/common/alloccommon.h"
-#include "vp10/common/blockd.h"
-#include "vp10/common/entropymode.h"
-#include "vp10/common/entropymv.h"
-#include "vp10/common/onyxc_int.h"
+#include "av1/common/alloccommon.h"
+#include "av1/common/blockd.h"
+#include "av1/common/entropymode.h"
+#include "av1/common/entropymv.h"
+#include "av1/common/onyxc_int.h"
 
 void vp10_set_mb_mi(VP10_COMMON *cm, int width, int height) {
   const int aligned_width = ALIGN_POWER_OF_TWO(width, MI_SIZE_LOG2);
diff --git a/vp10/common/alloccommon.h b/av1/common/alloccommon.h
similarity index 100%
rename from vp10/common/alloccommon.h
rename to av1/common/alloccommon.h
diff --git a/vp10/common/ans.h b/av1/common/ans.h
similarity index 98%
rename from vp10/common/ans.h
rename to av1/common/ans.h
index a7a74fc..c974ada 100644
--- a/vp10/common/ans.h
+++ b/av1/common/ans.h
@@ -15,13 +15,13 @@
 
 #include <assert.h>
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/prob.h"
-#include "vpx_ports/mem_ops.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/prob.h"
+#include "aom_ports/mem_ops.h"
 
 #define ANS_DIVIDE_BY_MULTIPLY 1
 #if ANS_DIVIDE_BY_MULTIPLY
-#include "vp10/common/divide.h"
+#include "av1/common/divide.h"
 #define ANS_DIVREM(quotient, remainder, dividend, divisor) \
   do {                                                     \
     quotient = fastdiv(dividend, divisor);                 \
diff --git a/vp10/common/arm/neon/iht4x4_add_neon.c b/av1/common/arm/neon/iht4x4_add_neon.c
similarity index 99%
rename from vp10/common/arm/neon/iht4x4_add_neon.c
rename to av1/common/arm/neon/iht4x4_add_neon.c
index d074bc9..600e66b 100644
--- a/vp10/common/arm/neon/iht4x4_add_neon.c
+++ b/av1/common/arm/neon/iht4x4_add_neon.c
@@ -13,7 +13,7 @@
 
 #include "./vp10_rtcd.h"
 #include "./vpx_config.h"
-#include "vp10/common/common.h"
+#include "av1/common/common.h"
 
 static int16_t sinpi_1_9 = 0x14a3;
 static int16_t sinpi_2_9 = 0x26c9;
diff --git a/vp10/common/arm/neon/iht8x8_add_neon.c b/av1/common/arm/neon/iht8x8_add_neon.c
similarity index 99%
rename from vp10/common/arm/neon/iht8x8_add_neon.c
rename to av1/common/arm/neon/iht8x8_add_neon.c
index 7e1c83f..ff5578d 100644
--- a/vp10/common/arm/neon/iht8x8_add_neon.c
+++ b/av1/common/arm/neon/iht8x8_add_neon.c
@@ -13,7 +13,7 @@
 
 #include "./vp10_rtcd.h"
 #include "./vpx_config.h"
-#include "vp10/common/common.h"
+#include "av1/common/common.h"
 
 static int16_t cospi_2_64 = 16305;
 static int16_t cospi_4_64 = 16069;
diff --git a/vp10/common/blockd.c b/av1/common/blockd.c
similarity index 98%
rename from vp10/common/blockd.c
rename to av1/common/blockd.c
index 91cc2ed..ee95271 100644
--- a/vp10/common/blockd.c
+++ b/av1/common/blockd.c
@@ -10,9 +10,9 @@
 
 #include <math.h>
 
-#include "vpx_ports/system_state.h"
+#include "aom_ports/system_state.h"
 
-#include "vp10/common/blockd.h"
+#include "av1/common/blockd.h"
 
 PREDICTION_MODE vp10_left_block_mode(const MODE_INFO *cur_mi,
                                      const MODE_INFO *left_mi, int b) {
diff --git a/vp10/common/blockd.h b/av1/common/blockd.h
similarity index 98%
rename from vp10/common/blockd.h
rename to av1/common/blockd.h
index 3c0fdef..4dcc1f0 100644
--- a/vp10/common/blockd.h
+++ b/av1/common/blockd.h
@@ -13,18 +13,18 @@
 
 #include "./vpx_config.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
-#include "vpx_scale/yv12config.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
+#include "aom_scale/yv12config.h"
 
-#include "vp10/common/common_data.h"
-#include "vp10/common/quant_common.h"
-#include "vp10/common/entropy.h"
-#include "vp10/common/entropymode.h"
-#include "vp10/common/mv.h"
-#include "vp10/common/scale.h"
-#include "vp10/common/seg_common.h"
-#include "vp10/common/tile_common.h"
+#include "av1/common/common_data.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/entropy.h"
+#include "av1/common/entropymode.h"
+#include "av1/common/mv.h"
+#include "av1/common/scale.h"
+#include "av1/common/seg_common.h"
+#include "av1/common/tile_common.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/clpf.c b/av1/common/clpf.c
similarity index 98%
rename from vp10/common/clpf.c
rename to av1/common/clpf.c
index 5a6ed70..bba40cb 100644
--- a/vp10/common/clpf.c
+++ b/av1/common/clpf.c
@@ -3,7 +3,7 @@
 (Replace with proper AOM header)
 */
 
-#include "vp10/common/clpf.h"
+#include "av1/common/clpf.h"
 
 // Apply the filter on a single block
 static void clpf_block(const uint8_t *src, uint8_t *dst, int sstride,
diff --git a/vp10/common/clpf.h b/av1/common/clpf.h
similarity index 93%
rename from vp10/common/clpf.h
rename to av1/common/clpf.h
index 1776a3d..5b9d55b 100644
--- a/vp10/common/clpf.h
+++ b/av1/common/clpf.h
@@ -6,7 +6,7 @@
 #ifndef VP10_COMMON_CLPF_H_
 #define VP10_COMMON_CLPF_H_
 
-#include "vp10/common/reconinter.h"
+#include "av1/common/reconinter.h"
 
 // Configuration
 #define CLPF_ALLOW_PIXEL_PARALLELISM \
diff --git a/vp10/common/common.h b/av1/common/common.h
similarity index 95%
rename from vp10/common/common.h
rename to av1/common/common.h
index 41dc1af..4e30034 100644
--- a/vp10/common/common.h
+++ b/av1/common/common.h
@@ -16,10 +16,10 @@
 #include <assert.h>
 
 #include "./vpx_config.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/bitops.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/bitops.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/common_data.h b/av1/common/common_data.h
similarity index 99%
rename from vp10/common/common_data.h
rename to av1/common/common_data.h
index 666aa75..4348f08 100644
--- a/vp10/common/common_data.h
+++ b/av1/common/common_data.h
@@ -11,9 +11,9 @@
 #ifndef VP10_COMMON_COMMON_DATA_H_
 #define VP10_COMMON_COMMON_DATA_H_
 
-#include "vp10/common/enums.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "av1/common/enums.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/debugmodes.c b/av1/common/debugmodes.c
similarity index 97%
rename from vp10/common/debugmodes.c
rename to av1/common/debugmodes.c
index 18bbbec..6c958a8 100644
--- a/vp10/common/debugmodes.c
+++ b/av1/common/debugmodes.c
@@ -10,8 +10,8 @@
 
 #include <stdio.h>
 
-#include "vp10/common/blockd.h"
-#include "vp10/common/onyxc_int.h"
+#include "av1/common/blockd.h"
+#include "av1/common/onyxc_int.h"
 
 static void log_frame_info(VP10_COMMON *cm, const char *str, FILE *f) {
   fprintf(f, "%s", str);
diff --git a/vp10/common/dering.c b/av1/common/dering.c
similarity index 96%
rename from vp10/common/dering.c
rename to av1/common/dering.c
index 47f07f7..7c116a2 100644
--- a/vp10/common/dering.c
+++ b/av1/common/dering.c
@@ -12,11 +12,11 @@
 #include <math.h>
 
 #include "./vpx_scale_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vp10/common/dering.h"
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/od_dering.h"
+#include "aom/vpx_integer.h"
+#include "av1/common/dering.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/od_dering.h"
 
 int compute_level_from_index(int global_level, int gi) {
   static const int dering_gains[DERING_REFINEMENT_LEVELS] = { 0, 11, 16, 22 };
diff --git a/vp10/common/dering.h b/av1/common/dering.h
similarity index 85%
rename from vp10/common/dering.h
rename to av1/common/dering.h
index 706804b..de59c86 100644
--- a/vp10/common/dering.h
+++ b/av1/common/dering.h
@@ -1,11 +1,11 @@
 #ifndef VP10_COMMON_DERING_H_
 #define VP10_COMMON_DERING_H_
 
-#include "vp10/common/od_dering.h"
-#include "vp10/common/onyxc_int.h"
-#include "vpx/vpx_integer.h"
+#include "av1/common/od_dering.h"
+#include "av1/common/onyxc_int.h"
+#include "aom/vpx_integer.h"
 #include "./vpx_config.h"
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/divide.c b/av1/common/divide.c
similarity index 99%
rename from vp10/common/divide.c
rename to av1/common/divide.c
index 2fa95a1..f0c6730 100644
--- a/vp10/common/divide.c
+++ b/av1/common/divide.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vp10/common/divide.h"
+#include "av1/common/divide.h"
 
 /* Constants for divide by multiply for small divisors generated with:
 void init_fastdiv() {
diff --git a/vp10/common/divide.h b/av1/common/divide.h
similarity index 97%
rename from vp10/common/divide.h
rename to av1/common/divide.h
index 2f3c35c..7de6c91 100644
--- a/vp10/common/divide.h
+++ b/av1/common/divide.h
@@ -16,7 +16,7 @@
 #include <limits.h>
 
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/entropy.c b/av1/common/entropy.c
similarity index 99%
rename from vp10/common/entropy.c
rename to av1/common/entropy.c
index 2b84e08..be96c42 100644
--- a/vp10/common/entropy.c
+++ b/av1/common/entropy.c
@@ -8,12 +8,12 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vp10/common/entropy.h"
-#include "vp10/common/blockd.h"
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/entropymode.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx/vpx_integer.h"
+#include "av1/common/entropy.h"
+#include "av1/common/blockd.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/entropymode.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom/vpx_integer.h"
 
 // Unconstrained Node Tree
 /* clang-format off */
diff --git a/vp10/common/entropy.h b/av1/common/entropy.h
similarity index 98%
rename from vp10/common/entropy.h
rename to av1/common/entropy.h
index c90c9c8..b0afd46 100644
--- a/vp10/common/entropy.h
+++ b/av1/common/entropy.h
@@ -11,14 +11,14 @@
 #ifndef VP10_COMMON_ENTROPY_H_
 #define VP10_COMMON_ENTROPY_H_
 
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/prob.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/prob.h"
 
 #if CONFIG_ANS
-#include "vp10/common/ans.h"
+#include "av1/common/ans.h"
 #endif  // CONFIG_ANS
-#include "vp10/common/common.h"
-#include "vp10/common/enums.h"
+#include "av1/common/common.h"
+#include "av1/common/enums.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/entropymode.c b/av1/common/entropymode.c
similarity index 99%
rename from vp10/common/entropymode.c
rename to av1/common/entropymode.c
index 9379122..98e26e7 100644
--- a/vp10/common/entropymode.c
+++ b/av1/common/entropymode.c
@@ -8,11 +8,11 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_mem/vpx_mem.h"
+#include "aom_mem/vpx_mem.h"
 
-#include "vp10/common/reconinter.h"
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/seg_common.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/seg_common.h"
 
 const vpx_prob vp10_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1] =
     { {
diff --git a/vp10/common/entropymode.h b/av1/common/entropymode.h
similarity index 98%
rename from vp10/common/entropymode.h
rename to av1/common/entropymode.h
index addb493..4616aa2 100644
--- a/vp10/common/entropymode.h
+++ b/av1/common/entropymode.h
@@ -11,11 +11,11 @@
 #ifndef VP10_COMMON_ENTROPYMODE_H_
 #define VP10_COMMON_ENTROPYMODE_H_
 
-#include "vp10/common/entropy.h"
-#include "vp10/common/entropymv.h"
-#include "vp10/common/filter.h"
-#include "vp10/common/seg_common.h"
-#include "vpx_dsp/vpx_filter.h"
+#include "av1/common/entropy.h"
+#include "av1/common/entropymv.h"
+#include "av1/common/filter.h"
+#include "av1/common/seg_common.h"
+#include "aom_dsp/vpx_filter.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/entropymv.c b/av1/common/entropymv.c
similarity index 99%
rename from vp10/common/entropymv.c
rename to av1/common/entropymv.c
index 3fa4329..f3dba3f 100644
--- a/vp10/common/entropymv.c
+++ b/av1/common/entropymv.c
@@ -8,8 +8,8 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/entropymv.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/entropymv.h"
 
 // Integer pel reference mv threshold for use of high-precision 1/8 mv
 #define COMPANDED_MVREF_THRESH 8
diff --git a/vp10/common/entropymv.h b/av1/common/entropymv.h
similarity index 98%
rename from vp10/common/entropymv.h
rename to av1/common/entropymv.h
index 93eb50c..c809a67 100644
--- a/vp10/common/entropymv.h
+++ b/av1/common/entropymv.h
@@ -13,9 +13,9 @@
 
 #include "./vpx_config.h"
 
-#include "vpx_dsp/prob.h"
+#include "aom_dsp/prob.h"
 
-#include "vp10/common/mv.h"
+#include "av1/common/mv.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/enums.h b/av1/common/enums.h
similarity index 99%
rename from vp10/common/enums.h
rename to av1/common/enums.h
index 05cb423..8cdec8e 100644
--- a/vp10/common/enums.h
+++ b/av1/common/enums.h
@@ -12,7 +12,7 @@
 #define VP10_COMMON_ENUMS_H_
 
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/filter.c b/av1/common/filter.c
similarity index 99%
rename from vp10/common/filter.c
rename to av1/common/filter.c
index b2d8aeb..46eca5d 100644
--- a/vp10/common/filter.c
+++ b/av1/common/filter.c
@@ -10,7 +10,7 @@
 
 #include <assert.h>
 
-#include "vp10/common/filter.h"
+#include "av1/common/filter.h"
 
 DECLARE_ALIGNED(256, static const InterpKernel,
                 bilinear_filters[SUBPEL_SHIFTS]) = {
diff --git a/vp10/common/filter.h b/av1/common/filter.h
similarity index 97%
rename from vp10/common/filter.h
rename to av1/common/filter.h
index 5f9a6d9..39fad23 100644
--- a/vp10/common/filter.h
+++ b/av1/common/filter.h
@@ -12,9 +12,9 @@
 #define VP10_COMMON_FILTER_H_
 
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/vpx_filter.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/vpx_filter.h"
+#include "aom_ports/mem.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/frame_buffers.c b/av1/common/frame_buffers.c
similarity index 97%
rename from vp10/common/frame_buffers.c
rename to av1/common/frame_buffers.c
index 564fa9c..5c736a9 100644
--- a/vp10/common/frame_buffers.c
+++ b/av1/common/frame_buffers.c
@@ -10,8 +10,8 @@
 
 #include <assert.h>
 
-#include "vp10/common/frame_buffers.h"
-#include "vpx_mem/vpx_mem.h"
+#include "av1/common/frame_buffers.h"
+#include "aom_mem/vpx_mem.h"
 
 int vp10_alloc_internal_frame_buffers(InternalFrameBufferList *list) {
   assert(list != NULL);
diff --git a/vp10/common/frame_buffers.h b/av1/common/frame_buffers.h
similarity index 88%
rename from vp10/common/frame_buffers.h
rename to av1/common/frame_buffers.h
index fa6a2e2..6667132 100644
--- a/vp10/common/frame_buffers.h
+++ b/av1/common/frame_buffers.h
@@ -11,8 +11,8 @@
 #ifndef VP10_COMMON_FRAME_BUFFERS_H_
 #define VP10_COMMON_FRAME_BUFFERS_H_
 
-#include "vpx/vpx_frame_buffer.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_frame_buffer.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -35,14 +35,14 @@
 // Free any data allocated to the frame buffers.
 void vp10_free_internal_frame_buffers(InternalFrameBufferList *list);
 
-// Callback used by libvpx to request an external frame buffer. |cb_priv|
+// Callback used by libaom to request an external frame buffer. |cb_priv|
 // Callback private data, which points to an InternalFrameBufferList.
 // |min_size| is the minimum size in bytes needed to decode the next frame.
 // |fb| pointer to the frame buffer.
 int vp10_get_frame_buffer(void *cb_priv, size_t min_size,
                           vpx_codec_frame_buffer_t *fb);
 
-// Callback used by libvpx when there are no references to the frame buffer.
+// Callback used by libaom when there are no references to the frame buffer.
 // |cb_priv| is not used. |fb| pointer to the frame buffer.
 int vp10_release_frame_buffer(void *cb_priv, vpx_codec_frame_buffer_t *fb);
 
diff --git a/vp10/common/idct.c b/av1/common/idct.c
similarity index 99%
rename from vp10/common/idct.c
rename to av1/common/idct.c
index 8ff4036..83b44d5 100644
--- a/vp10/common/idct.c
+++ b/av1/common/idct.c
@@ -12,12 +12,12 @@
 
 #include "./vp10_rtcd.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vp10/common/blockd.h"
-#include "vp10/common/enums.h"
-#include "vp10/common/idct.h"
-#include "vp10/common/vp10_inv_txfm2d_cfg.h"
-#include "vpx_dsp/inv_txfm.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/blockd.h"
+#include "av1/common/enums.h"
+#include "av1/common/idct.h"
+#include "av1/common/vp10_inv_txfm2d_cfg.h"
+#include "aom_dsp/inv_txfm.h"
+#include "aom_ports/mem.h"
 
 int get_tx_scale(const MACROBLOCKD *const xd, const TX_TYPE tx_type,
                  const TX_SIZE tx_size) {
diff --git a/vp10/common/idct.h b/av1/common/idct.h
similarity index 95%
rename from vp10/common/idct.h
rename to av1/common/idct.h
index 144bfe5..9b3be62 100644
--- a/vp10/common/idct.h
+++ b/av1/common/idct.h
@@ -14,12 +14,12 @@
 #include <assert.h>
 
 #include "./vpx_config.h"
-#include "vp10/common/blockd.h"
-#include "vp10/common/common.h"
-#include "vp10/common/enums.h"
-#include "vpx_dsp/inv_txfm.h"
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/blockd.h"
+#include "av1/common/common.h"
+#include "av1/common/enums.h"
+#include "aom_dsp/inv_txfm.h"
+#include "aom_dsp/txfm_common.h"
+#include "aom_ports/mem.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/intra_filters.h b/av1/common/intra_filters.h
similarity index 100%
rename from vp10/common/intra_filters.h
rename to av1/common/intra_filters.h
diff --git a/vp10/common/loopfilter.c b/av1/common/loopfilter.c
similarity index 99%
rename from vp10/common/loopfilter.c
rename to av1/common/loopfilter.c
index eaa0e7e..e4636a5 100644
--- a/vp10/common/loopfilter.c
+++ b/av1/common/loopfilter.c
@@ -12,15 +12,15 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vp10/common/loopfilter.h"
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/restoration.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/loopfilter.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/restoration.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
-#include "vp10/common/seg_common.h"
+#include "av1/common/seg_common.h"
 
 // 64 bit masks for left transform size. Each 1 represents a position where
 // we should apply a loop filter across the left border of an 8x8 block
diff --git a/vp10/common/loopfilter.h b/av1/common/loopfilter.h
similarity index 97%
rename from vp10/common/loopfilter.h
rename to av1/common/loopfilter.h
index 9716566..b85ed04 100644
--- a/vp10/common/loopfilter.h
+++ b/av1/common/loopfilter.h
@@ -11,12 +11,12 @@
 #ifndef VP10_COMMON_LOOPFILTER_H_
 #define VP10_COMMON_LOOPFILTER_H_
 
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 #include "./vpx_config.h"
 
-#include "vp10/common/blockd.h"
-#include "vp10/common/restoration.h"
-#include "vp10/common/seg_common.h"
+#include "av1/common/blockd.h"
+#include "av1/common/restoration.h"
+#include "av1/common/seg_common.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/mips/dspr2/itrans16_dspr2.c b/av1/common/mips/dspr2/itrans16_dspr2.c
similarity index 93%
rename from vp10/common/mips/dspr2/itrans16_dspr2.c
rename to av1/common/mips/dspr2/itrans16_dspr2.c
index 0fcae87..c0b9b2a 100644
--- a/vp10/common/mips/dspr2/itrans16_dspr2.c
+++ b/av1/common/mips/dspr2/itrans16_dspr2.c
@@ -13,12 +13,12 @@
 
 #include "./vpx_config.h"
 #include "./vp10_rtcd.h"
-#include "vp10/common/common.h"
-#include "vp10/common/blockd.h"
-#include "vp10/common/idct.h"
-#include "vpx_dsp/mips/inv_txfm_dspr2.h"
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/common.h"
+#include "av1/common/blockd.h"
+#include "av1/common/idct.h"
+#include "aom_dsp/mips/inv_txfm_dspr2.h"
+#include "aom_dsp/txfm_common.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 void vp10_iht16x16_256_add_dspr2(const int16_t *input, uint8_t *dest, int pitch,
diff --git a/vp10/common/mips/dspr2/itrans4_dspr2.c b/av1/common/mips/dspr2/itrans4_dspr2.c
similarity index 92%
rename from vp10/common/mips/dspr2/itrans4_dspr2.c
rename to av1/common/mips/dspr2/itrans4_dspr2.c
index 9d10d5e..dcb28c9 100644
--- a/vp10/common/mips/dspr2/itrans4_dspr2.c
+++ b/av1/common/mips/dspr2/itrans4_dspr2.c
@@ -13,12 +13,12 @@
 
 #include "./vpx_config.h"
 #include "./vp10_rtcd.h"
-#include "vp10/common/common.h"
-#include "vp10/common/blockd.h"
-#include "vp10/common/idct.h"
-#include "vpx_dsp/mips/inv_txfm_dspr2.h"
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/common.h"
+#include "av1/common/blockd.h"
+#include "av1/common/idct.h"
+#include "aom_dsp/mips/inv_txfm_dspr2.h"
+#include "aom_dsp/txfm_common.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 void vp10_iht4x4_16_add_dspr2(const int16_t *input, uint8_t *dest,
diff --git a/vp10/common/mips/dspr2/itrans8_dspr2.c b/av1/common/mips/dspr2/itrans8_dspr2.c
similarity index 93%
rename from vp10/common/mips/dspr2/itrans8_dspr2.c
rename to av1/common/mips/dspr2/itrans8_dspr2.c
index 3ebf8ce..761d6f0 100644
--- a/vp10/common/mips/dspr2/itrans8_dspr2.c
+++ b/av1/common/mips/dspr2/itrans8_dspr2.c
@@ -13,11 +13,11 @@
 
 #include "./vpx_config.h"
 #include "./vp10_rtcd.h"
-#include "vp10/common/common.h"
-#include "vp10/common/blockd.h"
-#include "vpx_dsp/mips/inv_txfm_dspr2.h"
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/common.h"
+#include "av1/common/blockd.h"
+#include "aom_dsp/mips/inv_txfm_dspr2.h"
+#include "aom_dsp/txfm_common.h"
+#include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 void vp10_iht8x8_64_add_dspr2(const int16_t *input, uint8_t *dest,
diff --git a/vp10/common/mips/msa/idct16x16_msa.c b/av1/common/mips/msa/idct16x16_msa.c
similarity index 96%
rename from vp10/common/mips/msa/idct16x16_msa.c
rename to av1/common/mips/msa/idct16x16_msa.c
index c73ef37..baa3a97 100644
--- a/vp10/common/mips/msa/idct16x16_msa.c
+++ b/av1/common/mips/msa/idct16x16_msa.c
@@ -10,8 +10,8 @@
 
 #include <assert.h>
 
-#include "vp10/common/enums.h"
-#include "vpx_dsp/mips/inv_txfm_msa.h"
+#include "av1/common/enums.h"
+#include "aom_dsp/mips/inv_txfm_msa.h"
 
 void vp10_iht16x16_256_add_msa(const int16_t *input, uint8_t *dst,
                                int32_t dst_stride, int32_t tx_type) {
diff --git a/vp10/common/mips/msa/idct4x4_msa.c b/av1/common/mips/msa/idct4x4_msa.c
similarity index 96%
rename from vp10/common/mips/msa/idct4x4_msa.c
rename to av1/common/mips/msa/idct4x4_msa.c
index ea4091b..0620df7 100644
--- a/vp10/common/mips/msa/idct4x4_msa.c
+++ b/av1/common/mips/msa/idct4x4_msa.c
@@ -10,8 +10,8 @@
 
 #include <assert.h>
 
-#include "vp10/common/enums.h"
-#include "vpx_dsp/mips/inv_txfm_msa.h"
+#include "av1/common/enums.h"
+#include "aom_dsp/mips/inv_txfm_msa.h"
 
 void vp10_iht4x4_16_add_msa(const int16_t *input, uint8_t *dst,
                             int32_t dst_stride, int32_t tx_type) {
diff --git a/vp10/common/mips/msa/idct8x8_msa.c b/av1/common/mips/msa/idct8x8_msa.c
similarity index 97%
rename from vp10/common/mips/msa/idct8x8_msa.c
rename to av1/common/mips/msa/idct8x8_msa.c
index c62e82d..5c62c4a 100644
--- a/vp10/common/mips/msa/idct8x8_msa.c
+++ b/av1/common/mips/msa/idct8x8_msa.c
@@ -10,8 +10,8 @@
 
 #include <assert.h>
 
-#include "vp10/common/enums.h"
-#include "vpx_dsp/mips/inv_txfm_msa.h"
+#include "av1/common/enums.h"
+#include "aom_dsp/mips/inv_txfm_msa.h"
 
 void vp10_iht8x8_64_add_msa(const int16_t *input, uint8_t *dst,
                             int32_t dst_stride, int32_t tx_type) {
diff --git a/vp10/common/mv.h b/av1/common/mv.h
similarity index 97%
rename from vp10/common/mv.h
rename to av1/common/mv.h
index e379c31..dba3336 100644
--- a/vp10/common/mv.h
+++ b/av1/common/mv.h
@@ -11,10 +11,10 @@
 #ifndef VP10_COMMON_MV_H_
 #define VP10_COMMON_MV_H_
 
-#include "vp10/common/common.h"
-#include "vpx_dsp/vpx_filter.h"
+#include "av1/common/common.h"
+#include "aom_dsp/vpx_filter.h"
 #if CONFIG_GLOBAL_MOTION
-#include "vp10/common/warped_motion.h"
+#include "av1/common/warped_motion.h"
 #endif  // CONFIG_GLOBAL_MOTION
 
 #ifdef __cplusplus
diff --git a/vp10/common/mvref_common.c b/av1/common/mvref_common.c
similarity index 99%
rename from vp10/common/mvref_common.c
rename to av1/common/mvref_common.c
index c5f5c08..836b065 100644
--- a/vp10/common/mvref_common.c
+++ b/av1/common/mvref_common.c
@@ -9,7 +9,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vp10/common/mvref_common.h"
+#include "av1/common/mvref_common.h"
 
 #if CONFIG_REF_MV
 
diff --git a/vp10/common/mvref_common.h b/av1/common/mvref_common.h
similarity index 99%
rename from vp10/common/mvref_common.h
rename to av1/common/mvref_common.h
index 4b25dc7..babd4f0 100644
--- a/vp10/common/mvref_common.h
+++ b/av1/common/mvref_common.h
@@ -10,8 +10,8 @@
 #ifndef VP10_COMMON_MVREF_COMMON_H_
 #define VP10_COMMON_MVREF_COMMON_H_
 
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/blockd.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/blockd.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/od_dering.c b/av1/common/od_dering.c
similarity index 100%
rename from vp10/common/od_dering.c
rename to av1/common/od_dering.c
diff --git a/vp10/common/od_dering.h b/av1/common/od_dering.h
similarity index 100%
rename from vp10/common/od_dering.h
rename to av1/common/od_dering.h
diff --git a/vp10/common/odintrin.c b/av1/common/odintrin.c
similarity index 99%
rename from vp10/common/odintrin.c
rename to av1/common/odintrin.c
index 2024880..b5bbaa6 100644
--- a/vp10/common/odintrin.c
+++ b/av1/common/odintrin.c
@@ -22,7 +22,7 @@
 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
 
-#include "vp10/common/odintrin.h"
+#include "av1/common/odintrin.h"
 
 /*Constants for use with OD_DIVU_SMALL().
   See \cite{Rob05} for details on computing these constants.
diff --git a/vp10/common/odintrin.h b/av1/common/odintrin.h
similarity index 92%
rename from vp10/common/odintrin.h
rename to av1/common/odintrin.h
index b33be69..87b1a36 100644
--- a/vp10/common/odintrin.h
+++ b/av1/common/odintrin.h
@@ -1,10 +1,10 @@
 #ifndef VP10_COMMON_ODINTRIN_H_
 #define VP10_COMMON_ODINTRIN_H_
 
-#include "vp10/common/enums.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/bitops.h"
+#include "av1/common/enums.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/bitops.h"
 
 /*Smallest blocks are 4x4*/
 #define OD_LOG_BSIZE0 (2)
diff --git a/vp10/common/onyxc_int.h b/av1/common/onyxc_int.h
similarity index 97%
rename from vp10/common/onyxc_int.h
rename to av1/common/onyxc_int.h
index cbbce93..55a8112 100644
--- a/vp10/common/onyxc_int.h
+++ b/av1/common/onyxc_int.h
@@ -12,19 +12,19 @@
 #define VP10_COMMON_ONYXC_INT_H_
 
 #include "./vpx_config.h"
-#include "vpx/internal/vpx_codec_internal.h"
-#include "vpx_util/vpx_thread.h"
+#include "aom/internal/vpx_codec_internal.h"
+#include "aom_util/vpx_thread.h"
 #include "./vp10_rtcd.h"
-#include "vp10/common/alloccommon.h"
-#include "vp10/common/loopfilter.h"
-#include "vp10/common/entropymv.h"
-#include "vp10/common/entropy.h"
-#include "vp10/common/entropymode.h"
-#include "vp10/common/mv.h"
-#include "vp10/common/frame_buffers.h"
-#include "vp10/common/quant_common.h"
-#include "vp10/common/tile_common.h"
-#include "vp10/common/restoration.h"
+#include "av1/common/alloccommon.h"
+#include "av1/common/loopfilter.h"
+#include "av1/common/entropymv.h"
+#include "av1/common/entropy.h"
+#include "av1/common/entropymode.h"
+#include "av1/common/mv.h"
+#include "av1/common/frame_buffers.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/tile_common.h"
+#include "av1/common/restoration.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/pred_common.c b/av1/common/pred_common.c
similarity index 99%
rename from vp10/common/pred_common.c
rename to av1/common/pred_common.c
index 27819b9..0e1045e 100644
--- a/vp10/common/pred_common.c
+++ b/av1/common/pred_common.c
@@ -9,10 +9,10 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vp10/common/common.h"
-#include "vp10/common/pred_common.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/seg_common.h"
+#include "av1/common/common.h"
+#include "av1/common/pred_common.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/seg_common.h"
 
 // Returns a context number for the given MB prediction signal
 #if CONFIG_DUAL_FILTER
diff --git a/vp10/common/pred_common.h b/av1/common/pred_common.h
similarity index 98%
rename from vp10/common/pred_common.h
rename to av1/common/pred_common.h
index 63537b7..9a3e3f1 100644
--- a/vp10/common/pred_common.h
+++ b/av1/common/pred_common.h
@@ -11,9 +11,9 @@
 #ifndef VP10_COMMON_PRED_COMMON_H_
 #define VP10_COMMON_PRED_COMMON_H_
 
-#include "vp10/common/blockd.h"
-#include "vp10/common/onyxc_int.h"
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "av1/common/blockd.h"
+#include "av1/common/onyxc_int.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/quant_common.c b/av1/common/quant_common.c
similarity index 99%
rename from vp10/common/quant_common.c
rename to av1/common/quant_common.c
index 148a43e..79d8fb8 100644
--- a/vp10/common/quant_common.c
+++ b/av1/common/quant_common.c
@@ -8,12 +8,12 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vp10/common/common.h"
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/entropy.h"
-#include "vp10/common/quant_common.h"
-#include "vp10/common/seg_common.h"
-#include "vp10/common/blockd.h"
+#include "av1/common/common.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/entropy.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/seg_common.h"
+#include "av1/common/blockd.h"
 
 #if CONFIG_AOM_QM
 static void make_qmatrices(qm_val_t *wmatrix[NUM_QM_LEVELS][2][2][TX_SIZES],
diff --git a/vp10/common/quant_common.h b/av1/common/quant_common.h
similarity index 96%
rename from vp10/common/quant_common.h
rename to av1/common/quant_common.h
index 869dd17..6ceed49 100644
--- a/vp10/common/quant_common.h
+++ b/av1/common/quant_common.h
@@ -11,9 +11,9 @@
 #ifndef VP10_COMMON_QUANT_COMMON_H_
 #define VP10_COMMON_QUANT_COMMON_H_
 
-#include "vpx/vpx_codec.h"
-#include "vp10/common/seg_common.h"
-#include "vp10/common/enums.h"
+#include "aom/vpx_codec.h"
+#include "av1/common/seg_common.h"
+#include "av1/common/enums.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/reconinter.c b/av1/common/reconinter.c
similarity index 99%
rename from vp10/common/reconinter.c
rename to av1/common/reconinter.c
index ef9d7e2..0c3b93a 100644
--- a/vp10/common/reconinter.c
+++ b/av1/common/reconinter.c
@@ -14,17 +14,17 @@
 #include "./vpx_dsp_rtcd.h"
 #include "./vpx_config.h"
 
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/blend.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/blend.h"
 
-#include "vp10/common/blockd.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/reconintra.h"
+#include "av1/common/blockd.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/reconintra.h"
 #if CONFIG_OBMC
-#include "vp10/common/onyxc_int.h"
+#include "av1/common/onyxc_int.h"
 #endif  // CONFIG_OBMC
 #if CONFIG_GLOBAL_MOTION
-#include "vp10/common/warped_motion.h"
+#include "av1/common/warped_motion.h"
 #endif  // CONFIG_GLOBAL_MOTION
 
 #if CONFIG_EXT_INTER
diff --git a/vp10/common/reconinter.h b/av1/common/reconinter.h
similarity index 99%
rename from vp10/common/reconinter.h
rename to av1/common/reconinter.h
index 5afad4e..092926d 100644
--- a/vp10/common/reconinter.h
+++ b/av1/common/reconinter.h
@@ -11,10 +11,10 @@
 #ifndef VP10_COMMON_RECONINTER_H_
 #define VP10_COMMON_RECONINTER_H_
 
-#include "vp10/common/filter.h"
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/vp10_convolve.h"
-#include "vpx/vpx_integer.h"
+#include "av1/common/filter.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/vp10_convolve.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/reconintra.c b/av1/common/reconintra.c
similarity index 99%
rename from vp10/common/reconintra.c
rename to av1/common/reconintra.c
index c728221..801f61e 100644
--- a/vp10/common/reconintra.c
+++ b/av1/common/reconintra.c
@@ -13,19 +13,19 @@
 #include "./vp10_rtcd.h"
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_ports/system_state.h"
+#include "aom_ports/system_state.h"
 
 #if CONFIG_VP9_HIGHBITDEPTH
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_dsp_common.h"
 #endif  // CONFIG_VP9_HIGHBITDEPTH
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/vpx_once.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/vpx_once.h"
 #if CONFIG_EXT_INTRA
-#include "vp10/common/intra_filters.h"
+#include "av1/common/intra_filters.h"
 #endif
-#include "vp10/common/reconintra.h"
-#include "vp10/common/onyxc_int.h"
+#include "av1/common/reconintra.h"
+#include "av1/common/onyxc_int.h"
 
 enum {
   NEED_LEFT = 1 << 1,
diff --git a/vp10/common/reconintra.h b/av1/common/reconintra.h
similarity index 94%
rename from vp10/common/reconintra.h
rename to av1/common/reconintra.h
index 671e5c5..d20b5a4 100644
--- a/vp10/common/reconintra.h
+++ b/av1/common/reconintra.h
@@ -11,8 +11,8 @@
 #ifndef VP10_COMMON_RECONINTRA_H_
 #define VP10_COMMON_RECONINTRA_H_
 
-#include "vpx/vpx_integer.h"
-#include "vp10/common/blockd.h"
+#include "aom/vpx_integer.h"
+#include "av1/common/blockd.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/restoration.c b/av1/common/restoration.c
similarity index 99%
rename from vp10/common/restoration.c
rename to av1/common/restoration.c
index 98978f8..4d4c9fc 100644
--- a/vp10/common/restoration.c
+++ b/av1/common/restoration.c
@@ -12,11 +12,11 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/restoration.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/restoration.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
 #define BILATERAL_PARAM_PRECISION 16
 #define BILATERAL_AMP_RANGE 256
diff --git a/vp10/common/restoration.h b/av1/common/restoration.h
similarity index 98%
rename from vp10/common/restoration.h
rename to av1/common/restoration.h
index 5ad04f9..c1e937a 100644
--- a/vp10/common/restoration.h
+++ b/av1/common/restoration.h
@@ -11,10 +11,10 @@
 #ifndef VP10_COMMON_RESTORATION_H_
 #define VP10_COMMON_RESTORATION_H_
 
+#include "aom_ports/mem.h"
 #include "./vpx_config.h"
-#include "vpx_ports/mem.h"
 
-#include "vp10/common/blockd.h"
+#include "av1/common/blockd.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/scale.c b/av1/common/scale.c
similarity index 98%
rename from vp10/common/scale.c
rename to av1/common/scale.c
index fc2235d..6bd3b74 100644
--- a/vp10/common/scale.c
+++ b/av1/common/scale.c
@@ -9,9 +9,9 @@
  */
 
 #include "./vpx_dsp_rtcd.h"
-#include "vp10/common/filter.h"
-#include "vp10/common/scale.h"
-#include "vpx_dsp/vpx_filter.h"
+#include "av1/common/filter.h"
+#include "av1/common/scale.h"
+#include "aom_dsp/vpx_filter.h"
 
 static INLINE int scaled_x(int val, const struct scale_factors *sf) {
   return (int)((int64_t)val * sf->x_scale_fp >> REF_SCALE_SHIFT);
diff --git a/vp10/common/scale.h b/av1/common/scale.h
similarity index 97%
rename from vp10/common/scale.h
rename to av1/common/scale.h
index a06dd4d..bb02601 100644
--- a/vp10/common/scale.h
+++ b/av1/common/scale.h
@@ -11,8 +11,8 @@
 #ifndef VP10_COMMON_SCALE_H_
 #define VP10_COMMON_SCALE_H_
 
-#include "vp10/common/mv.h"
-#include "vpx_dsp/vpx_convolve.h"
+#include "av1/common/mv.h"
+#include "aom_dsp/vpx_convolve.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/scan.c b/av1/common/scan.c
similarity index 99%
rename from vp10/common/scan.c
rename to av1/common/scan.c
index fbeffc7..dbc36eb 100644
--- a/vp10/common/scan.c
+++ b/av1/common/scan.c
@@ -10,7 +10,7 @@
 
 #include <assert.h>
 
-#include "vp10/common/scan.h"
+#include "av1/common/scan.h"
 
 DECLARE_ALIGNED(16, static const int16_t, default_scan_4x4[16]) = {
   0, 4, 1, 5, 8, 2, 12, 9, 3, 6, 13, 10, 7, 14, 11, 15,
diff --git a/vp10/common/scan.h b/av1/common/scan.h
similarity index 94%
rename from vp10/common/scan.h
rename to av1/common/scan.h
index 32329ba..d2d9f35 100644
--- a/vp10/common/scan.h
+++ b/av1/common/scan.h
@@ -11,11 +11,11 @@
 #ifndef VP10_COMMON_SCAN_H_
 #define VP10_COMMON_SCAN_H_
 
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
 
-#include "vp10/common/enums.h"
-#include "vp10/common/blockd.h"
+#include "av1/common/enums.h"
+#include "av1/common/blockd.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/seg_common.c b/av1/common/seg_common.c
similarity index 93%
rename from vp10/common/seg_common.c
rename to av1/common/seg_common.c
index 7e5dcc2..f131c7b 100644
--- a/vp10/common/seg_common.c
+++ b/av1/common/seg_common.c
@@ -10,10 +10,10 @@
 
 #include <assert.h>
 
-#include "vp10/common/blockd.h"
-#include "vp10/common/loopfilter.h"
-#include "vp10/common/seg_common.h"
-#include "vp10/common/quant_common.h"
+#include "av1/common/blockd.h"
+#include "av1/common/loopfilter.h"
+#include "av1/common/seg_common.h"
+#include "av1/common/quant_common.h"
 
 static const int seg_feature_data_signed[SEG_LVL_MAX] = { 1, 1, 0, 0 };
 
diff --git a/vp10/common/seg_common.h b/av1/common/seg_common.h
similarity index 98%
rename from vp10/common/seg_common.h
rename to av1/common/seg_common.h
index 4f8b80e..7a8fa8f 100644
--- a/vp10/common/seg_common.h
+++ b/av1/common/seg_common.h
@@ -11,7 +11,7 @@
 #ifndef VP10_COMMON_SEG_COMMON_H_
 #define VP10_COMMON_SEG_COMMON_H_
 
-#include "vpx_dsp/prob.h"
+#include "aom_dsp/prob.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/thread_common.c b/av1/common/thread_common.c
similarity index 97%
rename from vp10/common/thread_common.c
rename to av1/common/thread_common.c
index 947c269..ba91a46 100644
--- a/vp10/common/thread_common.c
+++ b/av1/common/thread_common.c
@@ -9,12 +9,12 @@
  */
 
 #include "./vpx_config.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vp10/common/entropymode.h"
-#include "vp10/common/thread_common.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/loopfilter.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "av1/common/entropymode.h"
+#include "av1/common/thread_common.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/loopfilter.h"
 
 #if CONFIG_MULTITHREAD
 static INLINE void mutex_lock(pthread_mutex_t *const mutex) {
diff --git a/vp10/common/thread_common.h b/av1/common/thread_common.h
similarity index 96%
rename from vp10/common/thread_common.h
rename to av1/common/thread_common.h
index 9c623ef..3df9557 100644
--- a/vp10/common/thread_common.h
+++ b/av1/common/thread_common.h
@@ -11,8 +11,8 @@
 #ifndef VP10_COMMON_LOOPFILTER_THREAD_H_
 #define VP10_COMMON_LOOPFILTER_THREAD_H_
 #include "./vpx_config.h"
-#include "vp10/common/loopfilter.h"
-#include "vpx_util/vpx_thread.h"
+#include "av1/common/loopfilter.h"
+#include "aom_util/vpx_thread.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/tile_common.c b/av1/common/tile_common.c
similarity index 94%
rename from vp10/common/tile_common.c
rename to av1/common/tile_common.c
index c478fd2..e79734e 100644
--- a/vp10/common/tile_common.c
+++ b/av1/common/tile_common.c
@@ -8,9 +8,9 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vp10/common/tile_common.h"
-#include "vp10/common/onyxc_int.h"
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "av1/common/tile_common.h"
+#include "av1/common/onyxc_int.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 void vp10_tile_set_row(TileInfo *tile, const VP10_COMMON *cm, int row) {
   tile->mi_row_start = row * cm->tile_height;
diff --git a/vp10/common/tile_common.h b/av1/common/tile_common.h
similarity index 100%
rename from vp10/common/tile_common.h
rename to av1/common/tile_common.h
diff --git a/vp10/common/vp10_convolve.c b/av1/common/vp10_convolve.c
similarity index 98%
rename from vp10/common/vp10_convolve.c
rename to av1/common/vp10_convolve.c
index 6b29025..b62bae5 100644
--- a/vp10/common/vp10_convolve.c
+++ b/av1/common/vp10_convolve.c
@@ -2,10 +2,10 @@
 #include <string.h>
 
 #include "./vp10_rtcd.h"
-#include "vp10/common/vp10_convolve.h"
-#include "vp10/common/filter.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/vp10_convolve.h"
+#include "av1/common/filter.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
 
 #define MAX_BLOCK_WIDTH (MAX_SB_SIZE)
 #define MAX_BLOCK_HEIGHT (MAX_SB_SIZE)
diff --git a/vp10/common/vp10_convolve.h b/av1/common/vp10_convolve.h
similarity index 96%
rename from vp10/common/vp10_convolve.h
rename to av1/common/vp10_convolve.h
index a15da19..9343402 100644
--- a/vp10/common/vp10_convolve.h
+++ b/av1/common/vp10_convolve.h
@@ -1,6 +1,6 @@
 #ifndef VP10_COMMON_VP10_CONVOLVE_H_
 #define VP10_COMMON_VP10_CONVOLVE_H_
-#include "vp10/common/filter.h"
+#include "av1/common/filter.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/vp10_fwd_txfm.c b/av1/common/vp10_fwd_txfm.c
similarity index 99%
rename from vp10/common/vp10_fwd_txfm.c
rename to av1/common/vp10_fwd_txfm.c
index ddcf10e..eb1c018 100644
--- a/vp10/common/vp10_fwd_txfm.c
+++ b/av1/common/vp10_fwd_txfm.c
@@ -9,7 +9,7 @@
  */
 
 #include "./vp10_rtcd.h"
-#include "vp10/common/vp10_fwd_txfm.h"
+#include "av1/common/vp10_fwd_txfm.h"
 
 void vp10_fdct4x4_c(const int16_t *input, tran_low_t *output, int stride) {
   // The 2D transform is done with two passes which are actually pretty
diff --git a/vp10/common/vp10_fwd_txfm.h b/av1/common/vp10_fwd_txfm.h
similarity index 90%
rename from vp10/common/vp10_fwd_txfm.h
rename to av1/common/vp10_fwd_txfm.h
index 46dbf3d..a0481d3 100644
--- a/vp10/common/vp10_fwd_txfm.h
+++ b/av1/common/vp10_fwd_txfm.h
@@ -11,8 +11,8 @@
 #ifndef VP10_COMMON_VP10_FWD_TXFM_H_
 #define VP10_COMMON_VP10_FWD_TXFM_H_
 
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_dsp/fwd_txfm.h"
+#include "aom_dsp/txfm_common.h"
+#include "aom_dsp/fwd_txfm.h"
 
 void vp10_fdct32(const tran_high_t *input, tran_high_t *output, int round);
 #endif  // VP10_COMMON_VP10_FWD_TXFM_H_
diff --git a/vp10/common/vp10_fwd_txfm1d.c b/av1/common/vp10_fwd_txfm1d.c
similarity index 99%
rename from vp10/common/vp10_fwd_txfm1d.c
rename to av1/common/vp10_fwd_txfm1d.c
index 2447429..6dff077 100644
--- a/vp10/common/vp10_fwd_txfm1d.c
+++ b/av1/common/vp10_fwd_txfm1d.c
@@ -9,7 +9,7 @@
  */
 
 #include <stdlib.h>
-#include "vp10/common/vp10_fwd_txfm1d.h"
+#include "av1/common/vp10_fwd_txfm1d.h"
 #if CONFIG_COEFFICIENT_RANGE_CHECKING
 #define range_check(stage, input, buf, size, bit)                         \
   {                                                                       \
diff --git a/vp10/common/vp10_fwd_txfm1d.h b/av1/common/vp10_fwd_txfm1d.h
similarity index 97%
rename from vp10/common/vp10_fwd_txfm1d.h
rename to av1/common/vp10_fwd_txfm1d.h
index d06e305..ab9d2ee 100644
--- a/vp10/common/vp10_fwd_txfm1d.h
+++ b/av1/common/vp10_fwd_txfm1d.h
@@ -11,7 +11,7 @@
 #ifndef VP10_FWD_TXFM1D_H_
 #define VP10_FWD_TXFM1D_H_
 
-#include "vp10/common/vp10_txfm.h"
+#include "av1/common/vp10_txfm.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/vp10_fwd_txfm2d.c b/av1/common/vp10_fwd_txfm2d.c
similarity index 97%
rename from vp10/common/vp10_fwd_txfm2d.c
rename to av1/common/vp10_fwd_txfm2d.c
index 77922ad..85c6b68 100644
--- a/vp10/common/vp10_fwd_txfm2d.c
+++ b/av1/common/vp10_fwd_txfm2d.c
@@ -11,10 +11,10 @@
 #include <assert.h>
 
 #include "./vp10_rtcd.h"
-#include "vp10/common/enums.h"
-#include "vp10/common/vp10_fwd_txfm1d.h"
-#include "vp10/common/vp10_fwd_txfm2d_cfg.h"
-#include "vp10/common/vp10_txfm.h"
+#include "av1/common/enums.h"
+#include "av1/common/vp10_fwd_txfm1d.h"
+#include "av1/common/vp10_fwd_txfm2d_cfg.h"
+#include "av1/common/vp10_txfm.h"
 
 static INLINE TxfmFunc fwd_txfm_type_to_func(TXFM_TYPE txfm_type) {
   switch (txfm_type) {
diff --git a/vp10/common/vp10_fwd_txfm2d_cfg.h b/av1/common/vp10_fwd_txfm2d_cfg.h
similarity index 99%
rename from vp10/common/vp10_fwd_txfm2d_cfg.h
rename to av1/common/vp10_fwd_txfm2d_cfg.h
index f069adf..f780b87 100644
--- a/vp10/common/vp10_fwd_txfm2d_cfg.h
+++ b/av1/common/vp10_fwd_txfm2d_cfg.h
@@ -10,8 +10,8 @@
 
 #ifndef VP10_FWD_TXFM2D_CFG_H_
 #define VP10_FWD_TXFM2D_CFG_H_
-#include "vp10/common/enums.h"
-#include "vp10/common/vp10_fwd_txfm1d.h"
+#include "av1/common/enums.h"
+#include "av1/common/vp10_fwd_txfm1d.h"
 //  ---------------- config fwd_dct_dct_4 ----------------
 static const int8_t fwd_shift_dct_dct_4[3] = { 2, 0, 0 };
 static const int8_t fwd_stage_range_col_dct_dct_4[4] = { 15, 16, 17, 17 };
diff --git a/vp10/common/vp10_inv_txfm.c b/av1/common/vp10_inv_txfm.c
similarity index 99%
rename from vp10/common/vp10_inv_txfm.c
rename to av1/common/vp10_inv_txfm.c
index f3bcf8b..a74de09 100644
--- a/vp10/common/vp10_inv_txfm.c
+++ b/av1/common/vp10_inv_txfm.c
@@ -13,7 +13,7 @@
 #include <string.h>
 
 #include "./vp10_rtcd.h"
-#include "vp10/common/vp10_inv_txfm.h"
+#include "av1/common/vp10_inv_txfm.h"
 
 void vp10_iwht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride) {
   /* 4-point reversible, orthonormal inverse Walsh-Hadamard in 3.5 adds,
diff --git a/vp10/common/vp10_inv_txfm.h b/av1/common/vp10_inv_txfm.h
similarity index 97%
rename from vp10/common/vp10_inv_txfm.h
rename to av1/common/vp10_inv_txfm.h
index f2c42ac..b53db48 100644
--- a/vp10/common/vp10_inv_txfm.h
+++ b/av1/common/vp10_inv_txfm.h
@@ -14,9 +14,9 @@
 #include <assert.h>
 
 #include "./vpx_config.h"
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_dsp/inv_txfm.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/txfm_common.h"
+#include "aom_dsp/inv_txfm.h"
+#include "aom_ports/mem.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/vp10_inv_txfm1d.c b/av1/common/vp10_inv_txfm1d.c
similarity index 99%
rename from vp10/common/vp10_inv_txfm1d.c
rename to av1/common/vp10_inv_txfm1d.c
index b22bb79..76fb623 100644
--- a/vp10/common/vp10_inv_txfm1d.c
+++ b/av1/common/vp10_inv_txfm1d.c
@@ -9,7 +9,7 @@
  */
 
 #include <stdlib.h>
-#include "vp10/common/vp10_inv_txfm1d.h"
+#include "av1/common/vp10_inv_txfm1d.h"
 #if CONFIG_COEFFICIENT_RANGE_CHECKING
 #define range_check(stage, input, buf, size, bit)                         \
   {                                                                       \
diff --git a/vp10/common/vp10_inv_txfm1d.h b/av1/common/vp10_inv_txfm1d.h
similarity index 97%
rename from vp10/common/vp10_inv_txfm1d.h
rename to av1/common/vp10_inv_txfm1d.h
index fd547a6..21b80bf 100644
--- a/vp10/common/vp10_inv_txfm1d.h
+++ b/av1/common/vp10_inv_txfm1d.h
@@ -11,7 +11,7 @@
 #ifndef VP10_INV_TXFM1D_H_
 #define VP10_INV_TXFM1D_H_
 
-#include "vp10/common/vp10_txfm.h"
+#include "av1/common/vp10_txfm.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/common/vp10_inv_txfm2d.c b/av1/common/vp10_inv_txfm2d.c
similarity index 97%
rename from vp10/common/vp10_inv_txfm2d.c
rename to av1/common/vp10_inv_txfm2d.c
index b364244..60606c9 100644
--- a/vp10/common/vp10_inv_txfm2d.c
+++ b/av1/common/vp10_inv_txfm2d.c
@@ -9,10 +9,10 @@
  */
 
 #include "./vp10_rtcd.h"
-#include "vp10/common/enums.h"
-#include "vp10/common/vp10_txfm.h"
-#include "vp10/common/vp10_inv_txfm1d.h"
-#include "vp10/common/vp10_inv_txfm2d_cfg.h"
+#include "av1/common/enums.h"
+#include "av1/common/vp10_txfm.h"
+#include "av1/common/vp10_inv_txfm1d.h"
+#include "av1/common/vp10_inv_txfm2d_cfg.h"
 
 static INLINE TxfmFunc inv_txfm_type_to_func(TXFM_TYPE txfm_type) {
   switch (txfm_type) {
diff --git a/vp10/common/vp10_inv_txfm2d_cfg.h b/av1/common/vp10_inv_txfm2d_cfg.h
similarity index 99%
rename from vp10/common/vp10_inv_txfm2d_cfg.h
rename to av1/common/vp10_inv_txfm2d_cfg.h
index 195c319..9bfa420 100644
--- a/vp10/common/vp10_inv_txfm2d_cfg.h
+++ b/av1/common/vp10_inv_txfm2d_cfg.h
@@ -10,7 +10,7 @@
 
 #ifndef VP10_INV_TXFM2D_CFG_H_
 #define VP10_INV_TXFM2D_CFG_H_
-#include "vp10/common/vp10_inv_txfm1d.h"
+#include "av1/common/vp10_inv_txfm1d.h"
 //  ---------------- config inv_dct_dct_4 ----------------
 static const int8_t inv_shift_dct_dct_4[2] = { 0, -4 };
 static const int8_t inv_stage_range_col_dct_dct_4[4] = { 18, 18, 17, 17 };
diff --git a/vp10/common/vp10_rtcd.c b/av1/common/vp10_rtcd.c
similarity index 95%
rename from vp10/common/vp10_rtcd.c
rename to av1/common/vp10_rtcd.c
index 0fd8ab0..7fce6b9 100644
--- a/vp10/common/vp10_rtcd.c
+++ b/av1/common/vp10_rtcd.c
@@ -10,7 +10,7 @@
 #include "./vpx_config.h"
 #define RTCD_C
 #include "./vp10_rtcd.h"
-#include "vpx_ports/vpx_once.h"
+#include "aom_ports/vpx_once.h"
 
 void vp10_rtcd() {
   // TODO(JBB): Remove this once, by insuring that both the encoder and
diff --git a/vp10/common/vp10_rtcd_defs.pl b/av1/common/vp10_rtcd_defs.pl
similarity index 99%
rename from vp10/common/vp10_rtcd_defs.pl
rename to av1/common/vp10_rtcd_defs.pl
index cfb56ca..4a16723 100644
--- a/vp10/common/vp10_rtcd_defs.pl
+++ b/av1/common/vp10_rtcd_defs.pl
@@ -4,12 +4,12 @@
  * VP10
  */
 
-#include "vpx/vpx_integer.h"
-#include "vp10/common/common.h"
-#include "vp10/common/enums.h"
-#include "vp10/common/quant_common.h"
-#include "vp10/common/filter.h"
-#include "vp10/common/vp10_txfm.h"
+#include "aom/vpx_integer.h"
+#include "av1/common/common.h"
+#include "av1/common/enums.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/filter.h"
+#include "av1/common/vp10_txfm.h"
 
 struct macroblockd;
 
diff --git a/vp10/common/vp10_txfm.h b/av1/common/vp10_txfm.h
similarity index 98%
rename from vp10/common/vp10_txfm.h
rename to av1/common/vp10_txfm.h
index 567e7b8..bfeb3ea 100644
--- a/vp10/common/vp10_txfm.h
+++ b/av1/common/vp10_txfm.h
@@ -14,9 +14,9 @@
 #include <math.h>
 #include <stdio.h>
 
-#include "vp10/common/enums.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "av1/common/enums.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 static const int cos_bit_min = 10;
 static const int cos_bit_max = 16;
diff --git a/vp10/common/warped_motion.c b/av1/common/warped_motion.c
similarity index 99%
rename from vp10/common/warped_motion.c
rename to av1/common/warped_motion.c
index dd9a91e..5f76453 100644
--- a/vp10/common/warped_motion.c
+++ b/av1/common/warped_motion.c
@@ -14,7 +14,7 @@
 #include <math.h>
 #include <assert.h>
 
-#include "vp10/common/warped_motion.h"
+#include "av1/common/warped_motion.h"
 
 static ProjectPointsType get_project_points_type(TransformationType type) {
   switch (type) {
diff --git a/vp10/common/warped_motion.h b/av1/common/warped_motion.h
similarity index 98%
rename from vp10/common/warped_motion.h
rename to av1/common/warped_motion.h
index 1b317f1..a9c57f9 100644
--- a/vp10/common/warped_motion.h
+++ b/av1/common/warped_motion.h
@@ -18,8 +18,8 @@
 #include <assert.h>
 
 #include "./vpx_config.h"
-#include "vpx_ports/mem.h"
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 // Bits of precision used for the model
 #define WARPEDMODEL_PREC_BITS 8
diff --git a/vp10/common/x86/highbd_inv_txfm_sse4.c b/av1/common/x86/highbd_inv_txfm_sse4.c
similarity index 99%
rename from vp10/common/x86/highbd_inv_txfm_sse4.c
rename to av1/common/x86/highbd_inv_txfm_sse4.c
index 92db49b..f3686eb 100644
--- a/vp10/common/x86/highbd_inv_txfm_sse4.c
+++ b/av1/common/x86/highbd_inv_txfm_sse4.c
@@ -13,8 +13,8 @@
 
 #include "./vp10_rtcd.h"
 #include "./vpx_config.h"
-#include "vp10/common/vp10_inv_txfm2d_cfg.h"
-#include "vp10/common/x86/highbd_txfm_utility_sse4.h"
+#include "av1/common/vp10_inv_txfm2d_cfg.h"
+#include "av1/common/x86/highbd_txfm_utility_sse4.h"
 
 static INLINE void load_buffer_4x4(const int32_t *coeff, __m128i *in) {
   in[0] = _mm_load_si128((const __m128i *)(coeff + 0));
diff --git a/vp10/common/x86/highbd_txfm_utility_sse4.h b/av1/common/x86/highbd_txfm_utility_sse4.h
similarity index 100%
rename from vp10/common/x86/highbd_txfm_utility_sse4.h
rename to av1/common/x86/highbd_txfm_utility_sse4.h
diff --git a/vp10/common/x86/idct_intrin_sse2.c b/av1/common/x86/idct_intrin_sse2.c
similarity index 98%
rename from vp10/common/x86/idct_intrin_sse2.c
rename to av1/common/x86/idct_intrin_sse2.c
index fd9f5cf..70bf9bf 100644
--- a/vp10/common/x86/idct_intrin_sse2.c
+++ b/av1/common/x86/idct_intrin_sse2.c
@@ -9,10 +9,10 @@
  */
 
 #include "./vp10_rtcd.h"
-#include "vpx_dsp/x86/inv_txfm_sse2.h"
-#include "vpx_dsp/x86/txfm_common_sse2.h"
-#include "vpx_ports/mem.h"
-#include "vp10/common/enums.h"
+#include "aom_dsp/x86/inv_txfm_sse2.h"
+#include "aom_dsp/x86/txfm_common_sse2.h"
+#include "aom_ports/mem.h"
+#include "av1/common/enums.h"
 
 #if CONFIG_EXT_TX
 static INLINE void fliplr_4x4(__m128i in[2]) {
diff --git a/vp10/common/x86/reconintra_sse4.c b/av1/common/x86/reconintra_sse4.c
similarity index 99%
rename from vp10/common/x86/reconintra_sse4.c
rename to av1/common/x86/reconintra_sse4.c
index d8ce329..cac34a6 100644
--- a/vp10/common/x86/reconintra_sse4.c
+++ b/av1/common/x86/reconintra_sse4.c
@@ -10,9 +10,9 @@
 #include <smmintrin.h>
 
 #include "./vp10_rtcd.h"
-#include "vpx_ports/mem.h"
-#include "vp10/common/enums.h"
-#include "vp10/common/intra_filters.h"
+#include "aom_ports/mem.h"
+#include "av1/common/enums.h"
+#include "av1/common/intra_filters.h"
 
 static INLINE void AddPixelsSmall(const uint8_t *above, const uint8_t *left,
                                   __m128i *sum) {
diff --git a/vp10/common/x86/vp10_convolve_filters_ssse3.c b/av1/common/x86/vp10_convolve_filters_ssse3.c
similarity index 99%
rename from vp10/common/x86/vp10_convolve_filters_ssse3.c
rename to av1/common/x86/vp10_convolve_filters_ssse3.c
index 7cda988..b842589 100644
--- a/vp10/common/x86/vp10_convolve_filters_ssse3.c
+++ b/av1/common/x86/vp10_convolve_filters_ssse3.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 #include "./vpx_config.h"
-#include "vp10/common/filter.h"
+#include "av1/common/filter.h"
 
 #if CONFIG_EXT_INTERP
 DECLARE_ALIGNED(16, const int8_t,
diff --git a/vp10/common/x86/vp10_convolve_ssse3.c b/av1/common/x86/vp10_convolve_ssse3.c
similarity index 99%
rename from vp10/common/x86/vp10_convolve_ssse3.c
rename to av1/common/x86/vp10_convolve_ssse3.c
index 68cfca7..e891d74 100644
--- a/vp10/common/x86/vp10_convolve_ssse3.c
+++ b/av1/common/x86/vp10_convolve_ssse3.c
@@ -12,7 +12,7 @@
 #include <tmmintrin.h>
 
 #include "./vp10_rtcd.h"
-#include "vp10/common/filter.h"
+#include "av1/common/filter.h"
 
 #define WIDTH_BOUND (16)
 #define HEIGHT_BOUND (16)
diff --git a/vpx_dsp/x86/fwd_dct32x32_impl_sse2.h b/av1/common/x86/vp10_fwd_dct32x32_impl_sse2.h
similarity index 99%
rename from vpx_dsp/x86/fwd_dct32x32_impl_sse2.h
rename to av1/common/x86/vp10_fwd_dct32x32_impl_sse2.h
index 3744333..e7d63fe 100644
--- a/vpx_dsp/x86/fwd_dct32x32_impl_sse2.h
+++ b/av1/common/x86/vp10_fwd_dct32x32_impl_sse2.h
@@ -10,9 +10,10 @@
 
 #include <emmintrin.h>  // SSE2
 
-#include "vpx_dsp/fwd_txfm.h"
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_dsp/x86/txfm_common_sse2.h"
+#include "./vp10_rtcd.h"
+#include "av1/common/vp10_fwd_txfm.h"
+#include "aom_dsp/txfm_common.h"
+#include "aom_dsp/x86/txfm_common_sse2.h"
 
 // TODO(jingning) The high bit-depth version needs re-work for performance.
 // The current SSE2 implementation also causes cross reference to the static
@@ -21,31 +22,31 @@
 #define ADD_EPI16 _mm_adds_epi16
 #define SUB_EPI16 _mm_subs_epi16
 #if FDCT32x32_HIGH_PRECISION
-void vpx_fdct32x32_rows_c(const int16_t *intermediate, tran_low_t *out) {
+void vp10_fdct32x32_rows_c(const int16_t *intermediate, tran_low_t *out) {
   int i, j;
   for (i = 0; i < 32; ++i) {
     tran_high_t temp_in[32], temp_out[32];
     for (j = 0; j < 32; ++j) temp_in[j] = intermediate[j * 32 + i];
-    vpx_fdct32(temp_in, temp_out, 0);
+    vp10_fdct32(temp_in, temp_out, 0);
     for (j = 0; j < 32; ++j)
       out[j + i * 32] =
           (tran_low_t)((temp_out[j] + 1 + (temp_out[j] < 0)) >> 2);
   }
 }
-#define HIGH_FDCT32x32_2D_C vpx_highbd_fdct32x32_c
-#define HIGH_FDCT32x32_2D_ROWS_C vpx_fdct32x32_rows_c
+#define HIGH_FDCT32x32_2D_C vp10_highbd_fdct32x32_c
+#define HIGH_FDCT32x32_2D_ROWS_C vp10_fdct32x32_rows_c
 #else
-void vpx_fdct32x32_rd_rows_c(const int16_t *intermediate, tran_low_t *out) {
+void vp10_fdct32x32_rd_rows_c(const int16_t *intermediate, tran_low_t *out) {
   int i, j;
   for (i = 0; i < 32; ++i) {
     tran_high_t temp_in[32], temp_out[32];
     for (j = 0; j < 32; ++j) temp_in[j] = intermediate[j * 32 + i];
-    vpx_fdct32(temp_in, temp_out, 1);
+    vp10_fdct32(temp_in, temp_out, 1);
     for (j = 0; j < 32; ++j) out[j + i * 32] = (tran_low_t)temp_out[j];
   }
 }
-#define HIGH_FDCT32x32_2D_C vpx_highbd_fdct32x32_rd_c
-#define HIGH_FDCT32x32_2D_ROWS_C vpx_fdct32x32_rd_rows_c
+#define HIGH_FDCT32x32_2D_C vp10_highbd_fdct32x32_rd_c
+#define HIGH_FDCT32x32_2D_ROWS_C vp10_fdct32x32_rd_rows_c
 #endif  // FDCT32x32_HIGH_PRECISION
 #else
 #define ADD_EPI16 _mm_add_epi16
@@ -3145,7 +3146,7 @@
             tr2_6 = _mm_sub_epi16(tr2_6, tr2_6_0);
             tr2_7 = _mm_sub_epi16(tr2_7, tr2_7_0);
             //           ... and here.
-            //           PS: also change code in vp9/encoder/vp9_dct.c
+            //           PS: also change code in av1/encoder/dct.c
             tr2_0 = _mm_add_epi16(tr2_0, kOne);
             tr2_1 = _mm_add_epi16(tr2_1, kOne);
             tr2_2 = _mm_add_epi16(tr2_2, kOne);
diff --git a/vp10/common/x86/vp10_fwd_txfm1d_sse4.c b/av1/common/x86/vp10_fwd_txfm1d_sse4.c
similarity index 99%
rename from vp10/common/x86/vp10_fwd_txfm1d_sse4.c
rename to av1/common/x86/vp10_fwd_txfm1d_sse4.c
index 3e57020..902c9b2 100644
--- a/vp10/common/x86/vp10_fwd_txfm1d_sse4.c
+++ b/av1/common/x86/vp10_fwd_txfm1d_sse4.c
@@ -1,4 +1,4 @@
-#include "vp10/common/x86/vp10_txfm1d_sse4.h"
+#include "av1/common/x86/vp10_txfm1d_sse4.h"
 
 void vp10_fdct4_new_sse4_1(const __m128i *input, __m128i *output,
                            const int8_t *cos_bit, const int8_t *stage_range) {
diff --git a/vp10/common/x86/vp10_fwd_txfm2d_sse4.c b/av1/common/x86/vp10_fwd_txfm2d_sse4.c
similarity index 96%
rename from vp10/common/x86/vp10_fwd_txfm2d_sse4.c
rename to av1/common/x86/vp10_fwd_txfm2d_sse4.c
index 279a351..a59a0c8 100644
--- a/vp10/common/x86/vp10_fwd_txfm2d_sse4.c
+++ b/av1/common/x86/vp10_fwd_txfm2d_sse4.c
@@ -9,9 +9,9 @@
  */
 
 #include "./vp10_rtcd.h"
-#include "vp10/common/enums.h"
-#include "vp10/common/vp10_txfm.h"
-#include "vp10/common/x86/vp10_txfm1d_sse4.h"
+#include "av1/common/enums.h"
+#include "av1/common/vp10_txfm.h"
+#include "av1/common/x86/vp10_txfm1d_sse4.h"
 
 static INLINE void int16_array_with_stride_to_int32_array_without_stride(
     const int16_t *input, int stride, int32_t *output, int txfm1d_size) {
diff --git a/vp10/common/x86/vp10_fwd_txfm_impl_sse2.h b/av1/common/x86/vp10_fwd_txfm_impl_sse2.h
similarity index 99%
rename from vp10/common/x86/vp10_fwd_txfm_impl_sse2.h
rename to av1/common/x86/vp10_fwd_txfm_impl_sse2.h
index b3bcc4a..9bb8abc 100644
--- a/vp10/common/x86/vp10_fwd_txfm_impl_sse2.h
+++ b/av1/common/x86/vp10_fwd_txfm_impl_sse2.h
@@ -11,10 +11,10 @@
 #include <emmintrin.h>  // SSE2
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_dsp/x86/fwd_txfm_sse2.h"
-#include "vpx_dsp/x86/txfm_common_sse2.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/txfm_common.h"
+#include "aom_dsp/x86/fwd_txfm_sse2.h"
+#include "aom_dsp/x86/txfm_common_sse2.h"
+#include "aom_ports/mem.h"
 
 // TODO(jingning) The high bit-depth functions need rework for performance.
 // After we properly fix the high bit-depth function implementations, this
diff --git a/vp10/common/x86/vp10_fwd_txfm_sse2.c b/av1/common/x86/vp10_fwd_txfm_sse2.c
similarity index 94%
rename from vp10/common/x86/vp10_fwd_txfm_sse2.c
rename to av1/common/x86/vp10_fwd_txfm_sse2.c
index 015e86e..05ec539 100644
--- a/vp10/common/x86/vp10_fwd_txfm_sse2.c
+++ b/av1/common/x86/vp10_fwd_txfm_sse2.c
@@ -12,8 +12,8 @@
 
 #include "./vp10_rtcd.h"
 #include "./vpx_config.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/x86/fwd_txfm_sse2.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/x86/fwd_txfm_sse2.h"
 
 void vp10_fdct4x4_1_sse2(const int16_t *input, tran_low_t *output, int stride) {
   __m128i in0, in1;
@@ -229,20 +229,20 @@
 #define FDCT4x4_2D vp10_fdct4x4_sse2
 #define FDCT8x8_2D vp10_fdct8x8_sse2
 #define FDCT16x16_2D vp10_fdct16x16_sse2
-#include "vp10/common/x86/vp10_fwd_txfm_impl_sse2.h"
+#include "av1/common/x86/vp10_fwd_txfm_impl_sse2.h"
 #undef FDCT4x4_2D
 #undef FDCT8x8_2D
 #undef FDCT16x16_2D
 
 #define FDCT32x32_2D vp10_fdct32x32_rd_sse2
 #define FDCT32x32_HIGH_PRECISION 0
-#include "vp10/common/x86/vp10_fwd_dct32x32_impl_sse2.h"
+#include "av1/common/x86/vp10_fwd_dct32x32_impl_sse2.h"
 #undef FDCT32x32_2D
 #undef FDCT32x32_HIGH_PRECISION
 
 #define FDCT32x32_2D vp10_fdct32x32_sse2
 #define FDCT32x32_HIGH_PRECISION 1
-#include "vp10/common/x86/vp10_fwd_dct32x32_impl_sse2.h"  // NOLINT
+#include "av1/common/x86/vp10_fwd_dct32x32_impl_sse2.h"  // NOLINT
 #undef FDCT32x32_2D
 #undef FDCT32x32_HIGH_PRECISION
 #undef DCT_HIGH_BIT_DEPTH
@@ -252,20 +252,20 @@
 #define FDCT4x4_2D vp10_highbd_fdct4x4_sse2
 #define FDCT8x8_2D vp10_highbd_fdct8x8_sse2
 #define FDCT16x16_2D vp10_highbd_fdct16x16_sse2
-#include "vp10/common/x86/vp10_fwd_txfm_impl_sse2.h"  // NOLINT
+#include "av1/common/x86/vp10_fwd_txfm_impl_sse2.h"  // NOLINT
 #undef FDCT4x4_2D
 #undef FDCT8x8_2D
 #undef FDCT16x16_2D
 
 #define FDCT32x32_2D vp10_highbd_fdct32x32_rd_sse2
 #define FDCT32x32_HIGH_PRECISION 0
-#include "vp10/common/x86/vp10_fwd_dct32x32_impl_sse2.h"  // NOLINT
+#include "av1/common/x86/vp10_fwd_dct32x32_impl_sse2.h"  // NOLINT
 #undef FDCT32x32_2D
 #undef FDCT32x32_HIGH_PRECISION
 
 #define FDCT32x32_2D vp10_highbd_fdct32x32_sse2
 #define FDCT32x32_HIGH_PRECISION 1
-#include "vp10/common/x86/vp10_fwd_dct32x32_impl_sse2.h"  // NOLINT
+#include "av1/common/x86/vp10_fwd_dct32x32_impl_sse2.h"  // NOLINT
 #undef FDCT32x32_2D
 #undef FDCT32x32_HIGH_PRECISION
 #undef DCT_HIGH_BIT_DEPTH
diff --git a/vp10/common/x86/vp10_highbd_convolve_filters_sse4.c b/av1/common/x86/vp10_highbd_convolve_filters_sse4.c
similarity index 99%
rename from vp10/common/x86/vp10_highbd_convolve_filters_sse4.c
rename to av1/common/x86/vp10_highbd_convolve_filters_sse4.c
index ed04345..7f3630c 100644
--- a/vp10/common/x86/vp10_highbd_convolve_filters_sse4.c
+++ b/av1/common/x86/vp10_highbd_convolve_filters_sse4.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 #include "./vpx_config.h"
-#include "vp10/common/filter.h"
+#include "av1/common/filter.h"
 
 #if CONFIG_VP9_HIGHBITDEPTH
 #if CONFIG_EXT_INTERP
diff --git a/vp10/common/x86/vp10_highbd_convolve_sse4.c b/av1/common/x86/vp10_highbd_convolve_sse4.c
similarity index 99%
rename from vp10/common/x86/vp10_highbd_convolve_sse4.c
rename to av1/common/x86/vp10_highbd_convolve_sse4.c
index e8009a8..ea78400 100644
--- a/vp10/common/x86/vp10_highbd_convolve_sse4.c
+++ b/av1/common/x86/vp10_highbd_convolve_sse4.c
@@ -12,7 +12,7 @@
 #include <smmintrin.h>
 
 #include "./vp10_rtcd.h"
-#include "vp10/common/filter.h"
+#include "av1/common/filter.h"
 
 typedef void (*TransposeSave)(const int width, int pixelsNum, uint32_t *src,
                               int src_stride, uint16_t *dst, int dst_stride,
diff --git a/vp10/common/x86/vp10_inv_txfm_sse2.c b/av1/common/x86/vp10_inv_txfm_sse2.c
similarity index 99%
rename from vp10/common/x86/vp10_inv_txfm_sse2.c
rename to av1/common/x86/vp10_inv_txfm_sse2.c
index b731cdf..b09933e 100644
--- a/vp10/common/x86/vp10_inv_txfm_sse2.c
+++ b/av1/common/x86/vp10_inv_txfm_sse2.c
@@ -9,8 +9,8 @@
  */
 
 #include "./vp10_rtcd.h"
-#include "vp10/common/x86/vp10_inv_txfm_sse2.h"
-#include "vpx_dsp/x86/txfm_common_sse2.h"
+#include "av1/common/x86/vp10_inv_txfm_sse2.h"
+#include "aom_dsp/x86/txfm_common_sse2.h"
 
 #define RECON_AND_STORE4X4(dest, in_x)                    \
   {                                                       \
diff --git a/vp10/common/x86/vp10_inv_txfm_sse2.h b/av1/common/x86/vp10_inv_txfm_sse2.h
similarity index 98%
rename from vp10/common/x86/vp10_inv_txfm_sse2.h
rename to av1/common/x86/vp10_inv_txfm_sse2.h
index 9d8c46b..0839ab9 100644
--- a/vp10/common/x86/vp10_inv_txfm_sse2.h
+++ b/av1/common/x86/vp10_inv_txfm_sse2.h
@@ -13,8 +13,8 @@
 
 #include <emmintrin.h>  // SSE2
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
-#include "vp10/common/vp10_inv_txfm.h"
+#include "aom/vpx_integer.h"
+#include "av1/common/vp10_inv_txfm.h"
 
 // perform 8x8 transpose
 static INLINE void array_transpose_8x8(__m128i *in, __m128i *res) {
diff --git a/vp10/common/x86/vp10_txfm1d_sse4.h b/av1/common/x86/vp10_txfm1d_sse4.h
similarity index 99%
rename from vp10/common/x86/vp10_txfm1d_sse4.h
rename to av1/common/x86/vp10_txfm1d_sse4.h
index dec72bd..f05a54c 100644
--- a/vp10/common/x86/vp10_txfm1d_sse4.h
+++ b/av1/common/x86/vp10_txfm1d_sse4.h
@@ -2,7 +2,7 @@
 #define VP10_TXMF1D_SSE2_H_
 
 #include <smmintrin.h>
-#include "vp10/common/vp10_txfm.h"
+#include "av1/common/vp10_txfm.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/decoder/bitreader.h b/av1/decoder/bitreader.h
similarity index 91%
rename from vp10/decoder/bitreader.h
rename to av1/decoder/bitreader.h
index baf8f03..75d6aa4 100644
--- a/vp10/decoder/bitreader.h
+++ b/av1/decoder/bitreader.h
@@ -17,8 +17,8 @@
 #include "./vpx_config.h"
 
 #if CONFIG_ANS
-#include "vp10/common/ans.h"
-#include "vpx/vp8dx.h"  // for vp10_decrypt_cb
+#include "av1/common/ans.h"
+#include "aom/vp8dx.h"  // for vp10_decrypt_cb
 #define vp10_reader struct AnsDecoder
 #define vp10_reader_has_error ans_reader_has_error
 #define vp10_read uabs_read
@@ -26,7 +26,7 @@
 #define vp10_read_literal uabs_read_literal
 #define vp10_read_tree uabs_read_tree
 #else
-#include "vpx_dsp/bitreader.h"
+#include "aom_dsp/bitreader.h"
 #define vp10_reader vpx_reader
 #define vp10_reader_has_error vpx_reader_has_error
 #define vp10_read vpx_read
diff --git a/vp10/decoder/decodeframe.c b/av1/decoder/decodeframe.c
similarity index 99%
rename from vp10/decoder/decodeframe.c
rename to av1/decoder/decodeframe.c
index bddfe57..0f90c20 100644
--- a/vp10/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -15,40 +15,41 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 #include "./vpx_scale_rtcd.h"
+#include "./vpx_config.h"
 
-#include "vp10/decoder/bitreader.h"
-#include "vpx_dsp/bitreader_buffer.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/mem_ops.h"
-#include "vpx_scale/vpx_scale.h"
-#include "vpx_util/vpx_thread.h"
+#include "aom_dsp/bitreader_buffer.h"
+#include "av1/decoder/bitreader.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/mem_ops.h"
+#include "aom_scale/vpx_scale.h"
+#include "aom_util/vpx_thread.h"
 
-#include "vp10/common/alloccommon.h"
+#include "av1/common/alloccommon.h"
 #if CONFIG_CLPF
-#include "vp10/common/clpf.h"
+#include "av1/common/clpf.h"
 #endif
-#include "vp10/common/common.h"
+#include "av1/common/common.h"
 #if CONFIG_DERING
-#include "vp10/common/dering.h"
+#include "av1/common/dering.h"
 #endif  // CONFIG_DERING
-#include "vp10/common/entropy.h"
-#include "vp10/common/entropymode.h"
-#include "vp10/common/idct.h"
-#include "vp10/common/pred_common.h"
-#include "vp10/common/quant_common.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/reconintra.h"
-#include "vp10/common/seg_common.h"
-#include "vp10/common/thread_common.h"
-#include "vp10/common/tile_common.h"
+#include "av1/common/entropy.h"
+#include "av1/common/entropymode.h"
+#include "av1/common/idct.h"
+#include "av1/common/thread_common.h"
+#include "av1/common/pred_common.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/reconintra.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/seg_common.h"
+#include "av1/common/tile_common.h"
 
-#include "vp10/decoder/decodeframe.h"
-#include "vp10/decoder/decodemv.h"
-#include "vp10/decoder/decoder.h"
-#include "vp10/decoder/detokenize.h"
-#include "vp10/decoder/dsubexp.h"
+#include "av1/decoder/decodeframe.h"
+#include "av1/decoder/detokenize.h"
+#include "av1/decoder/decodemv.h"
+#include "av1/decoder/decoder.h"
+#include "av1/decoder/dsubexp.h"
 
 #define MAX_VPX_HEADER_SIZE 80
 
diff --git a/vp10/decoder/decodeframe.h b/av1/decoder/decodeframe.h
similarity index 100%
rename from vp10/decoder/decodeframe.h
rename to av1/decoder/decodeframe.h
diff --git a/vp10/decoder/decodemv.c b/av1/decoder/decodemv.c
similarity index 99%
rename from vp10/decoder/decodemv.c
rename to av1/decoder/decodemv.c
index 983ad81..ef776a0 100644
--- a/vp10/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -10,19 +10,19 @@
 
 #include <assert.h>
 
-#include "vp10/common/common.h"
-#include "vp10/common/entropy.h"
-#include "vp10/common/entropymode.h"
-#include "vp10/common/entropymv.h"
-#include "vp10/common/mvref_common.h"
-#include "vp10/common/pred_common.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/seg_common.h"
+#include "av1/common/common.h"
+#include "av1/common/entropy.h"
+#include "av1/common/entropymode.h"
+#include "av1/common/entropymv.h"
+#include "av1/common/mvref_common.h"
+#include "av1/common/pred_common.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/seg_common.h"
 
-#include "vp10/decoder/decodemv.h"
-#include "vp10/decoder/decodeframe.h"
+#include "av1/decoder/decodemv.h"
+#include "av1/decoder/decodeframe.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 static INLINE int read_uniform(vp10_reader *r, int n) {
   int l = get_unsigned_bits(n);
diff --git a/vp10/decoder/decodemv.h b/av1/decoder/decodemv.h
similarity index 92%
rename from vp10/decoder/decodemv.h
rename to av1/decoder/decodemv.h
index b99f5a5..59fdd70 100644
--- a/vp10/decoder/decodemv.h
+++ b/av1/decoder/decodemv.h
@@ -11,9 +11,9 @@
 #ifndef VP10_DECODER_DECODEMV_H_
 #define VP10_DECODER_DECODEMV_H_
 
-#include "vp10/decoder/bitreader.h"
+#include "av1/decoder/bitreader.h"
 
-#include "vp10/decoder/decoder.h"
+#include "av1/decoder/decoder.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/decoder/decoder.c b/av1/decoder/decoder.c
similarity index 96%
rename from vp10/decoder/decoder.c
rename to av1/decoder/decoder.c
index 4d13315..4cea36b 100644
--- a/vp10/decoder/decoder.c
+++ b/av1/decoder/decoder.c
@@ -16,23 +16,23 @@
 #include "./vpx_dsp_rtcd.h"
 #include "./vpx_scale_rtcd.h"
 
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/system_state.h"
-#include "vpx_ports/vpx_once.h"
-#include "vpx_ports/vpx_timer.h"
-#include "vpx_scale/vpx_scale.h"
-#include "vpx_util/vpx_thread.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/system_state.h"
+#include "aom_ports/vpx_once.h"
+#include "aom_ports/vpx_timer.h"
+#include "aom_scale/vpx_scale.h"
+#include "aom_util/vpx_thread.h"
 
-#include "vp10/common/alloccommon.h"
-#include "vp10/common/loopfilter.h"
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/quant_common.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/reconintra.h"
+#include "av1/common/alloccommon.h"
+#include "av1/common/loopfilter.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/reconintra.h"
 
-#include "vp10/decoder/decodeframe.h"
-#include "vp10/decoder/decoder.h"
-#include "vp10/decoder/detokenize.h"
+#include "av1/decoder/decodeframe.h"
+#include "av1/decoder/decoder.h"
+#include "av1/decoder/detokenize.h"
 
 static void initialize_dec(void) {
   static volatile int init_done = 0;
diff --git a/vp10/decoder/decoder.h b/av1/decoder/decoder.h
similarity index 95%
rename from vp10/decoder/decoder.h
rename to av1/decoder/decoder.h
index 092c4a9..47a5a7b 100644
--- a/vp10/decoder/decoder.h
+++ b/av1/decoder/decoder.h
@@ -13,14 +13,14 @@
 
 #include "./vpx_config.h"
 
-#include "vpx/vpx_codec.h"
-#include "vp10/decoder/bitreader.h"
-#include "vpx_scale/yv12config.h"
-#include "vpx_util/vpx_thread.h"
+#include "aom/vpx_codec.h"
+#include "av1/decoder/bitreader.h"
+#include "aom_scale/yv12config.h"
+#include "aom_util/vpx_thread.h"
 
-#include "vp10/common/thread_common.h"
-#include "vp10/common/onyxc_int.h"
-#include "vp10/decoder/dthread.h"
+#include "av1/common/thread_common.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/decoder/dthread.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/decoder/detokenize.c b/av1/decoder/detokenize.c
similarity index 98%
rename from vp10/decoder/detokenize.c
rename to av1/decoder/detokenize.c
index b827451..0fba999 100644
--- a/vp10/decoder/detokenize.c
+++ b/av1/decoder/detokenize.c
@@ -8,16 +8,16 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
-#include "vp10/common/ans.h"
-#include "vp10/common/blockd.h"
-#include "vp10/common/common.h"
-#include "vp10/common/entropy.h"
-#include "vp10/common/idct.h"
+#include "av1/common/ans.h"
+#include "av1/common/blockd.h"
+#include "av1/common/common.h"
+#include "av1/common/entropy.h"
+#include "av1/common/idct.h"
 
-#include "vp10/decoder/detokenize.h"
+#include "av1/decoder/detokenize.h"
 
 #define EOB_CONTEXT_NODE 0
 #define ZERO_CONTEXT_NODE 1
diff --git a/vp10/decoder/detokenize.h b/av1/decoder/detokenize.h
similarity index 91%
rename from vp10/decoder/detokenize.h
rename to av1/decoder/detokenize.h
index 5e60a4c..279c193 100644
--- a/vp10/decoder/detokenize.h
+++ b/av1/decoder/detokenize.h
@@ -11,9 +11,9 @@
 #ifndef VP10_DECODER_DETOKENIZE_H_
 #define VP10_DECODER_DETOKENIZE_H_
 
-#include "vp10/decoder/decoder.h"
-#include "vp10/common/ans.h"
-#include "vp10/common/scan.h"
+#include "av1/decoder/decoder.h"
+#include "av1/common/ans.h"
+#include "av1/common/scan.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/decoder/dsubexp.c b/av1/decoder/dsubexp.c
similarity index 97%
rename from vp10/decoder/dsubexp.c
rename to av1/decoder/dsubexp.c
index 8310b7a..146a1de 100644
--- a/vp10/decoder/dsubexp.c
+++ b/av1/decoder/dsubexp.c
@@ -10,9 +10,9 @@
 
 #include <assert.h>
 
-#include "vp10/common/entropy.h"
+#include "av1/common/entropy.h"
 
-#include "vp10/decoder/dsubexp.h"
+#include "av1/decoder/dsubexp.h"
 
 static int inv_recenter_nonneg(int v, int m) {
   if (v > 2 * m) return v;
diff --git a/vp10/decoder/dsubexp.h b/av1/decoder/dsubexp.h
similarity index 96%
rename from vp10/decoder/dsubexp.h
rename to av1/decoder/dsubexp.h
index 04aad0c..b8980f7 100644
--- a/vp10/decoder/dsubexp.h
+++ b/av1/decoder/dsubexp.h
@@ -11,7 +11,7 @@
 #ifndef VP10_DECODER_DSUBEXP_H_
 #define VP10_DECODER_DSUBEXP_H_
 
-#include "vp10/decoder/bitreader.h"
+#include "av1/decoder/bitreader.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/decoder/dthread.c b/av1/decoder/dthread.c
similarity index 97%
rename from vp10/decoder/dthread.c
rename to av1/decoder/dthread.c
index 2df3c1c..d9a2ce1 100644
--- a/vp10/decoder/dthread.c
+++ b/av1/decoder/dthread.c
@@ -9,10 +9,10 @@
  */
 
 #include "./vpx_config.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/decoder/dthread.h"
-#include "vp10/decoder/decoder.h"
+#include "aom_mem/vpx_mem.h"
+#include "av1/common/reconinter.h"
+#include "av1/decoder/dthread.h"
+#include "av1/decoder/decoder.h"
 
 // #define DEBUG_THREAD
 
diff --git a/vp10/decoder/dthread.h b/av1/decoder/dthread.h
similarity index 96%
rename from vp10/decoder/dthread.h
rename to av1/decoder/dthread.h
index cb78462..ef548b6 100644
--- a/vp10/decoder/dthread.h
+++ b/av1/decoder/dthread.h
@@ -12,8 +12,8 @@
 #define VP10_DECODER_DTHREAD_H_
 
 #include "./vpx_config.h"
-#include "vpx_util/vpx_thread.h"
-#include "vpx/internal/vpx_codec_internal.h"
+#include "aom_util/vpx_thread.h"
+#include "aom/internal/vpx_codec_internal.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/aq_complexity.c b/av1/encoder/aq_complexity.c
similarity index 95%
rename from vp10/encoder/aq_complexity.c
rename to av1/encoder/aq_complexity.c
index 317b2b3..173556e 100644
--- a/vp10/encoder/aq_complexity.c
+++ b/av1/encoder/aq_complexity.c
@@ -11,13 +11,13 @@
 #include <limits.h>
 #include <math.h>
 
-#include "vp10/encoder/aq_complexity.h"
-#include "vp10/encoder/aq_variance.h"
-#include "vp10/encoder/encodeframe.h"
-#include "vp10/common/seg_common.h"
-#include "vp10/encoder/segmentation.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/system_state.h"
+#include "av1/encoder/aq_complexity.h"
+#include "av1/encoder/aq_variance.h"
+#include "av1/encoder/encodeframe.h"
+#include "av1/common/seg_common.h"
+#include "av1/encoder/segmentation.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/system_state.h"
 
 #define AQ_C_SEGMENTS 5
 #define DEFAULT_AQ2_SEG 3  // Neutral Q segment
diff --git a/vp10/encoder/aq_complexity.h b/av1/encoder/aq_complexity.h
similarity index 96%
rename from vp10/encoder/aq_complexity.h
rename to av1/encoder/aq_complexity.h
index 5ed461b..db85406 100644
--- a/vp10/encoder/aq_complexity.h
+++ b/av1/encoder/aq_complexity.h
@@ -15,7 +15,7 @@
 extern "C" {
 #endif
 
-#include "vp10/common/enums.h"
+#include "av1/common/enums.h"
 
 struct VP10_COMP;
 struct macroblock;
diff --git a/vp10/encoder/aq_cyclicrefresh.c b/av1/encoder/aq_cyclicrefresh.c
similarity index 98%
rename from vp10/encoder/aq_cyclicrefresh.c
rename to av1/encoder/aq_cyclicrefresh.c
index 362a71f..b7897f9 100644
--- a/vp10/encoder/aq_cyclicrefresh.c
+++ b/av1/encoder/aq_cyclicrefresh.c
@@ -11,12 +11,12 @@
 #include <limits.h>
 #include <math.h>
 
-#include "vp10/common/seg_common.h"
-#include "vp10/encoder/aq_cyclicrefresh.h"
-#include "vp10/encoder/ratectrl.h"
-#include "vp10/encoder/segmentation.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/system_state.h"
+#include "av1/common/seg_common.h"
+#include "av1/encoder/aq_cyclicrefresh.h"
+#include "av1/encoder/ratectrl.h"
+#include "av1/encoder/segmentation.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/system_state.h"
 
 struct CYCLIC_REFRESH {
   // Percentage of blocks per frame that are targeted as candidates
diff --git a/vp10/encoder/aq_cyclicrefresh.h b/av1/encoder/aq_cyclicrefresh.h
similarity index 98%
rename from vp10/encoder/aq_cyclicrefresh.h
rename to av1/encoder/aq_cyclicrefresh.h
index 649d714..24491fc 100644
--- a/vp10/encoder/aq_cyclicrefresh.h
+++ b/av1/encoder/aq_cyclicrefresh.h
@@ -11,7 +11,7 @@
 #ifndef VP10_ENCODER_AQ_CYCLICREFRESH_H_
 #define VP10_ENCODER_AQ_CYCLICREFRESH_H_
 
-#include "vp10/common/blockd.h"
+#include "av1/common/blockd.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/aq_variance.c b/av1/encoder/aq_variance.c
similarity index 96%
rename from vp10/encoder/aq_variance.c
rename to av1/encoder/aq_variance.c
index 026da70..2a529a1 100644
--- a/vp10/encoder/aq_variance.c
+++ b/av1/encoder/aq_variance.c
@@ -10,15 +10,15 @@
 
 #include <math.h>
 
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
-#include "vp10/encoder/aq_variance.h"
+#include "av1/encoder/aq_variance.h"
 
-#include "vp10/common/seg_common.h"
-#include "vp10/encoder/ratectrl.h"
-#include "vp10/encoder/rd.h"
-#include "vp10/encoder/segmentation.h"
-#include "vpx_ports/system_state.h"
+#include "av1/common/seg_common.h"
+#include "av1/encoder/ratectrl.h"
+#include "av1/encoder/rd.h"
+#include "av1/encoder/segmentation.h"
+#include "aom_ports/system_state.h"
 
 #define ENERGY_MIN (-4)
 #define ENERGY_MAX (1)
diff --git a/vp10/encoder/aq_variance.h b/av1/encoder/aq_variance.h
similarity index 95%
rename from vp10/encoder/aq_variance.h
rename to av1/encoder/aq_variance.h
index cfb5b86..a30a449 100644
--- a/vp10/encoder/aq_variance.h
+++ b/av1/encoder/aq_variance.h
@@ -11,7 +11,7 @@
 #ifndef VP10_ENCODER_AQ_VARIANCE_H_
 #define VP10_ENCODER_AQ_VARIANCE_H_
 
-#include "vp10/encoder/encoder.h"
+#include "av1/encoder/encoder.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/arm/neon/dct_neon.c b/av1/encoder/arm/neon/dct_neon.c
similarity index 94%
rename from vp10/encoder/arm/neon/dct_neon.c
rename to av1/encoder/arm/neon/dct_neon.c
index 8d066b3..1d77bec 100644
--- a/vp10/encoder/arm/neon/dct_neon.c
+++ b/av1/encoder/arm/neon/dct_neon.c
@@ -14,8 +14,8 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vp10/common/blockd.h"
-#include "vpx_dsp/txfm_common.h"
+#include "av1/common/blockd.h"
+#include "aom_dsp/txfm_common.h"
 
 void vp10_fdct8x8_quant_neon(
     const int16_t *input, int stride, int16_t *coeff_ptr, intptr_t n_coeffs,
diff --git a/vp10/encoder/arm/neon/error_neon.c b/av1/encoder/arm/neon/error_neon.c
similarity index 100%
rename from vp10/encoder/arm/neon/error_neon.c
rename to av1/encoder/arm/neon/error_neon.c
diff --git a/vp10/encoder/arm/neon/quantize_neon.c b/av1/encoder/arm/neon/quantize_neon.c
similarity index 95%
rename from vp10/encoder/arm/neon/quantize_neon.c
rename to av1/encoder/arm/neon/quantize_neon.c
index 7b8e447..db85b4d 100644
--- a/vp10/encoder/arm/neon/quantize_neon.c
+++ b/av1/encoder/arm/neon/quantize_neon.c
@@ -12,14 +12,14 @@
 
 #include <math.h>
 
-#include "vpx_mem/vpx_mem.h"
+#include "aom_mem/vpx_mem.h"
 
-#include "vp10/common/quant_common.h"
-#include "vp10/common/seg_common.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/seg_common.h"
 
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/quantize.h"
-#include "vp10/encoder/rd.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/quantize.h"
+#include "av1/encoder/rd.h"
 
 void vp10_quantize_fp_neon(const int16_t *coeff_ptr, intptr_t count,
                            int skip_block, const int16_t *zbin_ptr,
diff --git a/vp10/encoder/bitstream.c b/av1/encoder/bitstream.c
similarity index 99%
rename from vp10/encoder/bitstream.c
rename to av1/encoder/bitstream.c
index 1a9e760..30699b4 100644
--- a/vp10/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -12,39 +12,39 @@
 #include <limits.h>
 #include <stdio.h>
 
-#include "vpx/vpx_encoder.h"
-#include "vpx_dsp/bitwriter_buffer.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem_ops.h"
-#include "vpx_ports/system_state.h"
-#include "vpx_util/debug_util.h"
+#include "aom/vpx_encoder.h"
+#include "aom_dsp/bitwriter_buffer.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem_ops.h"
+#include "aom_ports/system_state.h"
+#include "aom_util/debug_util.h"
 
 #if CONFIG_CLPF
-#include "vp10/common/clpf.h"
+#include "av1/common/clpf.h"
 #endif
 #if CONFIG_DERING
-#include "vp10/common/dering.h"
+#include "av1/common/dering.h"
 #endif  // CONFIG_DERING
-#include "vp10/common/entropy.h"
-#include "vp10/common/entropymode.h"
-#include "vp10/common/entropymv.h"
-#include "vp10/common/mvref_common.h"
-#include "vp10/common/pred_common.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/seg_common.h"
-#include "vp10/common/tile_common.h"
+#include "av1/common/entropy.h"
+#include "av1/common/entropymode.h"
+#include "av1/common/entropymv.h"
+#include "av1/common/mvref_common.h"
+#include "av1/common/pred_common.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/seg_common.h"
+#include "av1/common/tile_common.h"
 
 #if CONFIG_ANS
-#include "vp10/encoder/buf_ans.h"
+#include "av1/encoder/buf_ans.h"
 #endif  // CONFIG_ANS
-#include "vp10/encoder/bitstream.h"
-#include "vp10/encoder/cost.h"
-#include "vp10/encoder/encodemv.h"
-#include "vp10/encoder/mcomp.h"
-#include "vp10/encoder/segmentation.h"
-#include "vp10/encoder/subexp.h"
-#include "vp10/encoder/tokenize.h"
+#include "av1/encoder/bitstream.h"
+#include "av1/encoder/cost.h"
+#include "av1/encoder/encodemv.h"
+#include "av1/encoder/mcomp.h"
+#include "av1/encoder/segmentation.h"
+#include "av1/encoder/subexp.h"
+#include "av1/encoder/tokenize.h"
 
 static const struct vp10_token intra_mode_encodings[INTRA_MODES] = {
   { 0, 1 },  { 6, 3 },   { 28, 5 },  { 30, 5 }, { 58, 6 },
diff --git a/vp10/encoder/bitstream.h b/av1/encoder/bitstream.h
similarity index 96%
rename from vp10/encoder/bitstream.h
rename to av1/encoder/bitstream.h
index d6e8895..01d2c8d 100644
--- a/vp10/encoder/bitstream.h
+++ b/av1/encoder/bitstream.h
@@ -15,7 +15,7 @@
 extern "C" {
 #endif
 
-#include "vp10/encoder/encoder.h"
+#include "av1/encoder/encoder.h"
 
 void vp10_pack_bitstream(VP10_COMP *const cpi, uint8_t *dest, size_t *size);
 
diff --git a/vp10/encoder/bitwriter.h b/av1/encoder/bitwriter.h
similarity index 91%
rename from vp10/encoder/bitwriter.h
rename to av1/encoder/bitwriter.h
index f53a132..8cc674b 100644
--- a/vp10/encoder/bitwriter.h
+++ b/av1/encoder/bitwriter.h
@@ -15,17 +15,17 @@
 #define VPX10_ENCODER_BITWRITER_H_
 
 #include "./vpx_config.h"
-#include "vpx_dsp/prob.h"
+#include "aom_dsp/prob.h"
 
 #if CONFIG_ANS
 typedef struct BufAnsCoder BufAnsCoder;
-#include "vp10/encoder/buf_ans.h"
+#include "av1/encoder/buf_ans.h"
 #define vp10_writer BufAnsCoder
 #define vp10_write buf_uabs_write
 #define vp10_write_bit buf_uabs_write_bit
 #define vp10_write_literal buf_uabs_write_literal
 #else
-#include "vpx_dsp/bitwriter.h"
+#include "aom_dsp/bitwriter.h"
 #define vp10_writer vpx_writer
 #define vp10_write vpx_write
 #define vp10_write_bit vpx_write_bit
diff --git a/vp10/encoder/block.h b/av1/encoder/block.h
similarity index 97%
rename from vp10/encoder/block.h
rename to av1/encoder/block.h
index 227fe9e..65bb1e2 100644
--- a/vp10/encoder/block.h
+++ b/av1/encoder/block.h
@@ -11,10 +11,10 @@
 #ifndef VP10_ENCODER_BLOCK_H_
 #define VP10_ENCODER_BLOCK_H_
 
-#include "vp10/common/entropymv.h"
-#include "vp10/common/entropy.h"
+#include "av1/common/entropymv.h"
+#include "av1/common/entropy.h"
 #if CONFIG_REF_MV
-#include "vp10/common/mvref_common.h"
+#include "av1/common/mvref_common.h"
 #endif
 
 #ifdef __cplusplus
diff --git a/vp10/encoder/blockiness.c b/av1/encoder/blockiness.c
similarity index 94%
rename from vp10/encoder/blockiness.c
rename to av1/encoder/blockiness.c
index c57e4ef..97e201a 100644
--- a/vp10/encoder/blockiness.c
+++ b/av1/encoder/blockiness.c
@@ -11,13 +11,13 @@
 #include "./vp10_rtcd.h"
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vp10/common/common.h"
-#include "vp10/common/filter.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/vpx_convolve.h"
-#include "vpx_dsp/vpx_filter.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/system_state.h"
+#include "av1/common/common.h"
+#include "av1/common/filter.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/vpx_convolve.h"
+#include "aom_dsp/vpx_filter.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/system_state.h"
 
 static int horizontal_filter(const uint8_t *s) {
   return (s[1] - s[-2]) * 2 + (s[-1] - s[0]) * 6;
diff --git a/vp10/encoder/buf_ans.c b/av1/encoder/buf_ans.c
similarity index 89%
rename from vp10/encoder/buf_ans.c
rename to av1/encoder/buf_ans.c
index 31cd227..f87c1e1 100644
--- a/vp10/encoder/buf_ans.c
+++ b/av1/encoder/buf_ans.c
@@ -10,10 +10,10 @@
 
 #include <string.h>
 
-#include "vp10/common/common.h"
-#include "vp10/encoder/buf_ans.h"
-#include "vp10/encoder/encoder.h"
-#include "vpx_mem/vpx_mem.h"
+#include "av1/common/common.h"
+#include "av1/encoder/buf_ans.h"
+#include "av1/encoder/encoder.h"
+#include "aom_mem/vpx_mem.h"
 
 void vp10_buf_ans_alloc(struct BufAnsCoder *c, struct VP10Common *cm,
                         int size_hint) {
diff --git a/vp10/encoder/buf_ans.h b/av1/encoder/buf_ans.h
similarity index 97%
rename from vp10/encoder/buf_ans.h
rename to av1/encoder/buf_ans.h
index 0217777..8a88c32 100644
--- a/vp10/encoder/buf_ans.h
+++ b/av1/encoder/buf_ans.h
@@ -16,8 +16,8 @@
 
 #include <assert.h>
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
-#include "vp10/common/ans.h"
+#include "aom/vpx_integer.h"
+#include "av1/common/ans.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/context_tree.c b/av1/encoder/context_tree.c
similarity index 98%
rename from vp10/encoder/context_tree.c
rename to av1/encoder/context_tree.c
index 394aeab..9346e1c 100644
--- a/vp10/encoder/context_tree.c
+++ b/av1/encoder/context_tree.c
@@ -8,8 +8,8 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vp10/encoder/context_tree.h"
-#include "vp10/encoder/encoder.h"
+#include "av1/encoder/context_tree.h"
+#include "av1/encoder/encoder.h"
 
 static const BLOCK_SIZE square[MAX_SB_SIZE_LOG2 - 2] = {
   BLOCK_8X8,     BLOCK_16X16, BLOCK_32X32, BLOCK_64X64,
diff --git a/vp10/encoder/context_tree.h b/av1/encoder/context_tree.h
similarity index 97%
rename from vp10/encoder/context_tree.h
rename to av1/encoder/context_tree.h
index 8721008..18f00bb 100644
--- a/vp10/encoder/context_tree.h
+++ b/av1/encoder/context_tree.h
@@ -11,8 +11,8 @@
 #ifndef VP10_ENCODER_CONTEXT_TREE_H_
 #define VP10_ENCODER_CONTEXT_TREE_H_
 
-#include "vp10/common/blockd.h"
-#include "vp10/encoder/block.h"
+#include "av1/common/blockd.h"
+#include "av1/encoder/block.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/corner_detect.c b/av1/encoder/corner_detect.c
similarity index 100%
rename from vp10/encoder/corner_detect.c
rename to av1/encoder/corner_detect.c
diff --git a/vp10/encoder/corner_detect.h b/av1/encoder/corner_detect.h
similarity index 100%
rename from vp10/encoder/corner_detect.h
rename to av1/encoder/corner_detect.h
diff --git a/vp10/encoder/corner_match.c b/av1/encoder/corner_match.c
similarity index 100%
rename from vp10/encoder/corner_match.c
rename to av1/encoder/corner_match.c
diff --git a/vp10/encoder/corner_match.h b/av1/encoder/corner_match.h
similarity index 100%
rename from vp10/encoder/corner_match.h
rename to av1/encoder/corner_match.h
diff --git a/vp10/encoder/cost.c b/av1/encoder/cost.c
similarity index 98%
rename from vp10/encoder/cost.c
rename to av1/encoder/cost.c
index c09e95c..4542638 100644
--- a/vp10/encoder/cost.c
+++ b/av1/encoder/cost.c
@@ -9,11 +9,11 @@
  */
 #include <assert.h>
 
-#include "vp10/encoder/cost.h"
+#include "av1/encoder/cost.h"
 #if CONFIG_ANS
-#include "vp10/common/ans.h"
+#include "av1/common/ans.h"
 #endif  // CONFIG_ANS
-#include "vp10/common/entropy.h"
+#include "av1/common/entropy.h"
 
 /* round(-log2(i/256.) * (1 << VP10_PROB_COST_SHIFT))
    Begins with a bogus entry for simpler addressing. */
diff --git a/vp10/encoder/cost.h b/av1/encoder/cost.h
similarity index 95%
rename from vp10/encoder/cost.h
rename to av1/encoder/cost.h
index fb71320..5ae2a79 100644
--- a/vp10/encoder/cost.h
+++ b/av1/encoder/cost.h
@@ -11,10 +11,10 @@
 #ifndef VP10_ENCODER_COST_H_
 #define VP10_ENCODER_COST_H_
 
-#include "vpx_dsp/prob.h"
-#include "vpx/vpx_integer.h"
+#include "aom_dsp/prob.h"
+#include "aom/vpx_integer.h"
 #if CONFIG_ANS
-#include "vp10/common/ans.h"
+#include "av1/common/ans.h"
 #endif  // CONFIG_ANS
 
 #ifdef __cplusplus
diff --git a/vp10/encoder/dct.c b/av1/encoder/dct.c
similarity index 99%
rename from vp10/encoder/dct.c
rename to av1/encoder/dct.c
index fa9c7c0..8f7812e 100644
--- a/vp10/encoder/dct.c
+++ b/av1/encoder/dct.c
@@ -14,10 +14,10 @@
 #include "./vp10_rtcd.h"
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vp10/common/blockd.h"
-#include "vp10/common/idct.h"
-#include "vpx_dsp/fwd_txfm.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/blockd.h"
+#include "av1/common/idct.h"
+#include "aom_dsp/fwd_txfm.h"
+#include "aom_ports/mem.h"
 
 static INLINE void range_check(const tran_low_t *input, const int size,
                                const int bit) {
diff --git a/vp10/encoder/encodeframe.c b/av1/encoder/encodeframe.c
similarity index 99%
rename from vp10/encoder/encodeframe.c
rename to av1/encoder/encodeframe.c
index e458959..b2635b4 100644
--- a/vp10/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -16,41 +16,41 @@
 #include "./vpx_dsp_rtcd.h"
 #include "./vpx_config.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/vpx_timer.h"
-#include "vpx_ports/system_state.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/vpx_timer.h"
+#include "aom_ports/system_state.h"
 
-#include "vp10/common/common.h"
-#include "vp10/common/entropy.h"
-#include "vp10/common/entropymode.h"
-#include "vp10/common/idct.h"
-#include "vp10/common/mvref_common.h"
-#include "vp10/common/pred_common.h"
-#include "vp10/common/quant_common.h"
-#include "vp10/common/reconintra.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/seg_common.h"
-#include "vp10/common/tile_common.h"
+#include "av1/common/common.h"
+#include "av1/common/entropy.h"
+#include "av1/common/entropymode.h"
+#include "av1/common/idct.h"
+#include "av1/common/mvref_common.h"
+#include "av1/common/pred_common.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/reconintra.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/seg_common.h"
+#include "av1/common/tile_common.h"
 
-#include "vp10/encoder/aq_complexity.h"
-#include "vp10/encoder/aq_cyclicrefresh.h"
-#include "vp10/encoder/aq_variance.h"
+#include "av1/encoder/aq_complexity.h"
+#include "av1/encoder/aq_cyclicrefresh.h"
+#include "av1/encoder/aq_variance.h"
 #if CONFIG_SUPERTX
-#include "vp10/encoder/cost.h"
+#include "av1/encoder/cost.h"
 #endif
 #if CONFIG_GLOBAL_MOTION
-#include "vp10/encoder/global_motion.h"
+#include "av1/encoder/global_motion.h"
 #endif
-#include "vp10/encoder/encodeframe.h"
-#include "vp10/encoder/encodemb.h"
-#include "vp10/encoder/encodemv.h"
-#include "vp10/encoder/ethread.h"
-#include "vp10/encoder/extend.h"
-#include "vp10/encoder/rd.h"
-#include "vp10/encoder/rdopt.h"
-#include "vp10/encoder/segmentation.h"
-#include "vp10/encoder/tokenize.h"
+#include "av1/encoder/encodeframe.h"
+#include "av1/encoder/encodemb.h"
+#include "av1/encoder/encodemv.h"
+#include "av1/encoder/ethread.h"
+#include "av1/encoder/extend.h"
+#include "av1/encoder/rd.h"
+#include "av1/encoder/rdopt.h"
+#include "av1/encoder/segmentation.h"
+#include "av1/encoder/tokenize.h"
 
 #if CONFIG_VP9_HIGHBITDEPTH
 #define IF_HBD(...) __VA_ARGS__
diff --git a/vp10/encoder/encodeframe.h b/av1/encoder/encodeframe.h
similarity index 97%
rename from vp10/encoder/encodeframe.h
rename to av1/encoder/encodeframe.h
index f24a572..338cb86 100644
--- a/vp10/encoder/encodeframe.h
+++ b/av1/encoder/encodeframe.h
@@ -11,7 +11,7 @@
 #ifndef VP10_ENCODER_ENCODEFRAME_H_
 #define VP10_ENCODER_ENCODEFRAME_H_
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/encodemb.c b/av1/encoder/encodemb.c
similarity index 98%
rename from vp10/encoder/encodemb.c
rename to av1/encoder/encodemb.c
index a6a4f5d..e72db2d 100644
--- a/vp10/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -12,20 +12,20 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vpx_dsp/quantize.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/quantize.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
-#include "vp10/common/idct.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/reconintra.h"
-#include "vp10/common/scan.h"
+#include "av1/common/idct.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/reconintra.h"
+#include "av1/common/scan.h"
 
-#include "vp10/encoder/encodemb.h"
-#include "vp10/encoder/hybrid_fwd_txfm.h"
-#include "vp10/encoder/quantize.h"
-#include "vp10/encoder/rd.h"
-#include "vp10/encoder/tokenize.h"
+#include "av1/encoder/encodemb.h"
+#include "av1/encoder/hybrid_fwd_txfm.h"
+#include "av1/encoder/quantize.h"
+#include "av1/encoder/rd.h"
+#include "av1/encoder/tokenize.h"
 
 void vp10_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
   struct macroblock_plane *const p = &x->plane[plane];
diff --git a/vp10/encoder/encodemb.c b/av1/encoder/encodemb.c.orig
similarity index 95%
copy from vp10/encoder/encodemb.c
copy to av1/encoder/encodemb.c.orig
index a6a4f5d..4c94032 100644
--- a/vp10/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c.orig
@@ -12,20 +12,20 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vpx_dsp/quantize.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/quantize.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
-#include "vp10/common/idct.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/reconintra.h"
-#include "vp10/common/scan.h"
+#include "av1/common/idct.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/reconintra.h"
+#include "av1/common/scan.h"
 
-#include "vp10/encoder/encodemb.h"
-#include "vp10/encoder/hybrid_fwd_txfm.h"
-#include "vp10/encoder/quantize.h"
-#include "vp10/encoder/rd.h"
-#include "vp10/encoder/tokenize.h"
+#include "av1/encoder/encodemb.h"
+#include "av1/encoder/hybrid_fwd_txfm.h"
+#include "av1/encoder/quantize.h"
+#include "av1/encoder/rd.h"
+#include "av1/encoder/tokenize.h"
 
 void vp10_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
   struct macroblock_plane *const p = &x->plane[plane];
@@ -88,12 +88,20 @@
       get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi));
   const int16_t *const scan = so->scan;
   const int16_t *const nb = so->neighbors;
+<<<<<<< HEAD
+  const int shift = get_tx_scale(xd, tx_type, tx_size);
+=======
 #if CONFIG_AOM_QM
   int seg_id = xd->mi[0]->mbmi.segment_id;
   int is_intra = !is_inter_block(&xd->mi[0]->mbmi);
   const qm_val_t *iqmatrix = pd->seg_iqmatrix[seg_id][is_intra][tx_size];
 #endif
-  const int shift = get_tx_scale(xd, tx_type, tx_size);
+#if CONFIG_AOM_QM
+  int seg_id = xd->mi[0]->mbmi.segment_id;
+  int is_intra = !is_inter_block(&xd->mi[0]->mbmi);
+  const qm_val_t *iqmatrix = pd->seg_iqmatrix[seg_id][is_intra][tx_size];
+#endif
+>>>>>>> 10d6f02... Port commits related to clpf and qm experiments
 #if CONFIG_NEW_QUANT
   int dq = get_dq_profile_from_ctx(ctx);
   const dequant_val_type_nuq *dequant_val = pd->dequant_val_nuq[dq];
@@ -208,13 +216,12 @@
                     (vp10_dequant_abscoeff_nuq(abs(x) - 1, dequant_ptr[rc != 0],
                                                dequant_val[band_translate[i]]) <
                      (abs(coeff[rc]) << shift)));
-#else  // CONFIG_NEW_QUANT
+#else   // CONFIG_NEW_QUANT
 #if CONFIG_AOM_QM
         if ((abs(x) * dequant_ptr[rc != 0] * iwt >
              ((abs(coeff[rc]) << shift) << AOM_QM_BITS)) &&
             (abs(x) * dequant_ptr[rc != 0] * iwt <
-             (((abs(coeff[rc]) << shift) + dequant_ptr[rc != 0])
-              << AOM_QM_BITS)))
+             (((abs(coeff[rc]) << shift) + dequant_ptr[rc != 0]) << AOM_QM_BITS)))
 #else
         if ((abs(x) * dequant_ptr[rc != 0] > (abs(coeff[rc]) << shift)) &&
             (abs(x) * dequant_ptr[rc != 0] <
@@ -479,14 +486,17 @@
     if (xform_quant_idx != VP10_XFORM_QUANT_SKIP_QUANT) {
       if (LIKELY(!x->skip_block)) {
         quant_func_list[xform_quant_idx][QUANT_FUNC_HIGHBD](
-            coeff, tx2d_size, p, qcoeff, pd, dqcoeff, eob, scan_order, &qparam
-#if CONFIG_AOM_QM
-            ,
-            qmatrix, iqmatrix
-#endif  // CONFIG_AOM_QM
-            );
+<<<<<<< HEAD
+            coeff, tx2d_size, p, qcoeff, pd, dqcoeff, eob, scan_order, &qparam);
       } else {
         vp10_quantize_skip(tx2d_size, qcoeff, dqcoeff, eob);
+=======
+            coeff, tx2d_size, p, qcoeff, pd, dqcoeff, eob, scan_order, &qparam
+#if CONFIG_AOM_QM
+            , qmatrix, iqmatrix
+#endif  // CONFIG_AOM_QM
+            );
+>>>>>>> 10d6f02... Port commits related to clpf and qm experiments
       }
     }
     return;
@@ -497,14 +507,17 @@
   if (xform_quant_idx != VP10_XFORM_QUANT_SKIP_QUANT) {
     if (LIKELY(!x->skip_block)) {
       quant_func_list[xform_quant_idx][QUANT_FUNC_LOWBD](
-          coeff, tx2d_size, p, qcoeff, pd, dqcoeff, eob, scan_order, &qparam
-#if CONFIG_AOM_QM
-          ,
-          qmatrix, iqmatrix
-#endif  // CONFIG_AOM_QM
-          );
+<<<<<<< HEAD
+          coeff, tx2d_size, p, qcoeff, pd, dqcoeff, eob, scan_order, &qparam);
     } else {
       vp10_quantize_skip(tx2d_size, qcoeff, dqcoeff, eob);
+=======
+          coeff, tx2d_size, p, qcoeff, pd, dqcoeff, eob, scan_order, &qparam
+#if CONFIG_AOM_QM
+            , qmatrix, iqmatrix
+#endif  // CONFIG_AOM_QM
+          );
+>>>>>>> 10d6f02... Port commits related to clpf and qm experiments
     }
   }
 }
@@ -863,7 +876,10 @@
   const struct macroblockd_plane *const pd = &xd->plane[plane];
   const int tx_row = blk_row >> (1 - pd->subsampling_y);
   const int tx_col = blk_col >> (1 - pd->subsampling_x);
-  TX_SIZE plane_tx_size;
+  const TX_SIZE plane_tx_size =
+      plane ? get_uv_tx_size_impl(mbmi->inter_tx_size[tx_row][tx_col], bsize, 0,
+                                  0)
+            : mbmi->inter_tx_size[tx_row][tx_col];
 
   int max_blocks_high = num_4x4_blocks_high_lookup[plane_bsize];
   int max_blocks_wide = num_4x4_blocks_wide_lookup[plane_bsize];
@@ -875,10 +891,6 @@
 
   if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;
 
-  plane_tx_size = plane ? get_uv_tx_size_impl(
-                              mbmi->inter_tx_size[tx_row][tx_col], bsize, 0, 0)
-                        : mbmi->inter_tx_size[tx_row][tx_col];
-
   if (tx_size == plane_tx_size) {
     encode_block(plane, block, blk_row, blk_col, plane_bsize, tx_size, arg);
   } else {
@@ -980,9 +992,6 @@
     int idx, idy;
     int block = 0;
     int step = num_4x4_blocks_txsize_lookup[max_tx_size];
-#if CONFIG_EXT_TX && CONFIG_RECT_TX
-    const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi, pd) : mbmi->tx_size;
-#endif
     vp10_get_entropy_contexts(bsize, TX_4X4, pd, ctx.ta[plane], ctx.tl[plane]);
 #else
     const struct macroblockd_plane *const pd = &xd->plane[plane];
@@ -994,22 +1003,13 @@
     arg.tl = ctx.tl[plane];
 
 #if CONFIG_VAR_TX
-#if CONFIG_EXT_TX && CONFIG_RECT_TX
-    if (tx_size >= TX_SIZES) {
-      vp10_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block,
-                                              &arg);
-    } else {
-#endif
-      for (idy = 0; idy < mi_height; idy += bh) {
-        for (idx = 0; idx < mi_width; idx += bh) {
-          encode_block_inter(plane, block, idy, idx, plane_bsize, max_tx_size,
-                             &arg);
-          block += step;
-        }
+    for (idy = 0; idy < mi_height; idy += bh) {
+      for (idx = 0; idx < mi_width; idx += bh) {
+        encode_block_inter(plane, block, idy, idx, plane_bsize, max_tx_size,
+                           &arg);
+        block += step;
       }
-#if CONFIG_EXT_TX && CONFIG_RECT_TX
     }
-#endif
 #else
     vp10_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block,
                                             &arg);
diff --git a/vp10/encoder/encodemb.h b/av1/encoder/encodemb.h
similarity index 98%
rename from vp10/encoder/encodemb.h
rename to av1/encoder/encodemb.h
index 974af80..4b88831 100644
--- a/vp10/encoder/encodemb.h
+++ b/av1/encoder/encodemb.h
@@ -12,7 +12,7 @@
 #define VP10_ENCODER_ENCODEMB_H_
 
 #include "./vpx_config.h"
-#include "vp10/encoder/block.h"
+#include "av1/encoder/block.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/encodemv.c b/av1/encoder/encodemv.c
similarity index 98%
rename from vp10/encoder/encodemv.c
rename to av1/encoder/encodemv.c
index 340cb46..78da2b7 100644
--- a/vp10/encoder/encodemv.c
+++ b/av1/encoder/encodemv.c
@@ -10,14 +10,14 @@
 
 #include <math.h>
 
-#include "vp10/common/common.h"
-#include "vp10/common/entropymode.h"
+#include "av1/common/common.h"
+#include "av1/common/entropymode.h"
 
-#include "vp10/encoder/cost.h"
-#include "vp10/encoder/encodemv.h"
-#include "vp10/encoder/subexp.h"
+#include "av1/encoder/cost.h"
+#include "av1/encoder/encodemv.h"
+#include "av1/encoder/subexp.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 static struct vp10_token mv_joint_encodings[MV_JOINTS];
 static struct vp10_token mv_class_encodings[MV_CLASSES];
diff --git a/vp10/encoder/encodemv.h b/av1/encoder/encodemv.h
similarity index 96%
rename from vp10/encoder/encodemv.h
rename to av1/encoder/encodemv.h
index 0e2e59b..6cb57c2 100644
--- a/vp10/encoder/encodemv.h
+++ b/av1/encoder/encodemv.h
@@ -11,7 +11,7 @@
 #ifndef VP10_ENCODER_ENCODEMV_H_
 #define VP10_ENCODER_ENCODEMV_H_
 
-#include "vp10/encoder/encoder.h"
+#include "av1/encoder/encoder.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/encoder.c b/av1/encoder/encoder.c
similarity index 99%
rename from vp10/encoder/encoder.c
rename to av1/encoder/encoder.c
index 178e6c8..5196d9c 100644
--- a/vp10/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -14,58 +14,58 @@
 
 #include "./vpx_config.h"
 
-#include "vp10/common/alloccommon.h"
+#include "av1/common/alloccommon.h"
 #if CONFIG_CLPF
-#include "vp10/common/clpf.h"
+#include "av1/common/clpf.h"
 #endif
 #if CONFIG_DERING
-#include "vp10/common/dering.h"
+#include "av1/common/dering.h"
 #endif  // CONFIG_DERING
-#include "vp10/common/filter.h"
-#include "vp10/common/idct.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/reconintra.h"
-#include "vp10/common/tile_common.h"
+#include "av1/common/filter.h"
+#include "av1/common/idct.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/reconintra.h"
+#include "av1/common/tile_common.h"
 
-#include "vp10/encoder/aq_complexity.h"
-#include "vp10/encoder/aq_cyclicrefresh.h"
-#include "vp10/encoder/aq_variance.h"
-#include "vp10/encoder/bitstream.h"
+#include "av1/encoder/aq_complexity.h"
+#include "av1/encoder/aq_cyclicrefresh.h"
+#include "av1/encoder/aq_variance.h"
+#include "av1/encoder/bitstream.h"
 #if CONFIG_ANS
-#include "vp10/encoder/buf_ans.h"
+#include "av1/encoder/buf_ans.h"
 #endif
-#include "vp10/encoder/context_tree.h"
-#include "vp10/encoder/encodeframe.h"
-#include "vp10/encoder/encodemv.h"
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/ethread.h"
-#include "vp10/encoder/firstpass.h"
-#include "vp10/encoder/mbgraph.h"
-#include "vp10/encoder/picklpf.h"
+#include "av1/encoder/context_tree.h"
+#include "av1/encoder/encodeframe.h"
+#include "av1/encoder/encodemv.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/ethread.h"
+#include "av1/encoder/firstpass.h"
+#include "av1/encoder/mbgraph.h"
+#include "av1/encoder/picklpf.h"
 #if CONFIG_LOOP_RESTORATION
-#include "vp10/encoder/pickrst.h"
+#include "av1/encoder/pickrst.h"
 #endif  // CONFIG_LOOP_RESTORATION
-#include "vp10/encoder/ratectrl.h"
-#include "vp10/encoder/rd.h"
-#include "vp10/encoder/resize.h"
-#include "vp10/encoder/segmentation.h"
-#include "vp10/encoder/speed_features.h"
-#include "vp10/encoder/temporal_filter.h"
+#include "av1/encoder/ratectrl.h"
+#include "av1/encoder/rd.h"
+#include "av1/encoder/resize.h"
+#include "av1/encoder/segmentation.h"
+#include "av1/encoder/speed_features.h"
+#include "av1/encoder/temporal_filter.h"
 
 #include "./vp10_rtcd.h"
 #include "./vpx_dsp_rtcd.h"
 #include "./vpx_scale_rtcd.h"
-#include "vpx_dsp/psnr.h"
+#include "aom_dsp/psnr.h"
 #if CONFIG_INTERNAL_STATS
-#include "vpx_dsp/ssim.h"
+#include "aom_dsp/ssim.h"
 #endif
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/vpx_filter.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/system_state.h"
-#include "vpx_ports/vpx_timer.h"
-#include "vpx_scale/vpx_scale.h"
-#include "vpx_util/debug_util.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_filter.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/system_state.h"
+#include "aom_ports/vpx_timer.h"
+#include "aom_scale/vpx_scale.h"
+#include "aom_util/debug_util.h"
 
 #define AM_SEGMENT_ID_INACTIVE 7
 #define AM_SEGMENT_ID_ACTIVE 0
diff --git a/vp10/encoder/encoder.h b/av1/encoder/encoder.h
similarity index 96%
rename from vp10/encoder/encoder.h
rename to av1/encoder/encoder.h
index b1b5855..719615b 100644
--- a/vp10/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -14,35 +14,35 @@
 #include <stdio.h>
 
 #include "./vpx_config.h"
-#include "vpx/vp8cx.h"
+#include "aom/vp8cx.h"
 
-#include "vp10/common/alloccommon.h"
-#include "vp10/common/entropymode.h"
-#include "vp10/common/thread_common.h"
-#include "vp10/common/onyxc_int.h"
-#include "vp10/encoder/aq_cyclicrefresh.h"
+#include "av1/common/alloccommon.h"
+#include "av1/common/entropymode.h"
+#include "av1/common/thread_common.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/encoder/aq_cyclicrefresh.h"
 #if CONFIG_ANS
-#include "vp10/encoder/buf_ans.h"
+#include "av1/encoder/buf_ans.h"
 #endif
-#include "vp10/encoder/context_tree.h"
-#include "vp10/encoder/encodemb.h"
-#include "vp10/encoder/firstpass.h"
-#include "vp10/encoder/lookahead.h"
-#include "vp10/encoder/mbgraph.h"
-#include "vp10/encoder/mcomp.h"
-#include "vp10/encoder/quantize.h"
-#include "vp10/encoder/ratectrl.h"
-#include "vp10/encoder/rd.h"
-#include "vp10/encoder/speed_features.h"
-#include "vp10/encoder/tokenize.h"
-#include "vp10/encoder/variance_tree.h"
+#include "av1/encoder/context_tree.h"
+#include "av1/encoder/encodemb.h"
+#include "av1/encoder/firstpass.h"
+#include "av1/encoder/lookahead.h"
+#include "av1/encoder/mbgraph.h"
+#include "av1/encoder/mcomp.h"
+#include "av1/encoder/quantize.h"
+#include "av1/encoder/ratectrl.h"
+#include "av1/encoder/rd.h"
+#include "av1/encoder/speed_features.h"
+#include "av1/encoder/tokenize.h"
+#include "av1/encoder/variance_tree.h"
 
 #if CONFIG_INTERNAL_STATS
-#include "vpx_dsp/ssim.h"
+#include "aom_dsp/ssim.h"
 #endif
-#include "vpx_dsp/variance.h"
-#include "vpx/internal/vpx_codec_internal.h"
-#include "vpx_util/vpx_thread.h"
+#include "aom_dsp/variance.h"
+#include "aom/internal/vpx_codec_internal.h"
+#include "aom_util/vpx_thread.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/ethread.c b/av1/encoder/ethread.c
similarity index 97%
rename from vp10/encoder/ethread.c
rename to av1/encoder/ethread.c
index 458dba4..63d716c 100644
--- a/vp10/encoder/ethread.c
+++ b/av1/encoder/ethread.c
@@ -8,10 +8,10 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vp10/encoder/encodeframe.h"
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/ethread.h"
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "av1/encoder/encodeframe.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/ethread.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 static void accumulate_rd_opt(ThreadData *td, ThreadData *td_t) {
   int i, j, k, l, m, n;
diff --git a/vp10/encoder/ethread.h b/av1/encoder/ethread.h
similarity index 100%
rename from vp10/encoder/ethread.h
rename to av1/encoder/ethread.h
diff --git a/vp10/encoder/extend.c b/av1/encoder/extend.c
similarity index 97%
rename from vp10/encoder/extend.c
rename to av1/encoder/extend.c
index e3d4be3..1b0c442 100644
--- a/vp10/encoder/extend.c
+++ b/av1/encoder/extend.c
@@ -8,12 +8,12 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
-#include "vp10/common/common.h"
-#include "vp10/encoder/extend.h"
+#include "av1/common/common.h"
+#include "av1/encoder/extend.h"
 
 static void copy_and_extend_plane(const uint8_t *src, int src_pitch,
                                   uint8_t *dst, int dst_pitch, int w, int h,
diff --git a/vp10/encoder/extend.h b/av1/encoder/extend.h
similarity index 93%
rename from vp10/encoder/extend.h
rename to av1/encoder/extend.h
index f7967fd..1ad763e 100644
--- a/vp10/encoder/extend.h
+++ b/av1/encoder/extend.h
@@ -11,8 +11,8 @@
 #ifndef VP10_ENCODER_EXTEND_H_
 #define VP10_ENCODER_EXTEND_H_
 
-#include "vpx_scale/yv12config.h"
-#include "vpx/vpx_integer.h"
+#include "aom_scale/yv12config.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/firstpass.c b/av1/encoder/firstpass.c
similarity index 98%
rename from vp10/encoder/firstpass.c
rename to av1/encoder/firstpass.c
index aac2b74..b23b839 100644
--- a/vp10/encoder/firstpass.c
+++ b/av1/encoder/firstpass.c
@@ -15,28 +15,28 @@
 #include "./vpx_dsp_rtcd.h"
 #include "./vpx_scale_rtcd.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/system_state.h"
-#include "vpx_scale/vpx_scale.h"
-#include "vpx_scale/yv12config.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/system_state.h"
+#include "aom_scale/vpx_scale.h"
+#include "aom_scale/yv12config.h"
 
-#include "vp10/common/entropymv.h"
-#include "vp10/common/quant_common.h"
-#include "vp10/common/reconinter.h"  // vp10_setup_dst_planes()
-#include "vp10/encoder/aq_variance.h"
-#include "vp10/encoder/block.h"
-#include "vp10/encoder/encodeframe.h"
-#include "vp10/encoder/encodemb.h"
-#include "vp10/encoder/encodemv.h"
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/extend.h"
-#include "vp10/encoder/firstpass.h"
-#include "vp10/encoder/mcomp.h"
-#include "vp10/encoder/quantize.h"
-#include "vp10/encoder/rd.h"
-#include "vpx_dsp/variance.h"
+#include "av1/common/entropymv.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/reconinter.h"  // vp10_setup_dst_planes()
+#include "av1/encoder/aq_variance.h"
+#include "av1/encoder/block.h"
+#include "av1/encoder/encodeframe.h"
+#include "av1/encoder/encodemb.h"
+#include "av1/encoder/encodemv.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/extend.h"
+#include "av1/encoder/firstpass.h"
+#include "av1/encoder/mcomp.h"
+#include "av1/encoder/quantize.h"
+#include "av1/encoder/rd.h"
+#include "aom_dsp/variance.h"
 
 #define OUTPUT_FPF 0
 #define ARF_STATS_OUTPUT 0
diff --git a/vp10/encoder/firstpass.h b/av1/encoder/firstpass.h
similarity index 98%
rename from vp10/encoder/firstpass.h
rename to av1/encoder/firstpass.h
index aacd095..5623540 100644
--- a/vp10/encoder/firstpass.h
+++ b/av1/encoder/firstpass.h
@@ -11,8 +11,8 @@
 #ifndef VP10_ENCODER_FIRSTPASS_H_
 #define VP10_ENCODER_FIRSTPASS_H_
 
-#include "vp10/encoder/lookahead.h"
-#include "vp10/encoder/ratectrl.h"
+#include "av1/encoder/lookahead.h"
+#include "av1/encoder/ratectrl.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/global_motion.c b/av1/encoder/global_motion.c
similarity index 92%
rename from vp10/encoder/global_motion.c
rename to av1/encoder/global_motion.c
index 6001624..cda6aaf 100644
--- a/vp10/encoder/global_motion.c
+++ b/av1/encoder/global_motion.c
@@ -14,13 +14,13 @@
 #include <math.h>
 #include <assert.h>
 
-#include "vp10/common/warped_motion.h"
+#include "av1/common/warped_motion.h"
 
-#include "vp10/encoder/segmentation.h"
-#include "vp10/encoder/global_motion.h"
-#include "vp10/encoder/corner_detect.h"
-#include "vp10/encoder/corner_match.h"
-#include "vp10/encoder/ransac.h"
+#include "av1/encoder/segmentation.h"
+#include "av1/encoder/global_motion.h"
+#include "av1/encoder/corner_detect.h"
+#include "av1/encoder/corner_match.h"
+#include "av1/encoder/ransac.h"
 
 #define MAX_CORNERS 4096
 #define MIN_INLIER_PROB 0.1
diff --git a/vp10/encoder/global_motion.h b/av1/encoder/global_motion.h
similarity index 96%
rename from vp10/encoder/global_motion.h
rename to av1/encoder/global_motion.h
index ac79930..ed088d6 100644
--- a/vp10/encoder/global_motion.h
+++ b/av1/encoder/global_motion.h
@@ -11,7 +11,7 @@
 #ifndef VP10_ENCODER_GLOBAL_MOTION_H_
 #define VP10_ENCODER_GLOBAL_MOTION_H_
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/hybrid_fwd_txfm.c b/av1/encoder/hybrid_fwd_txfm.c
similarity index 99%
rename from vp10/encoder/hybrid_fwd_txfm.c
rename to av1/encoder/hybrid_fwd_txfm.c
index 3c70a5a..ccfab0a 100644
--- a/vp10/encoder/hybrid_fwd_txfm.c
+++ b/av1/encoder/hybrid_fwd_txfm.c
@@ -12,8 +12,8 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vp10/common/idct.h"
-#include "vp10/encoder/hybrid_fwd_txfm.h"
+#include "av1/common/idct.h"
+#include "av1/encoder/hybrid_fwd_txfm.h"
 
 static INLINE void fdct32x32(int rd_transform, const int16_t *src,
                              tran_low_t *dst, int src_stride) {
diff --git a/vp10/encoder/hybrid_fwd_txfm.h b/av1/encoder/hybrid_fwd_txfm.h
similarity index 100%
rename from vp10/encoder/hybrid_fwd_txfm.h
rename to av1/encoder/hybrid_fwd_txfm.h
diff --git a/vp10/encoder/lookahead.c b/av1/encoder/lookahead.c
similarity index 97%
rename from vp10/encoder/lookahead.c
rename to av1/encoder/lookahead.c
index 6582277..3c4ff7d 100644
--- a/vp10/encoder/lookahead.c
+++ b/av1/encoder/lookahead.c
@@ -12,11 +12,11 @@
 
 #include "./vpx_config.h"
 
-#include "vp10/common/common.h"
+#include "av1/common/common.h"
 
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/extend.h"
-#include "vp10/encoder/lookahead.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/extend.h"
+#include "av1/encoder/lookahead.h"
 
 /* Return the buffer at the given absolute index and increment the index */
 static struct lookahead_entry *pop(struct lookahead_ctx *ctx, int *idx) {
diff --git a/vp10/encoder/lookahead.h b/av1/encoder/lookahead.h
similarity index 98%
rename from vp10/encoder/lookahead.h
rename to av1/encoder/lookahead.h
index c7a0844..4b26068 100644
--- a/vp10/encoder/lookahead.h
+++ b/av1/encoder/lookahead.h
@@ -11,8 +11,8 @@
 #ifndef VP10_ENCODER_LOOKAHEAD_H_
 #define VP10_ENCODER_LOOKAHEAD_H_
 
-#include "vpx_scale/yv12config.h"
-#include "vpx/vpx_integer.h"
+#include "aom_scale/yv12config.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/mbgraph.c b/av1/encoder/mbgraph.c
similarity index 97%
rename from vp10/encoder/mbgraph.c
rename to av1/encoder/mbgraph.c
index a4a2468..43f0f87 100644
--- a/vp10/encoder/mbgraph.c
+++ b/av1/encoder/mbgraph.c
@@ -13,14 +13,14 @@
 #include "./vp10_rtcd.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/system_state.h"
-#include "vp10/encoder/segmentation.h"
-#include "vp10/encoder/mcomp.h"
-#include "vp10/common/blockd.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/reconintra.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/system_state.h"
+#include "av1/encoder/segmentation.h"
+#include "av1/encoder/mcomp.h"
+#include "av1/common/blockd.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/reconintra.h"
 
 static unsigned int do_16x16_motion_iteration(VP10_COMP *cpi, const MV *ref_mv,
                                               int mb_row, int mb_col) {
diff --git a/vp10/encoder/mbgraph.h b/av1/encoder/mbgraph.h
similarity index 100%
rename from vp10/encoder/mbgraph.h
rename to av1/encoder/mbgraph.h
diff --git a/vp10/encoder/mcomp.c b/av1/encoder/mcomp.c
similarity index 99%
rename from vp10/encoder/mcomp.c
rename to av1/encoder/mcomp.c
index 587fec7..9ee06e9 100644
--- a/vp10/encoder/mcomp.c
+++ b/av1/encoder/mcomp.c
@@ -15,16 +15,16 @@
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
-#include "vp10/common/common.h"
-#include "vp10/common/reconinter.h"
+#include "av1/common/common.h"
+#include "av1/common/reconinter.h"
 
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/mcomp.h"
-#include "vp10/encoder/rdopt.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/mcomp.h"
+#include "av1/encoder/rdopt.h"
 
 // #define NEW_DIAMOND_SEARCH
 
diff --git a/vp10/encoder/mcomp.h b/av1/encoder/mcomp.h
similarity index 98%
rename from vp10/encoder/mcomp.h
rename to av1/encoder/mcomp.h
index 0af81f5..d26b9bd 100644
--- a/vp10/encoder/mcomp.h
+++ b/av1/encoder/mcomp.h
@@ -11,8 +11,8 @@
 #ifndef VP10_ENCODER_MCOMP_H_
 #define VP10_ENCODER_MCOMP_H_
 
-#include "vp10/encoder/block.h"
-#include "vpx_dsp/variance.h"
+#include "av1/encoder/block.h"
+#include "aom_dsp/variance.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/mips/msa/error_msa.c b/av1/encoder/mips/msa/error_msa.c
similarity index 99%
rename from vp10/encoder/mips/msa/error_msa.c
rename to av1/encoder/mips/msa/error_msa.c
index 9a098ea..71c5ad3 100644
--- a/vp10/encoder/mips/msa/error_msa.c
+++ b/av1/encoder/mips/msa/error_msa.c
@@ -9,7 +9,7 @@
  */
 
 #include "./vp10_rtcd.h"
-#include "vpx_dsp/mips/macros_msa.h"
+#include "aom_dsp/mips/macros_msa.h"
 
 #define BLOCK_ERROR_BLOCKSIZE_MSA(BSize)                                     \
   static int64_t block_error_##BSize##size_msa(                              \
diff --git a/vp10/encoder/mips/msa/fdct16x16_msa.c b/av1/encoder/mips/msa/fdct16x16_msa.c
similarity index 99%
rename from vp10/encoder/mips/msa/fdct16x16_msa.c
rename to av1/encoder/mips/msa/fdct16x16_msa.c
index c39a292..cda2138 100644
--- a/vp10/encoder/mips/msa/fdct16x16_msa.c
+++ b/av1/encoder/mips/msa/fdct16x16_msa.c
@@ -10,9 +10,9 @@
 
 #include <assert.h>
 
-#include "vp10/common/enums.h"
-#include "vp10/encoder/mips/msa/fdct_msa.h"
-#include "vpx_dsp/mips/fwd_txfm_msa.h"
+#include "av1/common/enums.h"
+#include "av1/encoder/mips/msa/fdct_msa.h"
+#include "aom_dsp/mips/fwd_txfm_msa.h"
 
 static void fadst16_cols_step1_msa(const int16_t *input, int32_t stride,
                                    const int32_t *const0, int16_t *int_buf) {
diff --git a/vp10/encoder/mips/msa/fdct4x4_msa.c b/av1/encoder/mips/msa/fdct4x4_msa.c
similarity index 97%
rename from vp10/encoder/mips/msa/fdct4x4_msa.c
rename to av1/encoder/mips/msa/fdct4x4_msa.c
index def9b45..a3731c3 100644
--- a/vp10/encoder/mips/msa/fdct4x4_msa.c
+++ b/av1/encoder/mips/msa/fdct4x4_msa.c
@@ -10,8 +10,8 @@
 
 #include <assert.h>
 
-#include "vp10/common/enums.h"
-#include "vp10/encoder/mips/msa/fdct_msa.h"
+#include "av1/common/enums.h"
+#include "av1/encoder/mips/msa/fdct_msa.h"
 
 void vp10_fwht4x4_msa(const int16_t *input, int16_t *output,
                       int32_t src_stride) {
diff --git a/vp10/encoder/mips/msa/fdct8x8_msa.c b/av1/encoder/mips/msa/fdct8x8_msa.c
similarity index 96%
rename from vp10/encoder/mips/msa/fdct8x8_msa.c
rename to av1/encoder/mips/msa/fdct8x8_msa.c
index 7843a62..3b6532a 100644
--- a/vp10/encoder/mips/msa/fdct8x8_msa.c
+++ b/av1/encoder/mips/msa/fdct8x8_msa.c
@@ -10,8 +10,8 @@
 
 #include <assert.h>
 
-#include "vp10/common/enums.h"
-#include "vp10/encoder/mips/msa/fdct_msa.h"
+#include "av1/common/enums.h"
+#include "av1/encoder/mips/msa/fdct_msa.h"
 
 void vp10_fht8x8_msa(const int16_t *input, int16_t *output, int32_t stride,
                      int32_t tx_type) {
diff --git a/vp10/encoder/mips/msa/fdct_msa.h b/av1/encoder/mips/msa/fdct_msa.h
similarity index 98%
rename from vp10/encoder/mips/msa/fdct_msa.h
rename to av1/encoder/mips/msa/fdct_msa.h
index 9a14625..07471d0 100644
--- a/vp10/encoder/mips/msa/fdct_msa.h
+++ b/av1/encoder/mips/msa/fdct_msa.h
@@ -11,9 +11,9 @@
 #ifndef VP10_ENCODER_MIPS_MSA_VP10_FDCT_MSA_H_
 #define VP10_ENCODER_MIPS_MSA_VP10_FDCT_MSA_H_
 
-#include "vpx_dsp/mips/fwd_txfm_msa.h"
-#include "vpx_dsp/mips/txfm_macros_msa.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/mips/fwd_txfm_msa.h"
+#include "aom_dsp/mips/txfm_macros_msa.h"
+#include "aom_ports/mem.h"
 
 #define VPX_ADST8(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, out2,  \
                   out3, out4, out5, out6, out7)                              \
diff --git a/vp10/encoder/mips/msa/temporal_filter_msa.c b/av1/encoder/mips/msa/temporal_filter_msa.c
similarity index 99%
rename from vp10/encoder/mips/msa/temporal_filter_msa.c
rename to av1/encoder/mips/msa/temporal_filter_msa.c
index 5feeab3..4d60d37 100644
--- a/vp10/encoder/mips/msa/temporal_filter_msa.c
+++ b/av1/encoder/mips/msa/temporal_filter_msa.c
@@ -9,7 +9,7 @@
  */
 
 #include "./vp10_rtcd.h"
-#include "vpx_dsp/mips/macros_msa.h"
+#include "aom_dsp/mips/macros_msa.h"
 
 static void temporal_filter_apply_8size_msa(uint8_t *frm1_ptr, uint32_t stride,
                                             uint8_t *frm2_ptr, int32_t filt_sth,
diff --git a/vp10/encoder/palette.c b/av1/encoder/palette.c
similarity index 99%
rename from vp10/encoder/palette.c
rename to av1/encoder/palette.c
index 371d1b9..74f91b7 100644
--- a/vp10/encoder/palette.c
+++ b/av1/encoder/palette.c
@@ -10,7 +10,7 @@
 
 #include <math.h>
 #include <stdlib.h>
-#include "vp10/encoder/palette.h"
+#include "av1/encoder/palette.h"
 
 static float calc_dist(const float *p1, const float *p2, int dim) {
   float dist = 0;
diff --git a/vp10/encoder/palette.h b/av1/encoder/palette.h
similarity index 97%
rename from vp10/encoder/palette.h
rename to av1/encoder/palette.h
index eb1a571..fbbb39c 100644
--- a/vp10/encoder/palette.h
+++ b/av1/encoder/palette.h
@@ -11,7 +11,7 @@
 #ifndef VP10_ENCODER_PALETTE_H_
 #define VP10_ENCODER_PALETTE_H_
 
-#include "vp10/common/blockd.h"
+#include "av1/common/blockd.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/pickdering.c b/av1/encoder/pickdering.c
similarity index 96%
rename from vp10/encoder/pickdering.c
rename to av1/encoder/pickdering.c
index 323567d..91e9b54 100644
--- a/vp10/encoder/pickdering.c
+++ b/av1/encoder/pickdering.c
@@ -11,11 +11,11 @@
 #include <string.h>
 
 #include "./vpx_scale_rtcd.h"
-#include "vp10/common/dering.h"
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/encoder/encoder.h"
-#include "vpx/vpx_integer.h"
+#include "av1/common/dering.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/reconinter.h"
+#include "av1/encoder/encoder.h"
+#include "aom/vpx_integer.h"
 
 static double compute_dist(int16_t *x, int xstride, int16_t *y, int ystride,
                            int nhb, int nvb, int coeff_shift) {
diff --git a/vp10/encoder/picklpf.c b/av1/encoder/picklpf.c
similarity index 95%
rename from vp10/encoder/picklpf.c
rename to av1/encoder/picklpf.c
index 9fd7713..c4e9b7d 100644
--- a/vp10/encoder/picklpf.c
+++ b/av1/encoder/picklpf.c
@@ -13,18 +13,18 @@
 
 #include "./vpx_scale_rtcd.h"
 
-#include "vpx_dsp/psnr.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/psnr.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
-#include "vp10/common/loopfilter.h"
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/quant_common.h"
+#include "av1/common/loopfilter.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/quant_common.h"
 
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/picklpf.h"
-#include "vp10/encoder/quantize.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/picklpf.h"
+#include "av1/encoder/quantize.h"
 
 int vp10_get_max_filter_level(const VP10_COMP *cpi) {
   if (cpi->oxcf.pass == 2) {
diff --git a/vp10/encoder/picklpf.h b/av1/encoder/picklpf.h
similarity index 96%
rename from vp10/encoder/picklpf.h
rename to av1/encoder/picklpf.h
index 994dde5..cd8afc6 100644
--- a/vp10/encoder/picklpf.h
+++ b/av1/encoder/picklpf.h
@@ -15,7 +15,7 @@
 extern "C" {
 #endif
 
-#include "vp10/encoder/encoder.h"
+#include "av1/encoder/encoder.h"
 
 struct yv12_buffer_config;
 struct VP10_COMP;
diff --git a/vp10/encoder/pickrst.c b/av1/encoder/pickrst.c
similarity index 98%
rename from vp10/encoder/pickrst.c
rename to av1/encoder/pickrst.c
index 242dbd3..b6ee6f0 100644
--- a/vp10/encoder/pickrst.c
+++ b/av1/encoder/pickrst.c
@@ -15,18 +15,18 @@
 
 #include "./vpx_scale_rtcd.h"
 
-#include "vpx_dsp/psnr.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/psnr.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/quant_common.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/quant_common.h"
 
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/picklpf.h"
-#include "vp10/encoder/pickrst.h"
-#include "vp10/encoder/quantize.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/picklpf.h"
+#include "av1/encoder/pickrst.h"
+#include "av1/encoder/quantize.h"
 
 static int64_t try_restoration_frame(const YV12_BUFFER_CONFIG *sd,
                                      VP10_COMP *const cpi, RestorationInfo *rsi,
diff --git a/vp10/encoder/pickrst.h b/av1/encoder/pickrst.h
similarity index 95%
rename from vp10/encoder/pickrst.h
rename to av1/encoder/pickrst.h
index 01e7cba..6d94cef 100644
--- a/vp10/encoder/pickrst.h
+++ b/av1/encoder/pickrst.h
@@ -15,7 +15,7 @@
 extern "C" {
 #endif
 
-#include "vp10/encoder/encoder.h"
+#include "av1/encoder/encoder.h"
 
 struct yv12_buffer_config;
 struct VP10_COMP;
diff --git a/vp10/encoder/quantize.c b/av1/encoder/quantize.c
similarity index 99%
rename from vp10/encoder/quantize.c
rename to av1/encoder/quantize.c
index 2324173..ed8a04b 100644
--- a/vp10/encoder/quantize.c
+++ b/av1/encoder/quantize.c
@@ -10,17 +10,17 @@
 
 #include <math.h>
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/quantize.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/quantize.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
-#include "vp10/common/quant_common.h"
-#include "vp10/common/scan.h"
-#include "vp10/common/seg_common.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/scan.h"
+#include "av1/common/seg_common.h"
 
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/quantize.h"
-#include "vp10/encoder/rd.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/quantize.h"
+#include "av1/encoder/rd.h"
 
 #if CONFIG_NEW_QUANT
 static INLINE int quantize_coeff_nuq(
diff --git a/vp10/encoder/quantize.h b/av1/encoder/quantize.h
similarity index 98%
rename from vp10/encoder/quantize.h
rename to av1/encoder/quantize.h
index c2035e3..6b1e739 100644
--- a/vp10/encoder/quantize.h
+++ b/av1/encoder/quantize.h
@@ -12,9 +12,9 @@
 #define VP10_ENCODER_QUANTIZE_H_
 
 #include "./vpx_config.h"
-#include "vp10/common/quant_common.h"
-#include "vp10/common/scan.h"
-#include "vp10/encoder/block.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/scan.h"
+#include "av1/encoder/block.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/ransac.c b/av1/encoder/ransac.c
similarity index 100%
rename from vp10/encoder/ransac.c
rename to av1/encoder/ransac.c
diff --git a/vp10/encoder/ransac.h b/av1/encoder/ransac.h
similarity index 100%
rename from vp10/encoder/ransac.h
rename to av1/encoder/ransac.h
diff --git a/vp10/encoder/ratectrl.c b/av1/encoder/ratectrl.c
similarity index 99%
rename from vp10/encoder/ratectrl.c
rename to av1/encoder/ratectrl.c
index 4e7dd64..ddd5762 100644
--- a/vp10/encoder/ratectrl.c
+++ b/av1/encoder/ratectrl.c
@@ -15,20 +15,20 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/system_state.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/system_state.h"
 
-#include "vp10/common/alloccommon.h"
-#include "vp10/encoder/aq_cyclicrefresh.h"
-#include "vp10/common/common.h"
-#include "vp10/common/entropymode.h"
-#include "vp10/common/quant_common.h"
-#include "vp10/common/seg_common.h"
+#include "av1/common/alloccommon.h"
+#include "av1/encoder/aq_cyclicrefresh.h"
+#include "av1/common/common.h"
+#include "av1/common/entropymode.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/seg_common.h"
 
-#include "vp10/encoder/encodemv.h"
-#include "vp10/encoder/ratectrl.h"
+#include "av1/encoder/encodemv.h"
+#include "av1/encoder/ratectrl.h"
 
 // Max rate target for 1080P and below encodes under normal circumstances
 // (1920 * 1080 / (16 * 16)) * MAX_MB_RATE bits per MB
diff --git a/vp10/encoder/ratectrl.h b/av1/encoder/ratectrl.h
similarity index 98%
rename from vp10/encoder/ratectrl.h
rename to av1/encoder/ratectrl.h
index 1896583..88a14bc 100644
--- a/vp10/encoder/ratectrl.h
+++ b/av1/encoder/ratectrl.h
@@ -11,10 +11,10 @@
 #ifndef VP10_ENCODER_RATECTRL_H_
 #define VP10_ENCODER_RATECTRL_H_
 
-#include "vpx/vpx_codec.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_codec.h"
+#include "aom/vpx_integer.h"
 
-#include "vp10/common/blockd.h"
+#include "av1/common/blockd.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/rd.c b/av1/encoder/rd.c
similarity index 97%
rename from vp10/encoder/rd.c
rename to av1/encoder/rd.c
index 77c939f..a8a8691 100644
--- a/vp10/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -14,31 +14,31 @@
 
 #include "./vp10_rtcd.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/bitops.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/system_state.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/bitops.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/system_state.h"
 
-#include "vp10/common/common.h"
-#include "vp10/common/entropy.h"
-#include "vp10/common/entropymode.h"
-#include "vp10/common/mvref_common.h"
-#include "vp10/common/pred_common.h"
-#include "vp10/common/quant_common.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/reconintra.h"
-#include "vp10/common/seg_common.h"
+#include "av1/common/common.h"
+#include "av1/common/entropy.h"
+#include "av1/common/entropymode.h"
+#include "av1/common/mvref_common.h"
+#include "av1/common/pred_common.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/reconintra.h"
+#include "av1/common/seg_common.h"
 
-#include "vp10/encoder/cost.h"
-#include "vp10/encoder/encodemb.h"
-#include "vp10/encoder/encodemv.h"
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/mcomp.h"
-#include "vp10/encoder/quantize.h"
-#include "vp10/encoder/ratectrl.h"
-#include "vp10/encoder/rd.h"
-#include "vp10/encoder/tokenize.h"
+#include "av1/encoder/cost.h"
+#include "av1/encoder/encodemb.h"
+#include "av1/encoder/encodemv.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/mcomp.h"
+#include "av1/encoder/quantize.h"
+#include "av1/encoder/ratectrl.h"
+#include "av1/encoder/rd.h"
+#include "av1/encoder/tokenize.h"
 
 #define RD_THRESH_POW 1.25
 
diff --git a/vp10/encoder/rd.h b/av1/encoder/rd.h
similarity index 98%
rename from vp10/encoder/rd.h
rename to av1/encoder/rd.h
index 9765e63..9680215 100644
--- a/vp10/encoder/rd.h
+++ b/av1/encoder/rd.h
@@ -14,13 +14,13 @@
 #include <limits.h>
 
 #if CONFIG_ANS
-#include "vp10/common/ans.h"
+#include "av1/common/ans.h"
 #endif  // CONFIG_ANS
-#include "vp10/common/blockd.h"
+#include "av1/common/blockd.h"
 
-#include "vp10/encoder/block.h"
-#include "vp10/encoder/context_tree.h"
-#include "vp10/encoder/cost.h"
+#include "av1/encoder/block.h"
+#include "av1/encoder/context_tree.h"
+#include "av1/encoder/cost.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/rdopt.c b/av1/encoder/rdopt.c
similarity index 99%
rename from vp10/encoder/rdopt.c
rename to av1/encoder/rdopt.c
index ed1aba7..62334a3 100644
--- a/vp10/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -14,37 +14,37 @@
 #include "./vp10_rtcd.h"
 #include "./vpx_dsp_rtcd.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/blend.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/system_state.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/blend.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/system_state.h"
 
-#include "vp10/common/common.h"
-#include "vp10/common/common_data.h"
-#include "vp10/common/entropy.h"
-#include "vp10/common/entropymode.h"
-#include "vp10/common/idct.h"
-#include "vp10/common/mvref_common.h"
-#include "vp10/common/pred_common.h"
-#include "vp10/common/quant_common.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/reconintra.h"
-#include "vp10/common/scan.h"
-#include "vp10/common/seg_common.h"
+#include "av1/common/common.h"
+#include "av1/common/common_data.h"
+#include "av1/common/entropy.h"
+#include "av1/common/entropymode.h"
+#include "av1/common/idct.h"
+#include "av1/common/mvref_common.h"
+#include "av1/common/pred_common.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/reconintra.h"
+#include "av1/common/scan.h"
+#include "av1/common/seg_common.h"
 
-#include "vp10/encoder/cost.h"
-#include "vp10/encoder/encodemb.h"
-#include "vp10/encoder/encodemv.h"
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/hybrid_fwd_txfm.h"
-#include "vp10/encoder/mcomp.h"
-#include "vp10/encoder/palette.h"
-#include "vp10/encoder/quantize.h"
-#include "vp10/encoder/ratectrl.h"
-#include "vp10/encoder/rd.h"
-#include "vp10/encoder/rdopt.h"
-#include "vp10/encoder/aq_variance.h"
+#include "av1/encoder/cost.h"
+#include "av1/encoder/encodemb.h"
+#include "av1/encoder/encodemv.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/hybrid_fwd_txfm.h"
+#include "av1/encoder/mcomp.h"
+#include "av1/encoder/palette.h"
+#include "av1/encoder/quantize.h"
+#include "av1/encoder/ratectrl.h"
+#include "av1/encoder/rd.h"
+#include "av1/encoder/rdopt.h"
+#include "av1/encoder/aq_variance.h"
 
 #if CONFIG_DUAL_FILTER
 #if CONFIG_EXT_INTERP
diff --git a/vp10/encoder/rdopt.h b/av1/encoder/rdopt.h
similarity index 96%
rename from vp10/encoder/rdopt.h
rename to av1/encoder/rdopt.h
index 2ff9c24..4ce2879 100644
--- a/vp10/encoder/rdopt.h
+++ b/av1/encoder/rdopt.h
@@ -11,10 +11,10 @@
 #ifndef VP10_ENCODER_RDOPT_H_
 #define VP10_ENCODER_RDOPT_H_
 
-#include "vp10/common/blockd.h"
+#include "av1/common/blockd.h"
 
-#include "vp10/encoder/block.h"
-#include "vp10/encoder/context_tree.h"
+#include "av1/encoder/block.h"
+#include "av1/encoder/context_tree.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/resize.c b/av1/encoder/resize.c
similarity index 99%
rename from vp10/encoder/resize.c
rename to av1/encoder/resize.c
index e922e0a..e209b21 100644
--- a/vp10/encoder/resize.c
+++ b/av1/encoder/resize.c
@@ -16,11 +16,11 @@
 #include <string.h>
 
 #if CONFIG_VP9_HIGHBITDEPTH
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_dsp_common.h"
 #endif  // CONFIG_VP9_HIGHBITDEPTH
-#include "vpx_ports/mem.h"
-#include "vp10/common/common.h"
-#include "vp10/encoder/resize.h"
+#include "aom_ports/mem.h"
+#include "av1/common/common.h"
+#include "av1/encoder/resize.h"
 
 #define FILTER_BITS 7
 
diff --git a/vp10/encoder/resize.h b/av1/encoder/resize.h
similarity index 98%
rename from vp10/encoder/resize.h
rename to av1/encoder/resize.h
index cb3ee01..8fe1d1b 100644
--- a/vp10/encoder/resize.h
+++ b/av1/encoder/resize.h
@@ -12,7 +12,7 @@
 #define VP10_ENCODER_RESIZE_H_
 
 #include <stdio.h>
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/segmentation.c b/av1/encoder/segmentation.c
similarity index 98%
rename from vp10/encoder/segmentation.c
rename to av1/encoder/segmentation.c
index 7f889f5..5ac1283 100644
--- a/vp10/encoder/segmentation.c
+++ b/av1/encoder/segmentation.c
@@ -10,14 +10,14 @@
 
 #include <limits.h>
 
-#include "vpx_mem/vpx_mem.h"
+#include "aom_mem/vpx_mem.h"
 
-#include "vp10/common/pred_common.h"
-#include "vp10/common/tile_common.h"
+#include "av1/common/pred_common.h"
+#include "av1/common/tile_common.h"
 
-#include "vp10/encoder/cost.h"
-#include "vp10/encoder/segmentation.h"
-#include "vp10/encoder/subexp.h"
+#include "av1/encoder/cost.h"
+#include "av1/encoder/segmentation.h"
+#include "av1/encoder/subexp.h"
 
 void vp10_enable_segmentation(struct segmentation *seg) {
   seg->enabled = 1;
diff --git a/vp10/encoder/segmentation.h b/av1/encoder/segmentation.h
similarity index 95%
rename from vp10/encoder/segmentation.h
rename to av1/encoder/segmentation.h
index c07f37f..3c79bd1 100644
--- a/vp10/encoder/segmentation.h
+++ b/av1/encoder/segmentation.h
@@ -11,8 +11,8 @@
 #ifndef VP10_ENCODER_SEGMENTATION_H_
 #define VP10_ENCODER_SEGMENTATION_H_
 
-#include "vp10/common/blockd.h"
-#include "vp10/encoder/encoder.h"
+#include "av1/common/blockd.h"
+#include "av1/encoder/encoder.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/speed_features.c b/av1/encoder/speed_features.c
similarity index 99%
rename from vp10/encoder/speed_features.c
rename to av1/encoder/speed_features.c
index 074a1c3..ab66250 100644
--- a/vp10/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -10,11 +10,11 @@
 
 #include <limits.h>
 
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/speed_features.h"
-#include "vp10/encoder/rdopt.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/speed_features.h"
+#include "av1/encoder/rdopt.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 // Mesh search patters for various speed settings
 static MESH_PATTERN best_quality_mesh_pattern[MAX_MESH_STEP] = {
diff --git a/vp10/encoder/speed_features.h b/av1/encoder/speed_features.h
similarity index 99%
rename from vp10/encoder/speed_features.h
rename to av1/encoder/speed_features.h
index a0e5c63..2457c5b 100644
--- a/vp10/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -11,7 +11,7 @@
 #ifndef VP10_ENCODER_SPEED_FEATURES_H_
 #define VP10_ENCODER_SPEED_FEATURES_H_
 
-#include "vp10/common/enums.h"
+#include "av1/common/enums.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/subexp.c b/av1/encoder/subexp.c
similarity index 98%
rename from vp10/encoder/subexp.c
rename to av1/encoder/subexp.c
index 570b11e..d722654 100644
--- a/vp10/encoder/subexp.c
+++ b/av1/encoder/subexp.c
@@ -7,12 +7,12 @@
  *  in the file PATENTS.  All contributing project authors may
  *  be found in the AUTHORS file in the root of the source tree.
  */
-#include "vp10/encoder/bitwriter.h"
+#include "av1/encoder/bitwriter.h"
 
-#include "vp10/common/common.h"
-#include "vp10/common/entropy.h"
-#include "vp10/encoder/cost.h"
-#include "vp10/encoder/subexp.h"
+#include "av1/common/common.h"
+#include "av1/common/entropy.h"
+#include "av1/encoder/cost.h"
+#include "av1/encoder/subexp.h"
 
 #define vp10_cost_upd256 ((int)(vp10_cost_one(upd) - vp10_cost_zero(upd)))
 
diff --git a/vp10/encoder/subexp.h b/av1/encoder/subexp.h
similarity index 98%
rename from vp10/encoder/subexp.h
rename to av1/encoder/subexp.h
index 1648d74..82ce2e0 100644
--- a/vp10/encoder/subexp.h
+++ b/av1/encoder/subexp.h
@@ -15,7 +15,7 @@
 extern "C" {
 #endif
 
-#include "vpx_dsp/prob.h"
+#include "aom_dsp/prob.h"
 
 struct vp10_writer;
 
diff --git a/vp10/encoder/temporal_filter.c b/av1/encoder/temporal_filter.c
similarity index 97%
rename from vp10/encoder/temporal_filter.c
rename to av1/encoder/temporal_filter.c
index 263177c..32490cc 100644
--- a/vp10/encoder/temporal_filter.c
+++ b/av1/encoder/temporal_filter.c
@@ -11,24 +11,24 @@
 #include <math.h>
 #include <limits.h>
 
-#include "vp10/common/alloccommon.h"
-#include "vp10/common/onyxc_int.h"
-#include "vp10/common/quant_common.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/common/odintrin.h"
-#include "vp10/encoder/extend.h"
-#include "vp10/encoder/firstpass.h"
-#include "vp10/encoder/mcomp.h"
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/quantize.h"
-#include "vp10/encoder/ratectrl.h"
-#include "vp10/encoder/segmentation.h"
-#include "vp10/encoder/temporal_filter.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/vpx_timer.h"
-#include "vpx_scale/vpx_scale.h"
+#include "av1/common/alloccommon.h"
+#include "av1/common/onyxc_int.h"
+#include "av1/common/quant_common.h"
+#include "av1/common/reconinter.h"
+#include "av1/common/odintrin.h"
+#include "av1/encoder/extend.h"
+#include "av1/encoder/firstpass.h"
+#include "av1/encoder/mcomp.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/quantize.h"
+#include "av1/encoder/ratectrl.h"
+#include "av1/encoder/segmentation.h"
+#include "av1/encoder/temporal_filter.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/vpx_timer.h"
+#include "aom_scale/vpx_scale.h"
 
 static void temporal_filter_predictors_mb_c(
     MACROBLOCKD *xd, uint8_t *y_mb_ptr, uint8_t *u_mb_ptr, uint8_t *v_mb_ptr,
diff --git a/vp10/encoder/temporal_filter.h b/av1/encoder/temporal_filter.h
similarity index 100%
rename from vp10/encoder/temporal_filter.h
rename to av1/encoder/temporal_filter.h
diff --git a/vp10/encoder/tokenize.c b/av1/encoder/tokenize.c
similarity index 98%
rename from vp10/encoder/tokenize.c
rename to av1/encoder/tokenize.c
index 257eba5..c841fa6 100644
--- a/vp10/encoder/tokenize.c
+++ b/av1/encoder/tokenize.c
@@ -13,16 +13,16 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "vpx_mem/vpx_mem.h"
+#include "aom_mem/vpx_mem.h"
 
-#include "vp10/common/entropy.h"
-#include "vp10/common/pred_common.h"
-#include "vp10/common/scan.h"
-#include "vp10/common/seg_common.h"
+#include "av1/common/entropy.h"
+#include "av1/common/pred_common.h"
+#include "av1/common/scan.h"
+#include "av1/common/seg_common.h"
 
-#include "vp10/encoder/cost.h"
-#include "vp10/encoder/encoder.h"
-#include "vp10/encoder/tokenize.h"
+#include "av1/encoder/cost.h"
+#include "av1/encoder/encoder.h"
+#include "av1/encoder/tokenize.h"
 
 static const TOKENVALUE dct_cat_lt_10_value_tokens[] = {
   { 9, 63 }, { 9, 61 }, { 9, 59 }, { 9, 57 }, { 9, 55 }, { 9, 53 }, { 9, 51 },
diff --git a/vp10/encoder/tokenize.h b/av1/encoder/tokenize.h
similarity index 97%
rename from vp10/encoder/tokenize.h
rename to av1/encoder/tokenize.h
index 1623c9f..7ae8676 100644
--- a/vp10/encoder/tokenize.h
+++ b/av1/encoder/tokenize.h
@@ -11,10 +11,10 @@
 #ifndef VP10_ENCODER_TOKENIZE_H_
 #define VP10_ENCODER_TOKENIZE_H_
 
-#include "vp10/common/entropy.h"
+#include "av1/common/entropy.h"
 
-#include "vp10/encoder/block.h"
-#include "vp10/encoder/treewriter.h"
+#include "av1/encoder/block.h"
+#include "av1/encoder/treewriter.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/treewriter.c b/av1/encoder/treewriter.c
similarity index 97%
rename from vp10/encoder/treewriter.c
rename to av1/encoder/treewriter.c
index 152bf40..d3fcd45 100644
--- a/vp10/encoder/treewriter.c
+++ b/av1/encoder/treewriter.c
@@ -8,7 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vp10/encoder/treewriter.h"
+#include "av1/encoder/treewriter.h"
 
 static void tree2tok(struct vp10_token *tokens, const vpx_tree_index *tree,
                      int i, int v, int l) {
diff --git a/vp10/encoder/treewriter.h b/av1/encoder/treewriter.h
similarity index 96%
rename from vp10/encoder/treewriter.h
rename to av1/encoder/treewriter.h
index fdbaadd..43c615f 100644
--- a/vp10/encoder/treewriter.h
+++ b/av1/encoder/treewriter.h
@@ -12,11 +12,11 @@
 #define VP10_ENCODER_TREEWRITER_H_
 
 #ifdef VP10_FORCE_VPXBOOL_TREEWRITER
-#include "vpx_dsp/bitwriter.h"
+#include "aom_dsp/bitwriter.h"
 #define tree_writer vpx_writer
 #define tree_bit_write vpx_write
 #else
-#include "vp10/encoder/bitwriter.h"
+#include "av1/encoder/bitwriter.h"
 #define tree_writer vp10_writer
 #define tree_bit_write vp10_write
 #endif
diff --git a/vp10/encoder/variance_tree.c b/av1/encoder/variance_tree.c
similarity index 95%
rename from vp10/encoder/variance_tree.c
rename to av1/encoder/variance_tree.c
index 03d316d..219d39a 100644
--- a/vp10/encoder/variance_tree.c
+++ b/av1/encoder/variance_tree.c
@@ -8,8 +8,8 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vp10/encoder/variance_tree.h"
-#include "vp10/encoder/encoder.h"
+#include "av1/encoder/variance_tree.h"
+#include "av1/encoder/encoder.h"
 
 void vp10_setup_var_tree(struct VP10Common *cm, ThreadData *td) {
   int i, j;
diff --git a/vp10/encoder/variance_tree.h b/av1/encoder/variance_tree.h
similarity index 97%
rename from vp10/encoder/variance_tree.h
rename to av1/encoder/variance_tree.h
index 70d5cb8..08c40d3 100644
--- a/vp10/encoder/variance_tree.h
+++ b/av1/encoder/variance_tree.h
@@ -15,9 +15,9 @@
 
 #include "./vpx_config.h"
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
-#include "vp10/common/enums.h"
+#include "av1/common/enums.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vp10/encoder/wedge_utils.c b/av1/encoder/wedge_utils.c
similarity index 96%
rename from vp10/encoder/wedge_utils.c
rename to av1/encoder/wedge_utils.c
index cb3234c..548bc48 100644
--- a/vp10/encoder/wedge_utils.c
+++ b/av1/encoder/wedge_utils.c
@@ -10,13 +10,13 @@
 
 #include <assert.h>
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
-#include "vp10/common/reconinter.h"
+#include "av1/common/reconinter.h"
 
 #define MAX_MASK_VALUE (1 << WEDGE_WEIGHT_BITS)
 
diff --git a/vp10/encoder/x86/dct_intrin_sse2.c b/av1/encoder/x86/dct_intrin_sse2.c
similarity index 99%
rename from vp10/encoder/x86/dct_intrin_sse2.c
rename to av1/encoder/x86/dct_intrin_sse2.c
index 0e0ee44..6fe3ada 100644
--- a/vp10/encoder/x86/dct_intrin_sse2.c
+++ b/av1/encoder/x86/dct_intrin_sse2.c
@@ -13,10 +13,10 @@
 
 #include "./vp10_rtcd.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_dsp/x86/fwd_txfm_sse2.h"
-#include "vpx_dsp/x86/txfm_common_sse2.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/txfm_common.h"
+#include "aom_dsp/x86/fwd_txfm_sse2.h"
+#include "aom_dsp/x86/txfm_common_sse2.h"
+#include "aom_ports/mem.h"
 
 static INLINE void load_buffer_4x4(const int16_t *input, __m128i *in,
                                    int stride, int flipud, int fliplr) {
diff --git a/vp10/encoder/x86/dct_sse2.asm b/av1/encoder/x86/dct_sse2.asm
similarity index 100%
rename from vp10/encoder/x86/dct_sse2.asm
rename to av1/encoder/x86/dct_sse2.asm
diff --git a/vp10/encoder/x86/dct_ssse3.c b/av1/encoder/x86/dct_ssse3.c
similarity index 99%
rename from vp10/encoder/x86/dct_ssse3.c
rename to av1/encoder/x86/dct_ssse3.c
index 39cce1b..aa018a1 100644
--- a/vp10/encoder/x86/dct_ssse3.c
+++ b/av1/encoder/x86/dct_ssse3.c
@@ -17,8 +17,8 @@
 #include <tmmintrin.h>  // SSSE3
 
 #include "./vp10_rtcd.h"
-#include "vpx_dsp/x86/inv_txfm_sse2.h"
-#include "vpx_dsp/x86/txfm_common_sse2.h"
+#include "aom_dsp/x86/inv_txfm_sse2.h"
+#include "aom_dsp/x86/txfm_common_sse2.h"
 
 void vp10_fdct8x8_quant_ssse3(
     const int16_t *input, int stride, int16_t *coeff_ptr, intptr_t n_coeffs,
diff --git a/vp10/encoder/x86/error_intrin_avx2.c b/av1/encoder/x86/error_intrin_avx2.c
similarity index 98%
rename from vp10/encoder/x86/error_intrin_avx2.c
rename to av1/encoder/x86/error_intrin_avx2.c
index 560cd4a..6e7c093 100644
--- a/vp10/encoder/x86/error_intrin_avx2.c
+++ b/av1/encoder/x86/error_intrin_avx2.c
@@ -11,7 +11,7 @@
 #include <immintrin.h>  // AVX2
 
 #include "./vp10_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 int64_t vp10_block_error_avx2(const int16_t *coeff, const int16_t *dqcoeff,
                               intptr_t block_size, int64_t *ssz) {
diff --git a/vp10/encoder/x86/error_sse2.asm b/av1/encoder/x86/error_sse2.asm
similarity index 100%
rename from vp10/encoder/x86/error_sse2.asm
rename to av1/encoder/x86/error_sse2.asm
diff --git a/vp10/encoder/x86/highbd_block_error_intrin_sse2.c b/av1/encoder/x86/highbd_block_error_intrin_sse2.c
similarity index 98%
rename from vp10/encoder/x86/highbd_block_error_intrin_sse2.c
rename to av1/encoder/x86/highbd_block_error_intrin_sse2.c
index eefca1c..2728880 100644
--- a/vp10/encoder/x86/highbd_block_error_intrin_sse2.c
+++ b/av1/encoder/x86/highbd_block_error_intrin_sse2.c
@@ -11,7 +11,7 @@
 #include <emmintrin.h>
 #include <stdio.h>
 
-#include "vp10/common/common.h"
+#include "av1/common/common.h"
 
 int64_t vp10_highbd_block_error_sse2(tran_low_t *coeff, tran_low_t *dqcoeff,
                                      intptr_t block_size, int64_t *ssz,
diff --git a/vp10/encoder/x86/highbd_fwd_txfm_sse4.c b/av1/encoder/x86/highbd_fwd_txfm_sse4.c
similarity index 99%
rename from vp10/encoder/x86/highbd_fwd_txfm_sse4.c
rename to av1/encoder/x86/highbd_fwd_txfm_sse4.c
index e164375..a6cb454 100644
--- a/vp10/encoder/x86/highbd_fwd_txfm_sse4.c
+++ b/av1/encoder/x86/highbd_fwd_txfm_sse4.c
@@ -13,12 +13,12 @@
 
 #include "./vp10_rtcd.h"
 #include "./vpx_config.h"
-#include "vp10/common/vp10_fwd_txfm2d_cfg.h"
-#include "vp10/common/vp10_txfm.h"
-#include "vp10/common/x86/highbd_txfm_utility_sse4.h"
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_dsp/x86/txfm_common_sse2.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/vp10_fwd_txfm2d_cfg.h"
+#include "av1/common/vp10_txfm.h"
+#include "av1/common/x86/highbd_txfm_utility_sse4.h"
+#include "aom_dsp/txfm_common.h"
+#include "aom_dsp/x86/txfm_common_sse2.h"
+#include "aom_ports/mem.h"
 
 static INLINE void load_buffer_4x4(const int16_t *input, __m128i *in,
                                    int stride, int flipud, int fliplr,
diff --git a/vp10/encoder/x86/quantize_sse2.c b/av1/encoder/x86/quantize_sse2.c
similarity index 99%
rename from vp10/encoder/x86/quantize_sse2.c
rename to av1/encoder/x86/quantize_sse2.c
index b619894..b8cd0c7 100644
--- a/vp10/encoder/x86/quantize_sse2.c
+++ b/av1/encoder/x86/quantize_sse2.c
@@ -12,7 +12,7 @@
 #include <xmmintrin.h>
 
 #include "./vp10_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 void vp10_quantize_fp_sse2(const int16_t *coeff_ptr, intptr_t n_coeffs,
                            int skip_block, const int16_t *zbin_ptr,
diff --git a/vp10/encoder/x86/quantize_ssse3_x86_64.asm b/av1/encoder/x86/quantize_ssse3_x86_64.asm
similarity index 100%
rename from vp10/encoder/x86/quantize_ssse3_x86_64.asm
rename to av1/encoder/x86/quantize_ssse3_x86_64.asm
diff --git a/vp10/encoder/x86/ssim_opt_x86_64.asm b/av1/encoder/x86/ssim_opt_x86_64.asm
similarity index 99%
rename from vp10/encoder/x86/ssim_opt_x86_64.asm
rename to av1/encoder/x86/ssim_opt_x86_64.asm
index b45f009..29659ee 100644
--- a/vp10/encoder/x86/ssim_opt_x86_64.asm
+++ b/av1/encoder/x86/ssim_opt_x86_64.asm
@@ -8,7 +8,7 @@
 ;  be found in the AUTHORS file in the root of the source tree.
 ;
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 ; tabulate_ssim - sums sum_s,sum_r,sum_sq_s,sum_sq_r, sum_sxr
 %macro TABULATE_SSIM 0
diff --git a/vp10/encoder/x86/temporal_filter_apply_sse2.asm b/av1/encoder/x86/temporal_filter_apply_sse2.asm
similarity index 99%
rename from vp10/encoder/x86/temporal_filter_apply_sse2.asm
rename to av1/encoder/x86/temporal_filter_apply_sse2.asm
index 7171807..eabe575 100644
--- a/vp10/encoder/x86/temporal_filter_apply_sse2.asm
+++ b/av1/encoder/x86/temporal_filter_apply_sse2.asm
@@ -9,7 +9,7 @@
 ;
 
 
-%include "vpx_ports/x86_abi_support.asm"
+%include "aom_ports/x86_abi_support.asm"
 
 ; void vp10_temporal_filter_apply_sse2 | arg
 ;  (unsigned char  *frame1,           |  0
diff --git a/vp10/encoder/x86/vp10_highbd_quantize_sse4.c b/av1/encoder/x86/vp10_highbd_quantize_sse4.c
similarity index 99%
rename from vp10/encoder/x86/vp10_highbd_quantize_sse4.c
rename to av1/encoder/x86/vp10_highbd_quantize_sse4.c
index c49247b..8b05c6a 100644
--- a/vp10/encoder/x86/vp10_highbd_quantize_sse4.c
+++ b/av1/encoder/x86/vp10_highbd_quantize_sse4.c
@@ -12,7 +12,7 @@
 #include <stdint.h>
 
 #include "./vp10_rtcd.h"
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
 // Coefficient quantization phase 1
 // param[0-2] : rounding/quan/dequan constants
diff --git a/vp10/encoder/x86/wedge_utils_sse2.c b/av1/encoder/x86/wedge_utils_sse2.c
similarity index 98%
rename from vp10/encoder/x86/wedge_utils_sse2.c
rename to av1/encoder/x86/wedge_utils_sse2.c
index 19bef91..a6be947 100644
--- a/vp10/encoder/x86/wedge_utils_sse2.c
+++ b/av1/encoder/x86/wedge_utils_sse2.c
@@ -11,11 +11,11 @@
 #include <assert.h>
 #include <immintrin.h>
 
-#include "vpx_dsp/x86/synonyms.h"
+#include "aom_dsp/x86/synonyms.h"
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
-#include "vp10/common/reconinter.h"
+#include "av1/common/reconinter.h"
 
 #define MAX_MASK_VALUE (1 << WEDGE_WEIGHT_BITS)
 
diff --git a/vp10/exports_dec b/av1/exports_dec
similarity index 100%
rename from vp10/exports_dec
rename to av1/exports_dec
diff --git a/vp10/exports_enc b/av1/exports_enc
similarity index 100%
rename from vp10/exports_enc
rename to av1/exports_enc
diff --git a/vp10/vp10_common.mk b/av1/vp10_common.mk
similarity index 98%
rename from vp10/vp10_common.mk
rename to av1/vp10_common.mk
index e25cdcf..e776a8a 100644
--- a/vp10/vp10_common.mk
+++ b/av1/vp10_common.mk
@@ -136,4 +136,4 @@
 VP10_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp10_inv_txfm_sse2.c
 VP10_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp10_inv_txfm_sse2.h
 
-$(eval $(call rtcd_h_template,vp10_rtcd,vp10/common/vp10_rtcd_defs.pl))
+$(eval $(call rtcd_h_template,vp10_rtcd,av1/common/vp10_rtcd_defs.pl))
diff --git a/vp10/vp10_cx_iface.c b/av1/vp10_cx_iface.c
similarity index 99%
rename from vp10/vp10_cx_iface.c
rename to av1/vp10_cx_iface.c
index edcf25a..34dd428 100644
--- a/vp10/vp10_cx_iface.c
+++ b/av1/vp10_cx_iface.c
@@ -12,15 +12,15 @@
 #include <string.h>
 
 #include "./vpx_config.h"
-#include "vpx/vpx_encoder.h"
-#include "vpx_ports/vpx_once.h"
-#include "vpx_ports/system_state.h"
-#include "vpx/internal/vpx_codec_internal.h"
+#include "aom/vpx_encoder.h"
+#include "aom_ports/vpx_once.h"
+#include "aom_ports/system_state.h"
+#include "aom/internal/vpx_codec_internal.h"
 #include "./vpx_version.h"
-#include "vp10/encoder/encoder.h"
-#include "vpx/vp8cx.h"
-#include "vp10/encoder/firstpass.h"
-#include "vp10/vp10_iface_common.h"
+#include "av1/encoder/encoder.h"
+#include "aom/vp8cx.h"
+#include "av1/encoder/firstpass.h"
+#include "av1/vp10_iface_common.h"
 
 struct vp10_extracfg {
   int cpu_used;  // available cpu percentage in 1/16
diff --git a/vp10/vp10_dx_iface.c b/av1/vp10_dx_iface.c
similarity index 98%
rename from vp10/vp10_dx_iface.c
rename to av1/vp10_dx_iface.c
index 1b8636f..9e17c5a 100644
--- a/vp10/vp10_dx_iface.c
+++ b/av1/vp10_dx_iface.c
@@ -14,21 +14,21 @@
 #include "./vpx_config.h"
 #include "./vpx_version.h"
 
-#include "vpx/internal/vpx_codec_internal.h"
-#include "vpx/vp8dx.h"
-#include "vpx/vpx_decoder.h"
-#include "vpx_dsp/bitreader_buffer.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_util/vpx_thread.h"
+#include "aom/internal/vpx_codec_internal.h"
+#include "aom/vp8dx.h"
+#include "aom/vpx_decoder.h"
+#include "aom_dsp/bitreader_buffer.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_util/vpx_thread.h"
 
-#include "vp10/common/alloccommon.h"
-#include "vp10/common/frame_buffers.h"
-#include "vp10/common/enums.h"
+#include "av1/common/alloccommon.h"
+#include "av1/common/frame_buffers.h"
+#include "av1/common/enums.h"
 
-#include "vp10/decoder/decoder.h"
-#include "vp10/decoder/decodeframe.h"
+#include "av1/decoder/decoder.h"
+#include "av1/decoder/decodeframe.h"
 
-#include "vp10/vp10_iface_common.h"
+#include "av1/vp10_iface_common.h"
 
 typedef vpx_codec_stream_info_t vp10_stream_info_t;
 
diff --git a/vp10/vp10_iface_common.h b/av1/vp10_iface_common.h
similarity index 99%
rename from vp10/vp10_iface_common.h
rename to av1/vp10_iface_common.h
index d8de21e..37a9cc1 100644
--- a/vp10/vp10_iface_common.h
+++ b/av1/vp10_iface_common.h
@@ -10,7 +10,7 @@
 #ifndef VP10_VP10_IFACE_COMMON_H_
 #define VP10_VP10_IFACE_COMMON_H_
 
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
 static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12,
                             void *user_priv) {
diff --git a/vp10/vp10cx.mk b/av1/vp10cx.mk
similarity index 100%
rename from vp10/vp10cx.mk
rename to av1/vp10cx.mk
diff --git a/vp10/vp10dx.mk b/av1/vp10dx.mk
similarity index 100%
rename from vp10/vp10dx.mk
rename to av1/vp10dx.mk
diff --git a/build/make/Android.mk b/build/make/Android.mk
index 9c5ecc6..b3a2a08 100644
--- a/build/make/Android.mk
+++ b/build/make/Android.mk
@@ -9,11 +9,11 @@
 ##
 
 #
-# 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
+# This file is to be used for compiling libaom for Android using the NDK.
+# In an Android project place a libaom checkout in the jni directory.
+# Run the configure script from the jni directory.  Base libaom
 # encoder/decoder configuration will look similar to:
-# ./libvpx/configure --target=armv7-android-gcc --disable-examples \
+# ./libaom/configure --target=armv7-android-gcc --disable-examples \
 #                    --sdk-path=/opt/android-ndk-r6b/
 #
 # When targeting Android, realtime-only is enabled by default.  This can
@@ -24,33 +24,33 @@
 # source files to compile.
 #
 # Place an Android.mk file in the jni directory that references the
-# Android.mk file in the libvpx directory:
+# Android.mk file in the libaom directory:
 # LOCAL_PATH := $(call my-dir)
 # include $(CLEAR_VARS)
-# include jni/libvpx/build/make/Android.mk
+# include jni/libaom/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.
+# By default libaom 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.
+# libaom 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
+# To change to building armeabi, run ./libaom/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.
+# Running ndk-build will build libaom and include it in your project.
 #
 
 CONFIG_DIR := $(LOCAL_PATH)/
-LIBVPX_PATH := $(LOCAL_PATH)/libvpx
+LIBAOM_PATH := $(LOCAL_PATH)/libaom
 ASM_CNV_PATH_LOCAL := $(TARGET_ARCH_ABI)/ads2gas
 ASM_CNV_PATH := $(LOCAL_PATH)/$(ASM_CNV_PATH_LOCAL)
 
@@ -75,26 +75,26 @@
   $(error Not a supported TARGET_ARCH_ABI: $(TARGET_ARCH_ABI))
 endif
 
-# Rule that is normally in Makefile created by libvpx
+# Rule that is normally in Makefile created by libaom
 # 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
+# Override the relative path that is defined by the libaom
 # configure process
-SRC_PATH_BARE := $(LIBVPX_PATH)
+SRC_PATH_BARE := $(LIBAOM_PATH)
 
 # Include the list of files to be built
-include $(LIBVPX_PATH)/libs.mk
+include $(LIBAOM_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)
+LOCAL_ASMFLAGS := -I$(LIBAOM_PATH)
 
 .PRECIOUS: %.asm.s
-$(ASM_CNV_PATH)/libvpx/%.asm.s: $(LIBVPX_PATH)/%.asm
+$(ASM_CNV_PATH)/libaom/%.asm.s: $(LIBAOM_PATH)/%.asm
 	@mkdir -p $(dir $@)
 	@$(CONFIG_DIR)$(ASM_CONVERSION) <$< > $@
 
@@ -108,18 +108,18 @@
 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.
+# so it does not need libaom/ 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))
+LOCAL_SRC_FILES += $(foreach file, $(LOCAL_CODEC_SRCS_C), libaom/$(file))
 ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
-  LOCAL_SRC_FILES += $(foreach file, $(LOCAL_NEON_SRCS_C), libvpx/$(file).neon)
+  LOCAL_SRC_FILES += $(foreach file, $(LOCAL_NEON_SRCS_C), libaom/$(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))
+  LOCAL_SRC_FILES += $(foreach file, $(LOCAL_NEON_SRCS_C), libaom/$(file))
 endif
 
 # Pull out assembly files, splitting NEON from the rest.  This is
@@ -129,7 +129,7 @@
 # x86:
 
 CODEC_SRCS_ASM_X86 = $(filter %.asm, $(CODEC_SRCS_UNIQUE))
-LOCAL_SRC_FILES += $(foreach file, $(CODEC_SRCS_ASM_X86), libvpx/$(file))
+LOCAL_SRC_FILES += $(foreach file, $(CODEC_SRCS_ASM_X86), libaom/$(file))
 
 # arm:
 CODEC_SRCS_ASM_ARM_ALL = $(filter %.asm.s, $(CODEC_SRCS_UNIQUE))
@@ -137,7 +137,7 @@
                      $(CODEC_SRCS_ASM_ARM_ALL), \
                      $(if $(findstring neon,$(v)),,$(v)))
 CODEC_SRCS_ASM_ADS2GAS = $(patsubst %.s, \
-                         $(ASM_CNV_PATH_LOCAL)/libvpx/%.s, \
+                         $(ASM_CNV_PATH_LOCAL)/libaom/%.s, \
                          $(CODEC_SRCS_ASM_ARM))
 LOCAL_SRC_FILES += $(CODEC_SRCS_ASM_ADS2GAS)
 
@@ -146,7 +146,7 @@
                         $(CODEC_SRCS_ASM_ARM_ALL),\
                         $(if $(findstring neon,$(v)),$(v),))
   CODEC_SRCS_ASM_NEON_ADS2GAS = $(patsubst %.s, \
-                                $(ASM_CNV_PATH_LOCAL)/libvpx/%.s, \
+                                $(ASM_CNV_PATH_LOCAL)/libaom/%.s, \
                                 $(CODEC_SRCS_ASM_NEON))
   LOCAL_SRC_FILES += $(patsubst %.s, \
                      %.s.neon, \
@@ -155,10 +155,10 @@
 
 LOCAL_CFLAGS += \
     -DHAVE_CONFIG_H=vpx_config.h \
-    -I$(LIBVPX_PATH) \
+    -I$(LIBAOM_PATH) \
     -I$(ASM_CNV_PATH)
 
-LOCAL_MODULE := libvpx
+LOCAL_MODULE := libaom
 
 ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
   LOCAL_STATIC_LIBRARIES := cpufeatures
diff --git a/build/make/configure.sh b/build/make/configure.sh
index 86afb88..230d588 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -3,7 +3,7 @@
 ##  configure.sh
 ##
 ##  This script is sourced by the main configure script and contains
-##  utility functions and other common bits that aren't strictly libvpx
+##  utility functions and other common bits that aren't strictly libaom
 ##  related.
 ##
 ##  This build system is based in part on the FFmpeg configure script.
diff --git a/build/make/gen_msvs_vcxproj.sh b/build/make/gen_msvs_vcxproj.sh
index e98611d..9c5e859 100755
--- a/build/make/gen_msvs_vcxproj.sh
+++ b/build/make/gen_msvs_vcxproj.sh
@@ -299,7 +299,7 @@
             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,
+            # actual value doesn't matter from the libaom 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
diff --git a/build/make/iosbuild.sh b/build/make/iosbuild.sh
index c703f22..e8fa112 100755
--- a/build/make/iosbuild.sh
+++ b/build/make/iosbuild.sh
@@ -27,7 +27,7 @@
 FRAMEWORK_LIB="VPX.framework/VPX"
 HEADER_DIR="${FRAMEWORK_DIR}/Headers/vpx"
 SCRIPT_DIR=$(dirname "$0")
-LIBVPX_SOURCE_DIR=$(cd ${SCRIPT_DIR}/../..; pwd)
+LIBAOM_SOURCE_DIR=$(cd ${SCRIPT_DIR}/../..; pwd)
 LIPO=$(xcrun -sdk iphoneos${SDK} -find lipo)
 ORIG_PWD="$(pwd)"
 ARM_TARGETS="arm64-darwin-gcc
@@ -40,7 +40,7 @@
 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.
+# target using $ as the distribution output directory.
 build_target() {
   local target="$1"
   local old_pwd="$(pwd)"
@@ -57,7 +57,7 @@
 
   mkdir "${target}"
   cd "${target}"
-  eval "${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \
+  eval "${LIBAOM_SOURCE_DIR}/configure" --target="${target}" \
     ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} ${target_specific_flags} \
     ${devnull}
   export DIST_DIR
@@ -125,7 +125,7 @@
     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 "#include \"VPX/aom/${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}"
@@ -147,7 +147,7 @@
   for target; do
     cpu="${target%%-*}"
     if [ "${cpu}" = "x86" ]; then
-      # lipo -info outputs i386 for libvpx x86 targets.
+      # lipo -info outputs i386 for libaom x86 targets.
       cpu="i386"
     fi
     requested_cpus="${requested_cpus}${cpu} "
@@ -201,14 +201,14 @@
     else
       local suffix="a"
     fi
-    lib_list="${lib_list} ${target_dist_dir}/lib/libvpx.${suffix}"
+    lib_list="${lib_list} ${target_dist_dir}/lib/libaom.${suffix}"
   done
 
   cd "${ORIG_PWD}"
 
-  # The basic libvpx API includes are all the same; just grab the most recent
+  # The basic libaom API includes are all the same; just grab the most recent
   # set.
-  cp -p "${target_dist_dir}"/include/vpx/* "${HEADER_DIR}"
+  cp -p "${target_dist_dir}"/include/aom/* "${HEADER_DIR}"
 
   # Build the fat library.
   ${LIPO} -create ${lib_list} -output ${FRAMEWORK_DIR}/VPX
@@ -270,7 +270,7 @@
   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.
+    --extra-configure-args <args>: Extra args to pass when configuring libaom.
     --macosx: Uses darwin15 targets instead of iphonesimulator targets for x86
               and x86_64. Allows linking to framework when builds target MacOSX
               instead of iOS.
@@ -342,7 +342,7 @@
   CONFIGURE_ARGS="--enable-shared ${CONFIGURE_ARGS}"
 fi
 
-FULLVERSION=$("${SCRIPT_DIR}"/version.sh --bare "${LIBVPX_SOURCE_DIR}")
+FULLVERSION=$("${SCRIPT_DIR}"/version.sh --bare "${LIBAOM_SOURCE_DIR}")
 VERSION=$(echo "${FULLVERSION}" | sed -E 's/^v([0-9]+\.[0-9]+\.[0-9]+).*$/\1/')
 
 if [ "$ENABLE_SHARED" = "yes" ]; then
@@ -362,7 +362,7 @@
   FRAMEWORK_DIR=${FRAMEWORK_DIR}
   FRAMEWORK_LIB=${FRAMEWORK_LIB}
   HEADER_DIR=${HEADER_DIR}
-  LIBVPX_SOURCE_DIR=${LIBVPX_SOURCE_DIR}
+  LIBAOM_SOURCE_DIR=${LIBAOM_SOURCE_DIR}
   LIPO=${LIPO}
   MAKEFLAGS=${MAKEFLAGS}
   ORIG_PWD=${ORIG_PWD}
diff --git a/build/make/rtcd.pl b/build/make/rtcd.pl
index 50093f4..59dbe52 100755
--- a/build/make/rtcd.pl
+++ b/build/make/rtcd.pl
@@ -250,7 +250,7 @@
   common_top;
   print <<EOF;
 #ifdef RTCD_C
-#include "vpx_ports/x86.h"
+#include "aom_ports/x86.h"
 static void setup_rtcd_internal(void)
 {
     int flags = x86_simd_caps();
@@ -285,7 +285,7 @@
 #include "vpx_config.h"
 
 #ifdef RTCD_C
-#include "vpx_ports/arm.h"
+#include "aom_ports/arm.h"
 static void setup_rtcd_internal(void)
 {
     int flags = arm_cpu_caps();
diff --git a/configure b/configure
index 44f7c23..73a5308 100755
--- a/configure
+++ b/configure
@@ -189,7 +189,7 @@
 fi
 
 # disable codecs when their source directory does not exist
-[ -d "${source_path}/vp10" ] || disable_codec vp10
+[ -d "${source_path}/av1" ] || 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
@@ -584,7 +584,7 @@
     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
+    check_header aom/vpx_integer.h -I${source_path} && enable_feature vpx_ports
 }
 
 process_toolchain() {
@@ -606,7 +606,7 @@
         check_add_cflags -Wunused-variable
         case ${CC} in
           *clang*)
-              # libvpx and/or clang have issues with aliasing:
+              # libaom 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
@@ -748,7 +748,7 @@
 process "$@"
 print_webm_license ${BUILD_PFX}vpx_config.c "/*" " */"
 cat <<EOF >> ${BUILD_PFX}vpx_config.c
-#include "vpx/vpx_codec.h"
+#include "aom/vpx_codec.h"
 static const char* const cfg = "$CONFIGURE_ARGS";
 const char *vpx_codec_build_config(void) {return cfg;}
 EOF
diff --git a/examples.mk b/examples.mk
index 30fade1..07bdb05 100644
--- a/examples.mk
+++ b/examples.mk
@@ -65,11 +65,11 @@
 # 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                 += aom_ports/mem_ops.h
+vpxdec.SRCS                 += aom_ports/mem_ops_aligned.h
+vpxdec.SRCS                 += aom_ports/msvc.h
+vpxdec.SRCS                 += aom_ports/vpx_timer.h
+vpxdec.SRCS                 += aom/vpx_integer.h
 vpxdec.SRCS                 += args.c args.h
 vpxdec.SRCS                 += ivfdec.c ivfdec.h
 vpxdec.SRCS                 += tools_common.c tools_common.h
@@ -92,10 +92,10 @@
 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                 += aom_ports/mem_ops.h
+vpxenc.SRCS                 += aom_ports/mem_ops_aligned.h
+vpxenc.SRCS                 += aom_ports/msvc.h
+vpxenc.SRCS                 += aom_ports/vpx_timer.h
 vpxenc.SRCS                 += vpxstats.c vpxstats.h
 ifeq ($(CONFIG_LIBYUV),yes)
   vpxenc.SRCS                 += $(LIBYUV_SRCS)
@@ -115,9 +115,9 @@
 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.SRCS                += aom_ports/mem_ops.h
+simple_decoder.SRCS                += aom_ports/mem_ops_aligned.h
+simple_decoder.SRCS                += aom_ports/msvc.h
 simple_decoder.DESCRIPTION          = Simplified decoder loop
 EXAMPLES-$(CONFIG_DECODERS)        += decode_to_md5.c
 decode_to_md5.SRCS                 += md5_utils.h md5_utils.c
@@ -125,9 +125,9 @@
 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.SRCS                 += aom_ports/mem_ops.h
+decode_to_md5.SRCS                 += aom_ports/mem_ops_aligned.h
+decode_to_md5.SRCS                 += aom_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
@@ -135,7 +135,7 @@
 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.SRCS             += aom_ports/msvc.h
 simple_encoder.GUID              = 4607D299-8A71-4D2C-9B1D-071899B6FBFD
 simple_encoder.DESCRIPTION       = Simplified encoder loop
 EXAMPLES-$(CONFIG_VP10_ENCODER) += lossless_encoder.c
@@ -143,7 +143,7 @@
 lossless_encoder.SRCS           += tools_common.h tools_common.c
 lossless_encoder.SRCS           += video_common.h
 lossless_encoder.SRCS           += video_writer.h video_writer.c
-lossless_encoder.SRCS           += vpx_ports/msvc.h
+lossless_encoder.SRCS           += aom_ports/msvc.h
 lossless_encoder.GUID            = B63C7C88-5348-46DC-A5A6-CC151EF93366
 lossless_encoder.DESCRIPTION     = Simplified lossless encoder
 EXAMPLES-$(CONFIG_ENCODERS)     += twopass_encoder.c
@@ -151,7 +151,7 @@
 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.SRCS            += aom_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
@@ -159,9 +159,9 @@
 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.SRCS          += aom_ports/mem_ops.h
+decode_with_drops.SRCS          += aom_ports/mem_ops_aligned.h
+decode_with_drops.SRCS          += aom_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
@@ -169,7 +169,7 @@
 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.SRCS                      += aom_ports/msvc.h
 set_maps.GUID                       = ECB2D24D-98B8-4015-A465-A4AF3DCC145F
 set_maps.DESCRIPTION                = Set active and ROI maps
 
@@ -249,7 +249,7 @@
 
 
 # Instantiate linker template for all examples.
-CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
+CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),aom_g,aom)
 ifneq ($(filter darwin%,$(TGT_OS)),)
 SHARED_LIB_SUF=.dylib
 else
diff --git a/examples/decode_to_md5.c b/examples/decode_to_md5.c
index 51959f3..3cf40e6 100644
--- a/examples/decode_to_md5.c
+++ b/examples/decode_to_md5.c
@@ -33,8 +33,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "vpx/vp8dx.h"
-#include "vpx/vpx_decoder.h"
+#include "aom/vp8dx.h"
+#include "aom/vpx_decoder.h"
 
 #include "../md5_utils.h"
 #include "../tools_common.h"
diff --git a/examples/decode_with_drops.c b/examples/decode_with_drops.c
index 29b8be9..17757f6 100644
--- a/examples/decode_with_drops.c
+++ b/examples/decode_with_drops.c
@@ -56,8 +56,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "vpx/vp8dx.h"
-#include "vpx/vpx_decoder.h"
+#include "aom/vp8dx.h"
+#include "aom/vpx_decoder.h"
 
 #include "../tools_common.h"
 #include "../video_reader.h"
diff --git a/examples/lossless_encoder.c b/examples/lossless_encoder.c
index 5c380a8..09693c8 100644
--- a/examples/lossless_encoder.c
+++ b/examples/lossless_encoder.c
@@ -12,8 +12,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "vpx/vpx_encoder.h"
-#include "vpx/vp8cx.h"
+#include "aom/vpx_encoder.h"
+#include "aom/vp8cx.h"
 
 #include "../tools_common.h"
 #include "../video_writer.h"
diff --git a/examples/set_maps.c b/examples/set_maps.c
index d128e7d..ae6a113 100644
--- a/examples/set_maps.c
+++ b/examples/set_maps.c
@@ -46,8 +46,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "vpx/vp8cx.h"
-#include "vpx/vpx_encoder.h"
+#include "aom/vp8cx.h"
+#include "aom/vpx_encoder.h"
 
 #include "../tools_common.h"
 #include "../video_writer.h"
diff --git a/examples/simple_decoder.c b/examples/simple_decoder.c
index 2bb1a05..7b21ebf 100644
--- a/examples/simple_decoder.c
+++ b/examples/simple_decoder.c
@@ -32,7 +32,7 @@
 //
 // Initializing The Codec
 // ----------------------
-// The libvpx decoder is initialized by the call to vpx_codec_dec_init().
+// The libaom 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
@@ -79,7 +79,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "vpx/vpx_decoder.h"
+#include "aom/vpx_decoder.h"
 
 #include "../tools_common.h"
 #include "../video_reader.h"
diff --git a/examples/simple_encoder.c b/examples/simple_encoder.c
index 331a2a5..2cae453 100644
--- a/examples/simple_encoder.c
+++ b/examples/simple_encoder.c
@@ -99,7 +99,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "vpx/vpx_encoder.h"
+#include "aom/vpx_encoder.h"
 
 #include "../tools_common.h"
 #include "../video_writer.h"
diff --git a/examples/twopass_encoder.c b/examples/twopass_encoder.c
index 4c130ec..0ed303a 100644
--- a/examples/twopass_encoder.c
+++ b/examples/twopass_encoder.c
@@ -51,7 +51,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "vpx/vpx_encoder.h"
+#include "aom/vpx_encoder.h"
 
 #include "../tools_common.h"
 #include "../video_writer.h"
diff --git a/examples/vpxcx_set_ref.c b/examples/vpxcx_set_ref.c
index 6771d42..0d57f4d 100644
--- a/examples/vpxcx_set_ref.c
+++ b/examples/vpxcx_set_ref.c
@@ -50,9 +50,9 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "vpx/vp8cx.h"
-#include "vpx/vpx_decoder.h"
-#include "vpx/vpx_encoder.h"
+#include "aom/vp8cx.h"
+#include "aom/vpx_decoder.h"
+#include "aom/vpx_encoder.h"
 
 #include "./tools_common.h"
 #include "./video_writer.h"
diff --git a/ivfdec.c b/ivfdec.c
index f64e594..24a0d94 100644
--- a/ivfdec.c
+++ b/ivfdec.c
@@ -12,7 +12,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "vpx_ports/mem_ops.h"
+#include "aom_ports/mem_ops.h"
 
 #include "./ivfdec.h"
 
diff --git a/ivfenc.c b/ivfenc.c
index a50d318..b1e0f77 100644
--- a/ivfenc.c
+++ b/ivfenc.c
@@ -10,8 +10,8 @@
 
 #include "./ivfenc.h"
 
-#include "vpx/vpx_encoder.h"
-#include "vpx_ports/mem_ops.h"
+#include "aom/vpx_encoder.h"
+#include "aom_ports/mem_ops.h"
 
 void ivf_write_file_header(FILE *outfile, const struct vpx_codec_enc_cfg *cfg,
                            unsigned int fourcc, int frame_cnt) {
diff --git a/libs.mk b/libs.mk
index b42c623..2979cec 100644
--- a/libs.mk
+++ b/libs.mk
@@ -34,56 +34,56 @@
 CODEC_SRCS-yes += CHANGELOG
 CODEC_SRCS-yes += libs.mk
 
-include $(SRC_PATH_BARE)/vpx/vpx_codec.mk
-CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS))
-CODEC_DOC_SRCS += $(addprefix vpx/,$(call enabled,API_DOC_SRCS))
+include $(SRC_PATH_BARE)/aom/vpx_codec.mk
+CODEC_SRCS-yes += $(addprefix aom/,$(call enabled,API_SRCS))
+CODEC_DOC_SRCS += $(addprefix aom/,$(call enabled,API_DOC_SRCS))
 
-include $(SRC_PATH_BARE)/vpx_mem/vpx_mem.mk
-CODEC_SRCS-yes += $(addprefix vpx_mem/,$(call enabled,MEM_SRCS))
+include $(SRC_PATH_BARE)/aom_mem/vpx_mem.mk
+CODEC_SRCS-yes += $(addprefix aom_mem/,$(call enabled,MEM_SRCS))
 
-include $(SRC_PATH_BARE)/vpx_scale/vpx_scale.mk
-CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS))
+include $(SRC_PATH_BARE)/aom_scale/vpx_scale.mk
+CODEC_SRCS-yes += $(addprefix aom_scale/,$(call enabled,SCALE_SRCS))
 
-include $(SRC_PATH_BARE)/vpx_ports/vpx_ports.mk
-CODEC_SRCS-yes += $(addprefix vpx_ports/,$(call enabled,PORTS_SRCS))
+include $(SRC_PATH_BARE)/aom_ports/vpx_ports.mk
+CODEC_SRCS-yes += $(addprefix aom_ports/,$(call enabled,PORTS_SRCS))
 
-include $(SRC_PATH_BARE)/vpx_dsp/vpx_dsp.mk
-CODEC_SRCS-yes += $(addprefix vpx_dsp/,$(call enabled,DSP_SRCS))
+include $(SRC_PATH_BARE)/aom_dsp/vpx_dsp.mk
+CODEC_SRCS-yes += $(addprefix aom_dsp/,$(call enabled,DSP_SRCS))
 
-include $(SRC_PATH_BARE)/vpx_util/vpx_util.mk
-CODEC_SRCS-yes += $(addprefix vpx_util/,$(call enabled,UTIL_SRCS))
+include $(SRC_PATH_BARE)/aom_util/vpx_util.mk
+CODEC_SRCS-yes += $(addprefix aom_util/,$(call enabled,UTIL_SRCS))
 
 #  VP10 make file
 ifeq ($(CONFIG_VP10),yes)
-  VP10_PREFIX=vp10/
+  VP10_PREFIX=av1/
   include $(SRC_PATH_BARE)/$(VP10_PREFIX)vp10_common.mk
 endif
 
 ifeq ($(CONFIG_VP10_ENCODER),yes)
-  VP10_PREFIX=vp10/
+  VP10_PREFIX=av1/
   include $(SRC_PATH_BARE)/$(VP10_PREFIX)vp10cx.mk
   CODEC_SRCS-yes += $(addprefix $(VP10_PREFIX),$(call enabled,VP10_CX_SRCS))
   CODEC_EXPORTS-yes += $(addprefix $(VP10_PREFIX),$(VP10_CX_EXPORTS))
-  CODEC_SRCS-yes += $(VP10_PREFIX)vp10cx.mk vpx/vp8.h vpx/vp8cx.h
-  INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h
-  INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP10_PREFIX)/%
-  CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h
+  CODEC_SRCS-yes += $(VP10_PREFIX)vp10cx.mk aom/vp8.h aom/vp8cx.h
+  INSTALL-LIBS-yes += include/aom/vp8.h include/aom/vp8cx.h
+  INSTALL_MAPS += include/aom/% $(SRC_PATH_BARE)/$(VP10_PREFIX)/%
+  CODEC_DOC_SRCS += aom/vp8.h aom/vp8cx.h
   CODEC_DOC_SECTIONS += vp9 vp9_encoder
 endif
 
 ifeq ($(CONFIG_VP10_DECODER),yes)
-  VP10_PREFIX=vp10/
+  VP10_PREFIX=av1/
   include $(SRC_PATH_BARE)/$(VP10_PREFIX)vp10dx.mk
   CODEC_SRCS-yes += $(addprefix $(VP10_PREFIX),$(call enabled,VP10_DX_SRCS))
   CODEC_EXPORTS-yes += $(addprefix $(VP10_PREFIX),$(VP10_DX_EXPORTS))
-  CODEC_SRCS-yes += $(VP10_PREFIX)vp10dx.mk vpx/vp8.h vpx/vp8dx.h
-  INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8dx.h
-  INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP10_PREFIX)/%
-  CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8dx.h
+  CODEC_SRCS-yes += $(VP10_PREFIX)vp10dx.mk aom/vp8.h aom/vp8dx.h
+  INSTALL-LIBS-yes += include/aom/vp8.h include/aom/vp8dx.h
+  INSTALL_MAPS += include/aom/% $(SRC_PATH_BARE)/$(VP10_PREFIX)/%
+  CODEC_DOC_SRCS += aom/vp8.h aom/vp8dx.h
   CODEC_DOC_SECTIONS += vp9 vp9_decoder
 endif
 
-VP10_PREFIX=vp10/
+VP10_PREFIX=av1/
 $(BUILD_PFX)$(VP10_PREFIX)%.c.o: CFLAGS += -Wextra
 
 ifeq ($(CONFIG_ENCODERS),yes)
@@ -104,8 +104,8 @@
 
 # The following pairs define a mapping of locations in the distribution
 # tree to locations in the source/build trees.
-INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx/%
-INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx_ports/%
+INSTALL_MAPS += include/aom/% $(SRC_PATH_BARE)/aom/%
+INSTALL_MAPS += include/aom/% $(SRC_PATH_BARE)/aom_ports/%
 INSTALL_MAPS += $(LIBSUBDIR)/%     %
 INSTALL_MAPS += src/%     $(SRC_PATH_BARE)/%
 ifeq ($(CONFIG_MSVS),yes)
@@ -115,25 +115,25 @@
 
 CODEC_SRCS-yes += build/make/version.sh
 CODEC_SRCS-yes += build/make/rtcd.pl
-CODEC_SRCS-yes += vpx_ports/emmintrin_compat.h
-CODEC_SRCS-yes += vpx_ports/mem_ops.h
-CODEC_SRCS-yes += vpx_ports/mem_ops_aligned.h
-CODEC_SRCS-yes += vpx_ports/vpx_once.h
+CODEC_SRCS-yes += aom_ports/emmintrin_compat.h
+CODEC_SRCS-yes += aom_ports/mem_ops.h
+CODEC_SRCS-yes += aom_ports/mem_ops_aligned.h
+CODEC_SRCS-yes += aom_ports/vpx_once.h
 CODEC_SRCS-yes += $(BUILD_PFX)vpx_config.c
 INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
 ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += third_party/x86inc/x86inc.asm
 endif
-CODEC_EXPORTS-yes += vpx/exports_com
-CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc
-CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
+CODEC_EXPORTS-yes += aom/exports_com
+CODEC_EXPORTS-$(CONFIG_ENCODERS) += aom/exports_enc
+CODEC_EXPORTS-$(CONFIG_DECODERS) += aom/exports_dec
 
-INSTALL-LIBS-yes += include/vpx/vpx_codec.h
-INSTALL-LIBS-yes += include/vpx/vpx_frame_buffer.h
-INSTALL-LIBS-yes += include/vpx/vpx_image.h
-INSTALL-LIBS-yes += include/vpx/vpx_integer.h
-INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder.h
-INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_encoder.h
+INSTALL-LIBS-yes += include/aom/vpx_codec.h
+INSTALL-LIBS-yes += include/aom/vpx_frame_buffer.h
+INSTALL-LIBS-yes += include/aom/vpx_image.h
+INSTALL-LIBS-yes += include/aom/vpx_integer.h
+INSTALL-LIBS-$(CONFIG_DECODERS) += include/aom/vpx_decoder.h
+INSTALL-LIBS-$(CONFIG_ENCODERS) += include/aom/vpx_encoder.h
 ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
 ifeq ($(CONFIG_MSVS),yes)
 INSTALL-LIBS-yes                  += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB).lib)
@@ -142,8 +142,8 @@
 INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.exp)
 endif
 else
-INSTALL-LIBS-$(CONFIG_STATIC) += $(LIBSUBDIR)/libvpx.a
-INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(LIBSUBDIR)/libvpx_g.a
+INSTALL-LIBS-$(CONFIG_STATIC) += $(LIBSUBDIR)/libaom.a
+INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(LIBSUBDIR)/libaom_g.a
 endif
 
 CODEC_SRCS=$(call enabled,CODEC_SRCS)
@@ -153,10 +153,10 @@
 
 # Generate a list of all enabled sources, in particular for exporting to gyp
 # based build systems.
-libvpx_srcs.txt:
+libaom_srcs.txt:
 	@echo "    [CREATE] $@"
 	@echo $(CODEC_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@
-CLEAN-OBJS += libvpx_srcs.txt
+CLEAN-OBJS += libaom_srcs.txt
 
 
 ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
@@ -174,7 +174,7 @@
 ASM_INCLUDES := \
     third_party/x86inc/x86inc.asm \
     vpx_config.asm \
-    vpx_ports/x86_abi_support.asm \
+    aom_ports/x86_abi_support.asm \
 
 vpx.$(VCPROJ_SFX): $(CODEC_SRCS) vpx.def
 	@echo "    [CREATE] $@"
@@ -198,101 +198,101 @@
 
 endif
 else
-LIBVPX_OBJS=$(call objs,$(CODEC_SRCS))
-OBJS-yes += $(LIBVPX_OBJS)
-LIBS-$(if yes,$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
-$(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS)
+LIBAOM_OBJS=$(call objs,$(CODEC_SRCS))
+OBJS-yes += $(LIBAOM_OBJS)
+LIBS-$(if yes,$(CONFIG_STATIC)) += $(BUILD_PFX)libaom.a $(BUILD_PFX)libaom_g.a
+$(BUILD_PFX)libaom_g.a: $(LIBAOM_OBJS)
 
 SO_VERSION_MAJOR := 3
 SO_VERSION_MINOR := 0
 SO_VERSION_PATCH := 0
 ifeq ($(filter darwin%,$(TGT_OS)),$(TGT_OS))
-LIBVPX_SO               := libvpx.$(SO_VERSION_MAJOR).dylib
+LIBAOM_SO               := libaom.$(SO_VERSION_MAJOR).dylib
 SHARED_LIB_SUF          := .dylib
-EXPORT_FILE             := libvpx.syms
-LIBVPX_SO_SYMLINKS      := $(addprefix $(LIBSUBDIR)/, \
-                             libvpx.dylib  )
+EXPORT_FILE             := libaom.syms
+LIBAOM_SO_SYMLINKS      := $(addprefix $(LIBSUBDIR)/, \
+                             libaom.dylib  )
 else
 ifeq ($(filter iphonesimulator%,$(TGT_OS)),$(TGT_OS))
-LIBVPX_SO               := libvpx.$(SO_VERSION_MAJOR).dylib
+LIBAOM_SO               := libaom.$(SO_VERSION_MAJOR).dylib
 SHARED_LIB_SUF          := .dylib
-EXPORT_FILE             := libvpx.syms
-LIBVPX_SO_SYMLINKS      := $(addprefix $(LIBSUBDIR)/, libvpx.dylib)
+EXPORT_FILE             := libaom.syms
+LIBAOM_SO_SYMLINKS      := $(addprefix $(LIBSUBDIR)/, libaom.dylib)
 else
 ifeq ($(filter os2%,$(TGT_OS)),$(TGT_OS))
-LIBVPX_SO               := libvpx$(SO_VERSION_MAJOR).dll
+LIBAOM_SO               := libaom$(SO_VERSION_MAJOR).dll
 SHARED_LIB_SUF          := _dll.a
-EXPORT_FILE             := libvpx.def
-LIBVPX_SO_SYMLINKS      :=
-LIBVPX_SO_IMPLIB        := libvpx_dll.a
+EXPORT_FILE             := libaom.def
+LIBAOM_SO_SYMLINKS      :=
+LIBAOM_SO_IMPLIB        := libaom_dll.a
 else
-LIBVPX_SO               := libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH)
+LIBAOM_SO               := libaom.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH)
 SHARED_LIB_SUF          := .so
-EXPORT_FILE             := libvpx.ver
-LIBVPX_SO_SYMLINKS      := $(addprefix $(LIBSUBDIR)/, \
-                             libvpx.so libvpx.so.$(SO_VERSION_MAJOR) \
-                             libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR))
+EXPORT_FILE             := libaom.ver
+LIBAOM_SO_SYMLINKS      := $(addprefix $(LIBSUBDIR)/, \
+                             libaom.so libaom.so.$(SO_VERSION_MAJOR) \
+                             libaom.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR))
 endif
 endif
 endif
 
-LIBS-$(CONFIG_SHARED) += $(BUILD_PFX)$(LIBVPX_SO)\
-                           $(notdir $(LIBVPX_SO_SYMLINKS)) \
-                           $(if $(LIBVPX_SO_IMPLIB), $(BUILD_PFX)$(LIBVPX_SO_IMPLIB))
-$(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) $(EXPORT_FILE)
-$(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm
-$(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(SO_VERSION_MAJOR)
-$(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE)
+LIBS-$(CONFIG_SHARED) += $(BUILD_PFX)$(LIBAOM_SO)\
+                           $(notdir $(LIBAOM_SO_SYMLINKS)) \
+                           $(if $(LIBAOM_SO_IMPLIB), $(BUILD_PFX)$(LIBAOM_SO_IMPLIB))
+$(BUILD_PFX)$(LIBAOM_SO): $(LIBAOM_OBJS) $(EXPORT_FILE)
+$(BUILD_PFX)$(LIBAOM_SO): extralibs += -lm
+$(BUILD_PFX)$(LIBAOM_SO): SONAME = libaom.so.$(SO_VERSION_MAJOR)
+$(BUILD_PFX)$(LIBAOM_SO): EXPORTS_FILE = $(EXPORT_FILE)
 
-libvpx.ver: $(call enabled,CODEC_EXPORTS)
+libaom.ver: $(call enabled,CODEC_EXPORTS)
 	@echo "    [CREATE] $@"
 	$(qexec)echo "{ global:" > $@
 	$(qexec)for f in $?; do awk '{print $$2";"}' < $$f >>$@; done
 	$(qexec)echo "local: *; };" >> $@
-CLEAN-OBJS += libvpx.ver
+CLEAN-OBJS += libaom.ver
 
-libvpx.syms: $(call enabled,CODEC_EXPORTS)
+libaom.syms: $(call enabled,CODEC_EXPORTS)
 	@echo "    [CREATE] $@"
 	$(qexec)awk '{print "_"$$2}' $^ >$@
-CLEAN-OBJS += libvpx.syms
+CLEAN-OBJS += libaom.syms
 
-libvpx.def: $(call enabled,CODEC_EXPORTS)
+libaom.def: $(call enabled,CODEC_EXPORTS)
 	@echo "    [CREATE] $@"
-	$(qexec)echo LIBRARY $(LIBVPX_SO:.dll=) INITINSTANCE TERMINSTANCE > $@
+	$(qexec)echo LIBRARY $(LIBAOM_SO:.dll=) INITINSTANCE TERMINSTANCE > $@
 	$(qexec)echo "DATA MULTIPLE NONSHARED" >> $@
 	$(qexec)echo "EXPORTS" >> $@
 	$(qexec)awk '{print "_"$$2}' $^ >>$@
-CLEAN-OBJS += libvpx.def
+CLEAN-OBJS += libaom.def
 
-libvpx_dll.a: $(LIBVPX_SO)
+libaom_dll.a: $(LIBAOM_SO)
 	@echo "    [IMPLIB] $@"
 	$(qexec)emximp -o $@ $<
-CLEAN-OBJS += libvpx_dll.a
+CLEAN-OBJS += libaom_dll.a
 
-define libvpx_symlink_template
+define libaom_symlink_template
 $(1): $(2)
 	@echo "    [LN]     $(2) $$@"
 	$(qexec)mkdir -p $$(dir $$@)
 	$(qexec)ln -sf $(2) $$@
 endef
 
-$(eval $(call libvpx_symlink_template,\
-    $(addprefix $(BUILD_PFX),$(notdir $(LIBVPX_SO_SYMLINKS))),\
-    $(BUILD_PFX)$(LIBVPX_SO)))
-$(eval $(call libvpx_symlink_template,\
-    $(addprefix $(DIST_DIR)/,$(LIBVPX_SO_SYMLINKS)),\
-    $(LIBVPX_SO)))
+$(eval $(call libaom_symlink_template,\
+    $(addprefix $(BUILD_PFX),$(notdir $(LIBAOM_SO_SYMLINKS))),\
+    $(BUILD_PFX)$(LIBAOM_SO)))
+$(eval $(call libaom_symlink_template,\
+    $(addprefix $(DIST_DIR)/,$(LIBAOM_SO_SYMLINKS)),\
+    $(LIBAOM_SO)))
 
 
-INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBVPX_SO_SYMLINKS)
-INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBSUBDIR)/$(LIBVPX_SO)
-INSTALL-LIBS-$(CONFIG_SHARED) += $(if $(LIBVPX_SO_IMPLIB),$(LIBSUBDIR)/$(LIBVPX_SO_IMPLIB))
+INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBAOM_SO_SYMLINKS)
+INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBSUBDIR)/$(LIBAOM_SO)
+INSTALL-LIBS-$(CONFIG_SHARED) += $(if $(LIBAOM_SO_IMPLIB),$(LIBSUBDIR)/$(LIBAOM_SO_IMPLIB))
 
 
 LIBS-yes += vpx.pc
 vpx.pc: config.mk libs.mk
 	@echo "    [CREATE] $@"
-	$(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@
+	$(qexec)echo '# pkg-config file from libaom $(VERSION_STRING)' > $@
 	$(qexec)echo 'prefix=$(PREFIX)' >> $@
 	$(qexec)echo 'exec_prefix=$${prefix}' >> $@
 	$(qexec)echo 'libdir=$${prefix}/$(LIBSUBDIR)' >> $@
@@ -303,7 +303,7 @@
 	$(qexec)echo 'Version: $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)' >> $@
 	$(qexec)echo 'Requires:' >> $@
 	$(qexec)echo 'Conflicts:' >> $@
-	$(qexec)echo 'Libs: -L$${libdir} -lvpx -lm' >> $@
+	$(qexec)echo 'Libs: -L$${libdir} -laom -lm' >> $@
 ifeq ($(HAVE_PTHREAD_H),yes)
 	$(qexec)echo 'Libs.private: -lm -lpthread' >> $@
 else
@@ -352,40 +352,40 @@
 endif
 
 ##
-## libvpx test directives
+## libaom test directives
 ##
 ifeq ($(CONFIG_UNIT_TESTS),yes)
 LIBVPX_TEST_DATA_PATH ?= .
 
 include $(SRC_PATH_BARE)/test/test.mk
-LIBVPX_TEST_SRCS=$(addprefix test/,$(call enabled,LIBVPX_TEST_SRCS))
-LIBVPX_TEST_BIN=./test_libvpx$(EXE_SFX)
-LIBVPX_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\
-                     $(call enabled,LIBVPX_TEST_DATA))
-libvpx_test_data_url=http://downloads.webmproject.org/test_data/libvpx/$(1)
+LIBAOM_TEST_SRCS=$(addprefix test/,$(call enabled,LIBAOM_TEST_SRCS))
+LIBAOM_TEST_BIN=./test_libvpx$(EXE_SFX)
+LIBAOM_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\
+                     $(call enabled,LIBAOM_TEST_DATA))
+libaom_test_data_url=http://downloads.webmproject.org/test_data/libvpx/$(1)
 
 TEST_INTRA_PRED_SPEED_BIN=./test_intra_pred_speed$(EXE_SFX)
 TEST_INTRA_PRED_SPEED_SRCS=$(addprefix test/,$(call enabled,TEST_INTRA_PRED_SPEED_SRCS))
 TEST_INTRA_PRED_SPEED_OBJS := $(sort $(call objs,$(TEST_INTRA_PRED_SPEED_SRCS)))
 
-libvpx_test_srcs.txt:
+libaom_test_srcs.txt:
 	@echo "    [CREATE] $@"
-	@echo $(LIBVPX_TEST_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@
-CLEAN-OBJS += libvpx_test_srcs.txt
+	@echo $(LIBAOM_TEST_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@
+CLEAN-OBJS += libaom_test_srcs.txt
 
-$(LIBVPX_TEST_DATA): $(SRC_PATH_BARE)/test/test-data.sha1
+$(LIBAOM_TEST_DATA): $(SRC_PATH_BARE)/test/test-data.sha1
 	@echo "    [DOWNLOAD] $@"
 	$(qexec)trap 'rm -f $@' INT TERM &&\
-            curl -L -o $@ $(call libvpx_test_data_url,$(@F))
+            curl -L -o $@ $(call libaom_test_data_url,$(@F))
 
-testdata:: $(LIBVPX_TEST_DATA)
+testdata:: $(LIBAOM_TEST_DATA)
 	$(qexec)[ -x "$$(which sha1sum)" ] && sha1sum=sha1sum;\
           [ -x "$$(which shasum)" ] && sha1sum=shasum;\
           [ -x "$$(which sha1)" ] && sha1sum=sha1;\
           if [ -n "$${sha1sum}" ]; then\
             set -e;\
             echo "Checking test data:";\
-            for f in $(call enabled,LIBVPX_TEST_DATA); do\
+            for f in $(call enabled,LIBAOM_TEST_DATA); do\
                 grep $$f $(SRC_PATH_BARE)/test/test-data.sha1 |\
                     (cd $(LIBVPX_TEST_DATA_PATH); $${sha1sum} -c);\
             done; \
@@ -412,7 +412,7 @@
 
 PROJECTS-$(CONFIG_MSVS) += gtest.$(VCPROJ_SFX)
 
-test_libvpx.$(VCPROJ_SFX): $(LIBVPX_TEST_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_SFX)
+test_libvpx.$(VCPROJ_SFX): $(LIBAOM_TEST_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_SFX)
 	@echo "    [CREATE] $@"
 	$(qexec)$(GEN_VCPROJ) \
             --exe \
@@ -430,7 +430,7 @@
 
 PROJECTS-$(CONFIG_MSVS) += test_libvpx.$(VCPROJ_SFX)
 
-LIBVPX_TEST_BIN := $(addprefix $(TGT_OS:win64=x64)/Release/,$(notdir $(LIBVPX_TEST_BIN)))
+LIBAOM_TEST_BIN := $(addprefix $(TGT_OS:win64=x64)/Release/,$(notdir $(LIBAOM_TEST_BIN)))
 
 ifneq ($(strip $(TEST_INTRA_PRED_SPEED_OBJS)),)
 PROJECTS-$(CONFIG_MSVS) += test_intra_pred_speed.$(VCPROJ_SFX)
@@ -466,18 +466,18 @@
 LIBS-yes += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a
 $(BUILD_PFX)libgtest_g.a: $(GTEST_OBJS)
 
-LIBVPX_TEST_OBJS=$(sort $(call objs,$(LIBVPX_TEST_SRCS)))
-$(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES)
-OBJS-yes += $(LIBVPX_TEST_OBJS)
-BINS-yes += $(LIBVPX_TEST_BIN)
+LIBAOM_TEST_OBJS=$(sort $(call objs,$(LIBAOM_TEST_SRCS)))
+$(LIBAOM_TEST_OBJS) $(LIBAOM_TEST_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES)
+OBJS-yes += $(LIBAOM_TEST_OBJS)
+BINS-yes += $(LIBAOM_TEST_BIN)
 
-CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
+CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),aom_g,aom)
 CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
 TEST_LIBS := lib$(CODEC_LIB)$(CODEC_LIB_SUF) libgtest.a
-$(LIBVPX_TEST_BIN): $(TEST_LIBS)
-$(eval $(call linkerxx_template,$(LIBVPX_TEST_BIN), \
-              $(LIBVPX_TEST_OBJS) \
-              -L. -lvpx -lgtest $(extralibs) -lm))
+$(LIBAOM_TEST_BIN): $(TEST_LIBS)
+$(eval $(call linkerxx_template,$(LIBAOM_TEST_BIN), \
+              $(LIBAOM_TEST_OBJS) \
+              -L. -laom -lgtest $(extralibs) -lm))
 
 ifneq ($(strip $(TEST_INTRA_PRED_SPEED_OBJS)),)
 $(TEST_INTRA_PRED_SPEED_OBJS) $(TEST_INTRA_PRED_SPEED_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES)
@@ -487,7 +487,7 @@
 $(TEST_INTRA_PRED_SPEED_BIN): $(TEST_LIBS)
 $(eval $(call linkerxx_template,$(TEST_INTRA_PRED_SPEED_BIN), \
               $(TEST_INTRA_PRED_SPEED_OBJS) \
-              -L. -lvpx -lgtest $(extralibs) -lm))
+              -L. -laom -lgtest $(extralibs) -lm))
 endif  # TEST_INTRA_PRED_SPEED
 
 endif  # CONFIG_UNIT_TESTS
@@ -495,17 +495,17 @@
 # Install test sources only if codec source is included
 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\
     $(shell find $(SRC_PATH_BARE)/third_party/googletest -type f))
-INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBVPX_TEST_SRCS)
+INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBAOM_TEST_SRCS)
 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(TEST_INTRA_PRED_SPEED_SRCS)
 
 define test_shard_template
 test:: test_shard.$(1)
 test-no-data-check:: test_shard_ndc.$(1)
-test_shard.$(1) test_shard_ndc.$(1): $(LIBVPX_TEST_BIN)
+test_shard.$(1) test_shard_ndc.$(1): $(LIBAOM_TEST_BIN)
 	@set -e; \
 	 export GTEST_SHARD_INDEX=$(1); \
 	 export GTEST_TOTAL_SHARDS=$(2); \
-	 $(LIBVPX_TEST_BIN)
+	 $(LIBAOM_TEST_BIN)
 test_shard.$(1): testdata
 .PHONY: test_shard.$(1)
 endef
@@ -536,7 +536,7 @@
 endif
 
 ## Update the global src list
-SRCS += $(CODEC_SRCS) $(LIBVPX_TEST_SRCS) $(GTEST_SRCS)
+SRCS += $(CODEC_SRCS) $(LIBAOM_TEST_SRCS) $(GTEST_SRCS)
 
 ##
 ## vpxdec/vpxenc tests.
diff --git a/rate_hist.h b/rate_hist.h
index 00a1676..df49411 100644
--- a/rate_hist.h
+++ b/rate_hist.h
@@ -11,7 +11,7 @@
 #ifndef RATE_HIST_H_
 #define RATE_HIST_H_
 
-#include "vpx/vpx_encoder.h"
+#include "aom/vpx_encoder.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/solution.mk b/solution.mk
index 145adc0..8d3531e 100644
--- a/solution.mk
+++ b/solution.mk
@@ -8,7 +8,7 @@
 ##  be found in the AUTHORS file in the root of the source tree.
 ##
 
-# libvpx reverse dependencies (targets that depend on libvpx)
+# libaom reverse dependencies (targets that depend on libaom)
 VPX_NONDEPS=$(addsuffix .$(VCPROJ_SFX),vpx gtest)
 VPX_RDEPS=$(foreach vcp,\
               $(filter-out $(VPX_NONDEPS),$^), --dep=$(vcp:.$(VCPROJ_SFX)=):vpx)
diff --git a/test/acm_random.h b/test/acm_random.h
index eae2cf9..aec4c6b 100644
--- a/test/acm_random.h
+++ b/test/acm_random.h
@@ -13,9 +13,9 @@
 
 #include "third_party/googletest/src/include/gtest/gtest.h"
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 
 class ACMRandom {
  public:
@@ -65,6 +65,6 @@
   testing::internal::Random random_;
 };
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #endif  // TEST_ACM_RANDOM_H_
diff --git a/test/active_map_refresh_test.cc b/test/active_map_refresh_test.cc
index 4e69f52..994d474 100644
--- a/test/active_map_refresh_test.cc
+++ b/test/active_map_refresh_test.cc
@@ -57,8 +57,8 @@
 const int kAqModeCyclicRefresh = 3;
 
 class ActiveMapRefreshTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> {
  protected:
   ActiveMapRefreshTest() : EncoderTest(GET_PARAM(0)) {}
   virtual ~ActiveMapRefreshTest() {}
@@ -69,10 +69,10 @@
     cpu_used_ = GET_PARAM(2);
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
-    ::libvpx_test::Y4mVideoSource *y4m_video =
-        static_cast<libvpx_test::Y4mVideoSource *>(video);
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
+    ::libaom_test::Y4mVideoSource *y4m_video =
+        static_cast<libaom_test::Y4mVideoSource *>(video);
     if (video->frame() == 1) {
       encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
       encoder->Control(VP9E_SET_AQ_MODE, kAqModeCyclicRefresh);
@@ -99,7 +99,7 @@
   }
 
   int cpu_used_;
-  ::libvpx_test::Y4mVideoSource *y4m_holder_;
+  ::libaom_test::Y4mVideoSource *y4m_holder_;
 };
 
 TEST_P(ActiveMapRefreshTest, Test) {
@@ -114,12 +114,12 @@
   cfg_.kf_max_dist = 90000;
 
 #if CONFIG_VP10
-  const int nframes = codec_ == &libvpx_test::kVP10 ? 10 : 30;
+  const int nframes = codec_ == &libaom_test::kVP10 ? 10 : 30;
 #else
   const int nframes = 30;
 #endif  // CONFIG_VP10
-  ::libvpx_test::Y4mVideoSource video("desktop_credits.y4m", 0, nframes);
-  ::libvpx_test::Y4mVideoSource video_holder("desktop_credits.y4m", 0, nframes);
+  ::libaom_test::Y4mVideoSource video("desktop_credits.y4m", 0, nframes);
+  ::libaom_test::Y4mVideoSource video_holder("desktop_credits.y4m", 0, nframes);
   video_holder.Begin();
   y4m_holder_ = &video_holder;
 
@@ -128,7 +128,7 @@
 
 #if CONFIG_VP10
 VP10_INSTANTIATE_TEST_CASE(ActiveMapRefreshTest,
-                           ::testing::Values(::libvpx_test::kRealTime),
+                           ::testing::Values(::libaom_test::kRealTime),
                            ::testing::Range(5, 6));
 #endif  // CONFIG_VP10
 }  // namespace
diff --git a/test/active_map_test.cc b/test/active_map_test.cc
index cdf8f0b..35da706 100644
--- a/test/active_map_test.cc
+++ b/test/active_map_test.cc
@@ -18,8 +18,8 @@
 namespace {
 
 class ActiveMapTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> {
  protected:
   static const int kWidth = 208;
   static const int kHeight = 144;
@@ -33,8 +33,8 @@
     cpu_used_ = GET_PARAM(2);
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 1) {
       encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
     } else if (video->frame() == 3) {
@@ -75,7 +75,7 @@
     cfg_.g_pass = VPX_RC_ONE_PASS;
     cfg_.rc_end_usage = VPX_CBR;
     cfg_.kf_max_dist = 90000;
-    ::libvpx_test::I420VideoSource video("hantro_odd.yuv", kWidth, kHeight, 30,
+    ::libaom_test::I420VideoSource video("hantro_odd.yuv", kWidth, kHeight, 30,
                                          1, 0, 20);
 
     ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
@@ -91,11 +91,11 @@
 TEST_P(ActiveMapTestLarge, Test) { DoTest(); }
 
 VP10_INSTANTIATE_TEST_CASE(ActiveMapTestLarge,
-                           ::testing::Values(::libvpx_test::kRealTime),
+                           ::testing::Values(::libaom_test::kRealTime),
                            ::testing::Range(0, 5));
 
 VP10_INSTANTIATE_TEST_CASE(ActiveMapTest,
-                           ::testing::Values(::libvpx_test::kRealTime),
+                           ::testing::Values(::libaom_test::kRealTime),
                            ::testing::Range(5, 9));
 
 }  // namespace
diff --git a/test/add_noise_test.cc b/test/add_noise_test.cc
index 4eff8b9..62f14b4 100644
--- a/test/add_noise_test.cc
+++ b/test/add_noise_test.cc
@@ -12,9 +12,9 @@
 #include "test/register_state_check.h"
 #include "third_party/googletest/src/include/gtest/gtest.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/postproc.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/postproc.h"
+#include "aom_mem/vpx_mem.h"
 
 namespace {
 
@@ -26,7 +26,7 @@
 
 class AddNoiseTest : public ::testing::TestWithParam<AddNoiseFunc> {
  public:
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
   virtual ~AddNoiseTest() {}
 };
 
diff --git a/test/altref_test.cc b/test/altref_test.cc
index 8c7dee4..2592914 100644
--- a/test/altref_test.cc
+++ b/test/altref_test.cc
@@ -15,8 +15,8 @@
 namespace {
 
 class AltRefForcedKeyTestLarge
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> {
  protected:
   AltRefForcedKeyTestLarge()
       : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
@@ -30,14 +30,14 @@
     cfg_.g_threads = 0;
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 0) {
       encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
       encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
 #if CONFIG_VP10_ENCODER
       // override test default for tile columns if necessary.
-      if (GET_PARAM(0) == &libvpx_test::kVP10) {
+      if (GET_PARAM(0) == &libaom_test::kVP10) {
         encoder->Control(VP9E_SET_TILE_COLUMNS, 6);
       }
 #endif
@@ -54,7 +54,7 @@
     ++frame_num_;
   }
 
-  ::libvpx_test::TestMode encoding_mode_;
+  ::libaom_test::TestMode encoding_mode_;
   int cpu_used_;
   unsigned int forced_kf_frame_num_;
   unsigned int frame_num_;
@@ -68,7 +68,7 @@
   for (int i = 0; lag_values[i] != -1; ++i) {
     frame_num_ = 0;
     cfg_.g_lag_in_frames = lag_values[i];
-    libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+    libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                        timebase.den, timebase.num, 0, 30);
     ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
   }
@@ -82,14 +82,14 @@
     frame_num_ = 0;
     forced_kf_frame_num_ = lag_values[i] - 1;
     cfg_.g_lag_in_frames = lag_values[i];
-    libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+    libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                        timebase.den, timebase.num, 0, 30);
     ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
   }
 }
 
 VP10_INSTANTIATE_TEST_CASE(AltRefForcedKeyTestLarge,
-                           ::testing::Values(::libvpx_test::kOnePassGood),
+                           ::testing::Values(::libaom_test::kOnePassGood),
                            ::testing::Range(0, 9));
 
 }  // namespace
diff --git a/test/android/Android.mk b/test/android/Android.mk
index 48872a2..4f0565a 100644
--- a/test/android/Android.mk
+++ b/test/android/Android.mk
@@ -8,7 +8,7 @@
 #
 # This make file builds vpx_test app for android.
 # The test app itself runs on the command line through adb shell
-# The paths are really messed up as the libvpx make file
+# The paths are really messed up as the libaom make file
 # expects to be made from a parent directory.
 CUR_WD := $(call my-dir)
 BINDINGS_DIR := $(CUR_WD)/../../..
@@ -16,13 +16,13 @@
 
 #libwebm
 include $(CLEAR_VARS)
-include $(BINDINGS_DIR)/libvpx/third_party/libwebm/Android.mk
+include $(BINDINGS_DIR)/libaom/third_party/libwebm/Android.mk
 LOCAL_PATH := $(CUR_WD)/../../..
 
-#libvpx
+#libaom
 include $(CLEAR_VARS)
 LOCAL_STATIC_LIBRARIES := libwebm
-include $(BINDINGS_DIR)/libvpx/build/make/Android.mk
+include $(BINDINGS_DIR)/libaom/build/make/Android.mk
 LOCAL_PATH := $(CUR_WD)/../..
 
 #libgtest
@@ -35,10 +35,10 @@
 LOCAL_SRC_FILES := ./third_party/googletest/src/src/gtest-all.cc
 include $(BUILD_STATIC_LIBRARY)
 
-#libvpx_test
+#libaom_test
 include $(CLEAR_VARS)
 LOCAL_ARM_MODE := arm
-LOCAL_MODULE := libvpx_test
+LOCAL_MODULE := libaom_test
 LOCAL_STATIC_LIBRARIES := gtest libwebm
 
 ifeq ($(ENABLE_SHARED),1)
@@ -49,7 +49,7 @@
 
 include $(LOCAL_PATH)/test/test.mk
 LOCAL_C_INCLUDES := $(BINDINGS_DIR)
-FILTERED_SRC := $(sort $(filter %.cc %.c, $(LIBVPX_TEST_SRCS-yes)))
+FILTERED_SRC := $(sort $(filter %.cc %.c, $(LIBAOM_TEST_SRCS-yes)))
 LOCAL_SRC_FILES := $(addprefix ./test/, $(FILTERED_SRC))
 # some test files depend on *_rtcd.h, ensure they're generated first.
 $(eval $(call rtcd_dep_template))
diff --git a/test/android/README b/test/android/README
index 4a1adcf..e5b25d5 100644
--- a/test/android/README
+++ b/test/android/README
@@ -1,12 +1,12 @@
 Android.mk will build vpx unittests on android.
-1) Configure libvpx from the parent directory:
-./libvpx/configure --target=armv7-android-gcc --enable-external-build \
+1) Configure libaom from the parent directory:
+./libaom/configure --target=armv7-android-gcc --enable-external-build \
   --enable-postproc --disable-install-srcs --enable-multi-res-encoding \
   --enable-temporal-denoising --disable-unit-tests --disable-install-docs \
   --disable-examples --disable-runtime-cpu-detect --sdk-path=$NDK
 
 2) From the parent directory, invoke ndk-build:
-NDK_PROJECT_PATH=. ndk-build APP_BUILD_SCRIPT=./libvpx/test/android/Android.mk \
+NDK_PROJECT_PATH=. ndk-build APP_BUILD_SCRIPT=./libaom/test/android/Android.mk \
   APP_ABI=armeabi-v7a APP_PLATFORM=android-18 APP_OPTIM=release \
   APP_STL=gnustl_static
 
@@ -15,7 +15,7 @@
 
 3) Run get_files.py to download the test files:
 python get_files.py -i /path/to/test-data.sha1 -o /path/to/put/files \
-  -u http://downloads.webmproject.org/test_data/libvpx
+  -u http://downloads.webmproject.org/test_data/libaom
 
 4) Transfer files to device using adb. Ensure you have proper permissions for
 the target
diff --git a/test/android/scrape_gtest_log.py b/test/android/scrape_gtest_log.py
index 487845c..44cdcc4 100644
--- a/test/android/scrape_gtest_log.py
+++ b/test/android/scrape_gtest_log.py
@@ -8,7 +8,7 @@
 
 """Standalone script which parses a gtest log for json.
 
-Json is returned returns as an array.  This script is used by the libvpx
+Json is returned returns as an array.  This script is used by the libaom
 waterfall to gather json results mixed in with gtest logs.  This is
 dubious software engineering.
 """
diff --git a/test/aq_segment_test.cc b/test/aq_segment_test.cc
index 396a4fa..bd4e51e 100644
--- a/test/aq_segment_test.cc
+++ b/test/aq_segment_test.cc
@@ -16,8 +16,8 @@
 namespace {
 
 class AqSegmentTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> {
  protected:
   AqSegmentTest() : EncoderTest(GET_PARAM(0)) {}
   virtual ~AqSegmentTest() {}
@@ -29,8 +29,8 @@
     aq_mode_ = 0;
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 1) {
       encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
       encoder->Control(VP9E_SET_AQ_MODE, aq_mode_);
@@ -49,7 +49,7 @@
     cfg_.rc_buf_optimal_sz = 500;
     cfg_.rc_buf_sz = 1000;
     cfg_.rc_target_bitrate = 300;
-    ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352,
+    ::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352,
                                          288, 30, 1, 0, 15);
     ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
   }
@@ -79,11 +79,11 @@
 TEST_P(AqSegmentTestLarge, TestNoMisMatchAQ3) { DoTest(3); }
 
 VP10_INSTANTIATE_TEST_CASE(AqSegmentTest,
-                           ::testing::Values(::libvpx_test::kRealTime,
-                                             ::libvpx_test::kOnePassGood),
+                           ::testing::Values(::libaom_test::kRealTime,
+                                             ::libaom_test::kOnePassGood),
                            ::testing::Range(5, 9));
 VP10_INSTANTIATE_TEST_CASE(AqSegmentTestLarge,
-                           ::testing::Values(::libvpx_test::kRealTime,
-                                             ::libvpx_test::kOnePassGood),
+                           ::testing::Values(::libaom_test::kRealTime,
+                                             ::libaom_test::kOnePassGood),
                            ::testing::Range(3, 5));
 }  // namespace
diff --git a/test/arf_freq_test.cc b/test/arf_freq_test.cc
index 9c00ded..83a0337 100644
--- a/test/arf_freq_test.cc
+++ b/test/arf_freq_test.cc
@@ -15,7 +15,7 @@
 #include "test/util.h"
 #include "test/y4m_video_source.h"
 #include "test/yuv_video_source.h"
-#include "vp10/encoder/ratectrl.h"
+#include "av1/encoder/ratectrl.h"
 
 namespace {
 
@@ -38,7 +38,7 @@
 } TestVideoParam;
 
 typedef struct {
-  libvpx_test::TestMode mode;
+  libaom_test::TestMode mode;
   int cpu_used;
 } TestEncodeParam;
 
@@ -55,9 +55,9 @@
 };
 
 const TestEncodeParam kEncodeVectors[] = {
-  { ::libvpx_test::kOnePassGood, 2 }, { ::libvpx_test::kOnePassGood, 5 },
-  { ::libvpx_test::kTwoPassGood, 1 }, { ::libvpx_test::kTwoPassGood, 2 },
-  { ::libvpx_test::kTwoPassGood, 5 }, { ::libvpx_test::kRealTime, 5 },
+  { ::libaom_test::kOnePassGood, 2 }, { ::libaom_test::kOnePassGood, 5 },
+  { ::libaom_test::kTwoPassGood, 1 }, { ::libaom_test::kTwoPassGood, 2 },
+  { ::libaom_test::kTwoPassGood, 5 }, { ::libaom_test::kRealTime, 5 },
 };
 
 const int kMinArfVectors[] = {
@@ -75,8 +75,8 @@
 }
 
 class ArfFreqTestLarge
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith3Params<TestVideoParam,
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith3Params<TestVideoParam,
                                                  TestEncodeParam, int> {
  protected:
   ArfFreqTestLarge()
@@ -88,7 +88,7 @@
   virtual void SetUp() {
     InitializeConfig();
     SetMode(test_encode_param_.mode);
-    if (test_encode_param_.mode != ::libvpx_test::kRealTime) {
+    if (test_encode_param_.mode != ::libaom_test::kRealTime) {
       cfg_.g_lag_in_frames = 25;
       cfg_.rc_end_usage = VPX_VBR;
     } else {
@@ -142,14 +142,14 @@
     }
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 0) {
       encoder->Control(VP9E_SET_FRAME_PARALLEL_DECODING, 1);
       encoder->Control(VP9E_SET_TILE_COLUMNS, 4);
       encoder->Control(VP8E_SET_CPUUSED, test_encode_param_.cpu_used);
       encoder->Control(VP9E_SET_MIN_GF_INTERVAL, min_arf_requested_);
-      if (test_encode_param_.mode != ::libvpx_test::kRealTime) {
+      if (test_encode_param_.mode != ::libaom_test::kRealTime) {
         encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
         encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
         encoder->Control(VP8E_SET_ARNR_STRENGTH, 5);
@@ -188,12 +188,12 @@
   init_flags_ = VPX_CODEC_USE_PSNR;
   if (cfg_.g_bit_depth > 8) init_flags_ |= VPX_CODEC_USE_HIGHBITDEPTH;
 
-  testing::internal::scoped_ptr<libvpx_test::VideoSource> video;
+  testing::internal::scoped_ptr<libaom_test::VideoSource> video;
   if (is_extension_y4m(test_video_param_.filename)) {
-    video.reset(new libvpx_test::Y4mVideoSource(test_video_param_.filename, 0,
+    video.reset(new libaom_test::Y4mVideoSource(test_video_param_.filename, 0,
                                                 kFrames));
   } else {
-    video.reset(new libvpx_test::YUVVideoSource(
+    video.reset(new libaom_test::YUVVideoSource(
         test_video_param_.filename, test_video_param_.fmt,
         test_video_param_.width, test_video_param_.height,
         test_video_param_.framerate_num, test_video_param_.framerate_den, 0,
@@ -219,8 +219,8 @@
 INSTANTIATE_TEST_CASE_P(
     DISABLED_VP10, ArfFreqTestLarge,
     ::testing::Combine(
-        ::testing::Values(static_cast<const libvpx_test::CodecFactory *>(
-            &libvpx_test::kVP10)),
+        ::testing::Values(static_cast<const libaom_test::CodecFactory *>(
+            &libaom_test::kVP10)),
         ::testing::ValuesIn(kTestVectors), ::testing::ValuesIn(kEncodeVectors),
         ::testing::ValuesIn(kMinArfVectors)));
 #endif  // CONFIG_VP10_ENCODER
diff --git a/test/avg_test.cc b/test/avg_test.cc
index 4a5d325..eb3e8b1 100644
--- a/test/avg_test.cc
+++ b/test/avg_test.cc
@@ -21,9 +21,9 @@
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom_mem/vpx_mem.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 class AverageTestBase : public ::testing::Test {
@@ -40,7 +40,7 @@
     source_data_ = NULL;
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   // Handle blocks up to 4 blocks 64x64 with stride up to 128
@@ -199,7 +199,7 @@
   }
 
   virtual void TearDown() {
-    libvpx_test::ClearSystemState();
+    libaom_test::ClearSystemState();
     vpx_free(src_);
   }
 
diff --git a/test/blend_a64_mask_1d_test.cc b/test/blend_a64_mask_1d_test.cc
index 4377e65..c5c5929 100644
--- a/test/blend_a64_mask_1d_test.cc
+++ b/test/blend_a64_mask_1d_test.cc
@@ -19,15 +19,15 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #include "./vp10_rtcd.h"
 
-#include "vp10/common/enums.h"
+#include "av1/common/enums.h"
 
-#include "vpx_dsp/blend.h"
+#include "aom_dsp/blend.h"
 
-using libvpx_test::FunctionEquivalenceTest;
+using libaom_test::FunctionEquivalenceTest;
 
 namespace {
 
@@ -117,7 +117,7 @@
 typedef void (*F8B)(uint8_t *dst, uint32_t dst_stride, const uint8_t *src0,
                     uint32_t src0_stride, const uint8_t *src1,
                     uint32_t src1_stride, const uint8_t *mask, int h, int w);
-typedef libvpx_test::FuncParam<F8B> TestFuncs;
+typedef libaom_test::FuncParam<F8B> TestFuncs;
 
 class BlendA64Mask1DTest8B : public BlendA64Mask1DTest<F8B, uint8_t> {
  protected:
@@ -216,7 +216,7 @@
                      uint32_t src0_stride, const uint8_t *src1,
                      uint32_t src1_stride, const uint8_t *mask, int h, int w,
                      int bd);
-typedef libvpx_test::FuncParam<FHBD> TestFuncsHBD;
+typedef libaom_test::FuncParam<FHBD> TestFuncsHBD;
 
 class BlendA64Mask1DTestHBD : public BlendA64Mask1DTest<FHBD, uint16_t> {
  protected:
diff --git a/test/blend_a64_mask_test.cc b/test/blend_a64_mask_test.cc
index 7ea798a..3fe6112 100644
--- a/test/blend_a64_mask_test.cc
+++ b/test/blend_a64_mask_test.cc
@@ -19,15 +19,15 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #include "./vp10_rtcd.h"
 
-#include "vp10/common/enums.h"
+#include "av1/common/enums.h"
 
-#include "vpx_dsp/blend.h"
+#include "aom_dsp/blend.h"
 
-using libvpx_test::FunctionEquivalenceTest;
+using libaom_test::FunctionEquivalenceTest;
 
 namespace {
 
@@ -128,7 +128,7 @@
                     uint32_t src0_stride, const uint8_t *src1,
                     uint32_t src1_stride, const uint8_t *mask,
                     uint32_t mask_stride, int h, int w, int suby, int subx);
-typedef libvpx_test::FuncParam<F8B> TestFuncs;
+typedef libaom_test::FuncParam<F8B> TestFuncs;
 
 class BlendA64MaskTest8B : public BlendA64MaskTest<F8B, uint8_t> {
  protected:
@@ -192,7 +192,7 @@
                      uint32_t src1_stride, const uint8_t *mask,
                      uint32_t mask_stride, int h, int w, int suby, int subx,
                      int bd);
-typedef libvpx_test::FuncParam<FHBD> TestFuncsHBD;
+typedef libaom_test::FuncParam<FHBD> TestFuncsHBD;
 
 class BlendA64MaskTestHBD : public BlendA64MaskTest<FHBD, uint16_t> {
  protected:
diff --git a/test/boolcoder_test.cc b/test/boolcoder_test.cc
index 5dbfd5c..949907b 100644
--- a/test/boolcoder_test.cc
+++ b/test/boolcoder_test.cc
@@ -15,11 +15,11 @@
 #include "third_party/googletest/src/include/gtest/gtest.h"
 
 #include "test/acm_random.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/bitreader.h"
-#include "vpx_dsp/bitwriter.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/bitreader.h"
+#include "aom_dsp/bitwriter.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 const int num_tests = 10;
diff --git a/test/borders_test.cc b/test/borders_test.cc
index 9057631..e631da5 100644
--- a/test/borders_test.cc
+++ b/test/borders_test.cc
@@ -18,8 +18,8 @@
 namespace {
 
 class BordersTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> {
  protected:
   BordersTest() : EncoderTest(GET_PARAM(0)) {}
   virtual ~BordersTest() {}
@@ -29,8 +29,8 @@
     SetMode(GET_PARAM(1));
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 1) {
       encoder->Control(VP8E_SET_CPUUSED, 1);
       encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
@@ -57,7 +57,7 @@
   cfg_.rc_target_bitrate = 2000;
   cfg_.rc_max_quantizer = 10;
 
-  ::libvpx_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
+  ::libaom_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
                                        40);
 
   ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
@@ -73,12 +73,12 @@
   cfg_.rc_target_bitrate = 200;
   cfg_.rc_min_quantizer = 40;
 
-  ::libvpx_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
+  ::libaom_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
                                        40);
 
   ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 }
 
 VP10_INSTANTIATE_TEST_CASE(BordersTest,
-                           ::testing::Values(::libvpx_test::kTwoPassGood));
+                           ::testing::Values(::libaom_test::kTwoPassGood));
 }  // namespace
diff --git a/test/clear_system_state.h b/test/clear_system_state.h
index 044a5c7..b80cceb 100644
--- a/test/clear_system_state.h
+++ b/test/clear_system_state.h
@@ -12,10 +12,10 @@
 
 #include "./vpx_config.h"
 #if ARCH_X86 || ARCH_X86_64
-#include "vpx_ports/x86.h"
+#include "aom_ports/x86.h"
 #endif
 
-namespace libvpx_test {
+namespace libaom_test {
 
 // Reset system to a known state. This function should be used for all non-API
 // test cases.
@@ -25,5 +25,5 @@
 #endif
 }
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 #endif  // TEST_CLEAR_SYSTEM_STATE_H_
diff --git a/test/codec_factory.h b/test/codec_factory.h
index 6a8d0c8..abbf2e1 100644
--- a/test/codec_factory.h
+++ b/test/codec_factory.h
@@ -11,18 +11,18 @@
 #define TEST_CODEC_FACTORY_H_
 
 #include "./vpx_config.h"
-#include "vpx/vpx_decoder.h"
-#include "vpx/vpx_encoder.h"
+#include "aom/vpx_decoder.h"
+#include "aom/vpx_encoder.h"
 #if CONFIG_VP10_ENCODER
-#include "vpx/vp8cx.h"
+#include "aom/vp8cx.h"
 #endif
 #if CONFIG_VP10_DECODER
-#include "vpx/vp8dx.h"
+#include "aom/vp8dx.h"
 #endif
 
 #include "test/decode_test_driver.h"
 #include "test/encode_test_driver.h"
-namespace libvpx_test {
+namespace libaom_test {
 
 const int kCodecFactoryParam = 0;
 
@@ -56,17 +56,17 @@
 template <class T1>
 class CodecTestWithParam
     : public ::testing::TestWithParam<
-          std::tr1::tuple<const libvpx_test::CodecFactory *, T1> > {};
+          std::tr1::tuple<const libaom_test::CodecFactory *, T1> > {};
 
 template <class T1, class T2>
 class CodecTestWith2Params
     : public ::testing::TestWithParam<
-          std::tr1::tuple<const libvpx_test::CodecFactory *, T1, T2> > {};
+          std::tr1::tuple<const libaom_test::CodecFactory *, T1, T2> > {};
 
 template <class T1, class T2, class T3>
 class CodecTestWith3Params
     : public ::testing::TestWithParam<
-          std::tr1::tuple<const libvpx_test::CodecFactory *, T1, T2, T3> > {};
+          std::tr1::tuple<const libaom_test::CodecFactory *, T1, T2, T3> > {};
 
 /*
  * VP10 Codec Definitions
@@ -147,18 +147,18 @@
   }
 };
 
-const libvpx_test::VP10CodecFactory kVP10;
+const libaom_test::VP10CodecFactory kVP10;
 
 #define VP10_INSTANTIATE_TEST_CASE(test, ...)                               \
   INSTANTIATE_TEST_CASE_P(                                                  \
       VP10, test,                                                           \
       ::testing::Combine(                                                   \
-          ::testing::Values(static_cast<const libvpx_test::CodecFactory *>( \
-              &libvpx_test::kVP10)),                                        \
+          ::testing::Values(static_cast<const libaom_test::CodecFactory *>( \
+              &libaom_test::kVP10)),                                        \
           __VA_ARGS__))
 #else
 #define VP10_INSTANTIATE_TEST_CASE(test, ...)
 #endif  // CONFIG_VP10
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 #endif  // TEST_CODEC_FACTORY_H_
diff --git a/test/convolve_test.cc b/test/convolve_test.cc
index e3e75d1..910c4ec 100644
--- a/test/convolve_test.cc
+++ b/test/convolve_test.cc
@@ -18,10 +18,10 @@
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_dsp/vpx_filter.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_filter.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
 namespace {
 
@@ -311,7 +311,7 @@
 #endif
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
   static void TearDownTestCase() {
     vpx_free(input_ - 1);
@@ -369,7 +369,7 @@
         output_[i] = 0;
     }
 
-    ::libvpx_test::ACMRandom prng;
+    ::libaom_test::ACMRandom prng;
     for (int i = 0; i < kInputBufferSize; ++i) {
       if (i & 1) {
         input_[i] = 255;
@@ -729,7 +729,7 @@
 #endif
 
   // Populate ref and out with some random data
-  ::libvpx_test::ACMRandom prng;
+  ::libaom_test::ACMRandom prng;
   for (int y = 0; y < Height(); ++y) {
     for (int x = 0; x < Width(); ++x) {
       uint16_t r;
@@ -806,7 +806,7 @@
 #endif
 
   // Populate ref and out with some random data
-  ::libvpx_test::ACMRandom prng;
+  ::libaom_test::ACMRandom prng;
   for (int y = 0; y < Height(); ++y) {
     for (int x = 0; x < Width(); ++x) {
       uint16_t r;
diff --git a/test/cpu_speed_test.cc b/test/cpu_speed_test.cc
index 2ed9113..d7ad2ef 100644
--- a/test/cpu_speed_test.cc
+++ b/test/cpu_speed_test.cc
@@ -19,8 +19,8 @@
 const int kMaxPSNR = 100;
 
 class CpuSpeedTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> {
  protected:
   CpuSpeedTest()
       : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
@@ -31,7 +31,7 @@
   virtual void SetUp() {
     InitializeConfig();
     SetMode(encoding_mode_);
-    if (encoding_mode_ != ::libvpx_test::kRealTime) {
+    if (encoding_mode_ != ::libaom_test::kRealTime) {
       cfg_.g_lag_in_frames = 25;
       cfg_.rc_end_usage = VPX_VBR;
     } else {
@@ -42,12 +42,12 @@
 
   virtual void BeginPassHook(unsigned int /*pass*/) { min_psnr_ = kMaxPSNR; }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 1) {
       encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
       encoder->Control(VP9E_SET_TUNE_CONTENT, tune_content_);
-      if (encoding_mode_ != ::libvpx_test::kRealTime) {
+      if (encoding_mode_ != ::libaom_test::kRealTime) {
         encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
         encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
         encoder->Control(VP8E_SET_ARNR_STRENGTH, 5);
@@ -66,7 +66,7 @@
   void TestEncodeHighBitrate();
   void TestLowBitrate();
 
-  ::libvpx_test::TestMode encoding_mode_;
+  ::libaom_test::TestMode encoding_mode_;
   int set_cpu_used_;
   double min_psnr_;
   int tune_content_;
@@ -83,7 +83,7 @@
   cfg_.rc_max_quantizer = 0;
   cfg_.rc_min_quantizer = 0;
 
-  ::libvpx_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
+  ::libaom_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
                                        10);
 
   init_flags_ = VPX_CODEC_USE_PSNR;
@@ -93,7 +93,7 @@
 }
 
 void CpuSpeedTest::TestScreencastQ0() {
-  ::libvpx_test::Y4mVideoSource video("screendata.y4m", 0, 10);
+  ::libaom_test::Y4mVideoSource video("screendata.y4m", 0, 10);
   cfg_.g_timebase = video.timebase();
   cfg_.rc_2pass_vbr_minsection_pct = 5;
   cfg_.rc_2pass_vbr_maxsection_pct = 2000;
@@ -108,7 +108,7 @@
 }
 
 void CpuSpeedTest::TestTuneScreen() {
-  ::libvpx_test::Y4mVideoSource video("screendata.y4m", 0, 10);
+  ::libaom_test::Y4mVideoSource video("screendata.y4m", 0, 10);
   cfg_.g_timebase = video.timebase();
   cfg_.rc_2pass_vbr_minsection_pct = 5;
   cfg_.rc_2pass_vbr_minsection_pct = 2000;
@@ -133,7 +133,7 @@
   cfg_.rc_max_quantizer = 10;
   cfg_.rc_min_quantizer = 0;
 
-  ::libvpx_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
+  ::libaom_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
                                        10);
 
   ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
@@ -148,7 +148,7 @@
   cfg_.rc_target_bitrate = 200;
   cfg_.rc_min_quantizer = 40;
 
-  ::libvpx_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
+  ::libaom_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
                                        10);
 
   ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
@@ -169,11 +169,11 @@
 TEST_P(CpuSpeedTestLarge, TestLowBitrate) { TestLowBitrate(); }
 
 VP10_INSTANTIATE_TEST_CASE(CpuSpeedTest,
-                           ::testing::Values(::libvpx_test::kTwoPassGood,
-                                             ::libvpx_test::kOnePassGood),
+                           ::testing::Values(::libaom_test::kTwoPassGood,
+                                             ::libaom_test::kOnePassGood),
                            ::testing::Range(1, 3));
 VP10_INSTANTIATE_TEST_CASE(CpuSpeedTestLarge,
-                           ::testing::Values(::libvpx_test::kTwoPassGood,
-                                             ::libvpx_test::kOnePassGood),
+                           ::testing::Values(::libaom_test::kTwoPassGood,
+                                             ::libaom_test::kOnePassGood),
                            ::testing::Range(0, 1));
 }  // namespace
diff --git a/test/cx_set_ref.sh b/test/cx_set_ref.sh
index dddb366..7f1e604 100755
--- a/test/cx_set_ref.sh
+++ b/test/cx_set_ref.sh
@@ -8,7 +8,7 @@
 ##  in the file PATENTS.  All contributing project authors may
 ##  be found in the AUTHORS file in the root of the source tree.
 ##
-##  This file tests the libvpx cx_set_ref example. To add new tests to this
+##  This file tests the libaom cx_set_ref example. To add new tests to this
 ##  file, do the following:
 ##    1. Write a shell function (this is your test).
 ##    2. Add the function to cx_set_ref_tests (on a new line).
@@ -27,7 +27,7 @@
 # $1 is the codec name.
 vpx_set_ref() {
   local codec="$1"
-  local encoder="${LIBVPX_BIN_PATH}/vpxcx_set_ref${VPX_TEST_EXE_SUFFIX}"
+  local encoder="${LIBAOM_BIN_PATH}/vpxcx_set_ref${VPX_TEST_EXE_SUFFIX}"
 
   local output_file="${VPX_TEST_OUTPUT_DIR}/${codec}cx_set_ref_${codec}.ivf"
   local ref_frame_num=90
diff --git a/test/datarate_test.cc b/test/datarate_test.cc
index 300b11e..6e66f21 100644
--- a/test/datarate_test.cc
+++ b/test/datarate_test.cc
@@ -14,13 +14,13 @@
 #include "test/i420_video_source.h"
 #include "test/util.h"
 #include "test/y4m_video_source.h"
-#include "vpx/vpx_codec.h"
+#include "aom/vpx_codec.h"
 
 namespace {
 
 class DatarateTestLarge
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> {
  public:
   DatarateTestLarge() : EncoderTest(GET_PARAM(0)) {}
 
@@ -48,8 +48,8 @@
     denoiser_offon_period_ = -1;
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 0) encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
 
     if (denoiser_offon_test_) {
@@ -131,7 +131,7 @@
   cfg_.rc_end_usage = VPX_VBR;
   cfg_.g_lag_in_frames = 0;
 
-  ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+  ::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                        30, 1, 0, 300);
   for (int i = 400; i <= 800; i += 400) {
     cfg_.rc_target_bitrate = i;
@@ -155,7 +155,7 @@
   cfg_.rc_end_usage = VPX_CBR;
   cfg_.g_lag_in_frames = 0;
 
-  ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+  ::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                        30, 1, 0, 140);
   for (int i = 150; i < 800; i += 200) {
     cfg_.rc_target_bitrate = i;
@@ -170,7 +170,7 @@
 
 // Check basic rate targeting for CBR.
 TEST_P(DatarateTestLarge, BasicRateTargeting444) {
-  ::libvpx_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 140);
+  ::libaom_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 140);
 
   cfg_.g_profile = 1;
   cfg_.g_timebase = video.timebase();
@@ -217,7 +217,7 @@
   // interval (128).
   cfg_.kf_max_dist = 9999;
 
-  ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+  ::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                        30, 1, 0, 140);
 
   const int kDropFrameThreshTestStep = 30;
@@ -245,7 +245,7 @@
 }
 
 VP10_INSTANTIATE_TEST_CASE(DatarateTestLarge,
-                           ::testing::Values(::libvpx_test::kOnePassGood,
-                                             ::libvpx_test::kRealTime),
+                           ::testing::Values(::libaom_test::kOnePassGood,
+                                             ::libaom_test::kRealTime),
                            ::testing::Range(2, 9));
 }  // namespace
diff --git a/test/dct16x16_test.cc b/test/dct16x16_test.cc
index d71bc86..8233a52 100644
--- a/test/dct16x16_test.cc
+++ b/test/dct16x16_test.cc
@@ -20,14 +20,14 @@
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-#include "vp10/common/entropy.h"
-#include "vp10/common/scan.h"
-#include "vpx/vpx_codec.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/msvc.h"  // for round()
+#include "av1/common/entropy.h"
+#include "av1/common/scan.h"
+#include "aom/vpx_codec.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/msvc.h"  // for round()
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 
@@ -632,7 +632,7 @@
     inv_txfm_ref = idct16x16_ref;
 #endif
   }
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {
@@ -684,7 +684,7 @@
     inv_txfm_ref = iht16x16_ref;
 #endif
   }
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {
@@ -723,7 +723,7 @@
     pitch_ = 16;
     mask_ = (1 << bit_depth_) - 1;
   }
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {}
@@ -749,7 +749,7 @@
     bit_depth_ = GET_PARAM(1);
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   vpx_bit_depth_t bit_depth_;
diff --git a/test/dct32x32_test.cc b/test/dct32x32_test.cc
index b59ab03..629f878 100644
--- a/test/dct32x32_test.cc
+++ b/test/dct32x32_test.cc
@@ -21,13 +21,13 @@
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-#include "vp10/common/entropy.h"
-#include "vpx/vpx_codec.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/msvc.h"  // for round()
+#include "av1/common/entropy.h"
+#include "aom/vpx_codec.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/msvc.h"  // for round()
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 
@@ -90,7 +90,7 @@
     mask_ = (1 << bit_depth_) - 1;
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   int version_;
@@ -299,7 +299,7 @@
     bit_depth_ = GET_PARAM(1);
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   vpx_bit_depth_t bit_depth_;
diff --git a/test/decode_api_test.cc b/test/decode_api_test.cc
index 6571154..6aceaba 100644
--- a/test/decode_api_test.cc
+++ b/test/decode_api_test.cc
@@ -12,8 +12,8 @@
 
 #include "./vpx_config.h"
 #include "test/ivf_video_source.h"
-#include "vpx/vp8dx.h"
-#include "vpx/vpx_decoder.h"
+#include "aom/vp8dx.h"
+#include "aom/vpx_decoder.h"
 
 namespace {
 
diff --git a/test/decode_perf_test.cc b/test/decode_perf_test.cc
index d8bfcbe..04ca12f 100644
--- a/test/decode_perf_test.cc
+++ b/test/decode_perf_test.cc
@@ -17,7 +17,7 @@
 #include "test/md5_helper.h"
 #include "test/util.h"
 #include "test/webm_video_source.h"
-#include "vpx_ports/vpx_timer.h"
+#include "aom_ports/vpx_timer.h"
 #include "./ivfenc.h"
 #include "./vpx_version.h"
 
@@ -76,12 +76,12 @@
   const char *const video_name = GET_PARAM(VIDEO_NAME);
   const unsigned threads = GET_PARAM(THREADS);
 
-  libvpx_test::WebMVideoSource video(video_name);
+  libaom_test::WebMVideoSource video(video_name);
   video.Init();
 
   vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
   cfg.threads = threads;
-  libvpx_test::VP9Decoder decoder(cfg, 0);
+  libaom_test::VP9Decoder decoder(cfg, 0);
 
   vpx_usec_timer t;
   vpx_usec_timer_start(&t);
@@ -110,8 +110,8 @@
                         ::testing::ValuesIn(kVP9DecodePerfVectors));
 
 class VP9NewEncodeDecodePerfTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> {
  protected:
   VP9NewEncodeDecodePerfTest()
       : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), speed_(0),
@@ -136,8 +136,8 @@
     cfg_.rc_end_usage = VPX_VBR;
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 1) {
       encoder->Control(VP8E_SET_CPUUSED, speed_);
       encoder->Control(VP9E_SET_FRAME_PARALLEL_DECODING, 1);
@@ -179,7 +179,7 @@
   void set_speed(unsigned int speed) { speed_ = speed; }
 
  private:
-  libvpx_test::TestMode encoding_mode_;
+  libaom_test::TestMode encoding_mode_;
   uint32_t speed_;
   FILE *outfile_;
   uint32_t out_frames_;
@@ -213,7 +213,7 @@
   init_flags_ = VPX_CODEC_USE_PSNR;
 
   const char *video_name = kVP9EncodePerfTestVectors[i].name;
-  libvpx_test::I420VideoSource video(
+  libaom_test::I420VideoSource video(
       video_name, kVP9EncodePerfTestVectors[i].width,
       kVP9EncodePerfTestVectors[i].height, timebase.den, timebase.num, 0,
       kVP9EncodePerfTestVectors[i].frames);
@@ -223,12 +223,12 @@
 
   const uint32_t threads = 4;
 
-  libvpx_test::IVFVideoSource decode_video(kNewEncodeOutputFile);
+  libaom_test::IVFVideoSource decode_video(kNewEncodeOutputFile);
   decode_video.Init();
 
   vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
   cfg.threads = threads;
-  libvpx_test::VP9Decoder decoder(cfg, 0);
+  libaom_test::VP9Decoder decoder(cfg, 0);
 
   vpx_usec_timer t;
   vpx_usec_timer_start(&t);
@@ -256,5 +256,5 @@
 }
 
 VP10_INSTANTIATE_TEST_CASE(VP9NewEncodeDecodePerfTest,
-                           ::testing::Values(::libvpx_test::kTwoPassGood));
+                           ::testing::Values(::libaom_test::kTwoPassGood));
 }  // namespace
diff --git a/test/decode_test_driver.cc b/test/decode_test_driver.cc
index a62ddbd..4484d47 100644
--- a/test/decode_test_driver.cc
+++ b/test/decode_test_driver.cc
@@ -15,7 +15,7 @@
 #include "test/register_state_check.h"
 #include "test/video_source.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 
 const char kVP8Name[] = "WebM Project VP8";
 const char kVP10Name[] = "WebM Project VP10";
@@ -120,4 +120,4 @@
 
 void DecoderTest::set_flags(const vpx_codec_flags_t flags) { flags_ = flags; }
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
diff --git a/test/decode_test_driver.h b/test/decode_test_driver.h
index e6ef853..04ae46f 100644
--- a/test/decode_test_driver.h
+++ b/test/decode_test_driver.h
@@ -13,9 +13,9 @@
 #include <cstring>
 #include "third_party/googletest/src/include/gtest/gtest.h"
 #include "./vpx_config.h"
-#include "vpx/vpx_decoder.h"
+#include "aom/vpx_decoder.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 
 class CodecFactory;
 class CompressedVideoSource;
@@ -85,7 +85,7 @@
     return detail ? detail : vpx_codec_error(&decoder_);
   }
 
-  // Passes the external frame buffer information to libvpx.
+  // Passes the external frame buffer information to libaom.
   vpx_codec_err_t SetFrameBufferFunctions(
       vpx_get_frame_buffer_cb_fn_t cb_get,
       vpx_release_frame_buffer_cb_fn_t cb_release, void *user_priv) {
@@ -166,6 +166,6 @@
   vpx_codec_flags_t flags_;
 };
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #endif  // TEST_DECODE_TEST_DRIVER_H_
diff --git a/test/decode_to_md5.sh b/test/decode_to_md5.sh
index 854b74f..54d1593 100755
--- a/test/decode_to_md5.sh
+++ b/test/decode_to_md5.sh
@@ -8,7 +8,7 @@
 ##  in the file PATENTS.  All contributing project authors may
 ##  be found in the AUTHORS file in the root of the source tree.
 ##
-##  This file tests the libvpx decode_to_md5 example. To add new tests to this
+##  This file tests the libaom decode_to_md5 example. To add new tests to this
 ##  file, do the following:
 ##    1. Write a shell function (this is your test).
 ##    2. Add the function to decode_to_md5_tests (on a new line).
@@ -28,7 +28,7 @@
 # interpreted as codec name and used solely to name the output file. $3 is the
 # expected md5 sum: It must match that of the final frame.
 decode_to_md5() {
-  local decoder="${LIBVPX_BIN_PATH}/decode_to_md5${VPX_TEST_EXE_SUFFIX}"
+  local decoder="${LIBAOM_BIN_PATH}/decode_to_md5${VPX_TEST_EXE_SUFFIX}"
   local input_file="$1"
   local codec="$2"
   local expected_md5="$3"
diff --git a/test/decode_with_drops.sh b/test/decode_with_drops.sh
index 9b2edb6..bb2416a 100755
--- a/test/decode_with_drops.sh
+++ b/test/decode_with_drops.sh
@@ -8,7 +8,7 @@
 ##  in the file PATENTS.  All contributing project authors may
 ##  be found in the AUTHORS file in the root of the source tree.
 ##
-##  This file tests the libvpx decode_with_drops example. To add new tests to
+##  This file tests the libaom decode_with_drops example. To add new tests to
 ##  this file, do the following:
 ##    1. Write a shell function (this is your test).
 ##    2. Add the function to decode_with_drops_tests (on a new line).
@@ -28,7 +28,7 @@
 # to name the output file. $3 is the drop mode, and is passed directly to
 # decode_with_drops.
 decode_with_drops() {
-  local decoder="${LIBVPX_BIN_PATH}/decode_with_drops${VPX_TEST_EXE_SUFFIX}"
+  local decoder="${LIBAOM_BIN_PATH}/decode_with_drops${VPX_TEST_EXE_SUFFIX}"
   local input_file="$1"
   local codec="$2"
   local output_file="${VPX_TEST_OUTPUT_DIR}/decode_with_drops_${codec}"
diff --git a/test/denoiser_sse2_test.cc b/test/denoiser_sse2_test.cc
index daca510..571f3cf 100644
--- a/test/denoiser_sse2_test.cc
+++ b/test/denoiser_sse2_test.cc
@@ -18,13 +18,13 @@
 #include "test/register_state_check.h"
 #include "test/util.h"
 
-#include "vpx_scale/yv12config.h"
-#include "vpx/vpx_integer.h"
-#include "vp10/common/reconinter.h"
-#include "vp10/encoder/context_tree.h"
-#include "vp10/encoder/denoiser.h"
+#include "aom_scale/yv12config.h"
+#include "aom/vpx_integer.h"
+#include "av1/common/reconinter.h"
+#include "av1/encoder/context_tree.h"
+#include "av1/encoder/denoiser.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 
@@ -35,7 +35,7 @@
 
   virtual void SetUp() { bs_ = GetParam(); }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   BLOCK_SIZE bs_;
diff --git a/test/divu_small_test.cc b/test/divu_small_test.cc
index 3b00e05..ea6da47 100644
--- a/test/divu_small_test.cc
+++ b/test/divu_small_test.cc
@@ -27,9 +27,9 @@
 #include "third_party/googletest/src/include/gtest/gtest.h"
 
 #include "test/acm_random.h"
-#include "vp10/common/odintrin.h"
+#include "av1/common/odintrin.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 TEST(Daala, TestDIVUuptoMAX) {
   for (int d = 1; d <= OD_DIVU_DMAX; d++) {
diff --git a/test/encode_api_test.cc b/test/encode_api_test.cc
index 6c1d5e3..dc3a52b 100644
--- a/test/encode_api_test.cc
+++ b/test/encode_api_test.cc
@@ -11,8 +11,8 @@
 #include "third_party/googletest/src/include/gtest/gtest.h"
 
 #include "./vpx_config.h"
-#include "vpx/vp8cx.h"
-#include "vpx/vpx_encoder.h"
+#include "aom/vp8cx.h"
+#include "aom/vpx_encoder.h"
 
 namespace {
 
diff --git a/test/encode_perf_test.cc b/test/encode_perf_test.cc
index 2411dcd..7f33d55 100644
--- a/test/encode_perf_test.cc
+++ b/test/encode_perf_test.cc
@@ -16,7 +16,7 @@
 #include "test/i420_video_source.h"
 #include "test/util.h"
 #include "test/y4m_video_source.h"
-#include "vpx_ports/vpx_timer.h"
+#include "aom_ports/vpx_timer.h"
 
 namespace {
 
@@ -54,8 +54,8 @@
 #define NELEMENTS(x) (sizeof((x)) / sizeof((x)[0]))
 
 class VP9EncodePerfTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> {
  protected:
   VP9EncodePerfTest()
       : EncoderTest(GET_PARAM(0)), min_psnr_(kMaxPsnr), nframes_(0),
@@ -82,8 +82,8 @@
     cfg_.g_threads = threads_;
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 0) {
       const int log2_tile_columns = 3;
       encoder->Control(VP8E_SET_CPUUSED, speed_);
@@ -116,7 +116,7 @@
  private:
   double min_psnr_;
   unsigned int nframes_;
-  libvpx_test::TestMode encoding_mode_;
+  libaom_test::TestMode encoding_mode_;
   unsigned speed_;
   unsigned int threads_;
 };
@@ -143,7 +143,7 @@
 
         const unsigned frames = kVP9EncodePerfTestVectors[i].frames;
         const char *video_name = kVP9EncodePerfTestVectors[i].name;
-        libvpx_test::I420VideoSource video(
+        libaom_test::I420VideoSource video(
             video_name, kVP9EncodePerfTestVectors[i].width,
             kVP9EncodePerfTestVectors[i].height, timebase.den, timebase.num, 0,
             kVP9EncodePerfTestVectors[i].frames);
@@ -183,5 +183,5 @@
 }
 
 VP10_INSTANTIATE_TEST_CASE(VP9EncodePerfTest,
-                           ::testing::Values(::libvpx_test::kRealTime));
+                           ::testing::Values(::libaom_test::kRealTime));
 }  // namespace
diff --git a/test/encode_test_driver.cc b/test/encode_test_driver.cc
index 61044ee..cb1df9b 100644
--- a/test/encode_test_driver.cc
+++ b/test/encode_test_driver.cc
@@ -13,14 +13,14 @@
 #include "third_party/googletest/src/include/gtest/gtest.h"
 
 #include "./vpx_config.h"
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 #include "test/codec_factory.h"
 #include "test/decode_test_driver.h"
 #include "test/encode_test_driver.h"
 #include "test/register_state_check.h"
 #include "test/video_source.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 void Encoder::InitEncoder(VideoSource *video) {
   vpx_codec_err_t res;
   const vpx_image_t *img = video->img();
@@ -317,4 +317,4 @@
   }
 }
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
diff --git a/test/encode_test_driver.h b/test/encode_test_driver.h
index 94abd03..5762be5 100644
--- a/test/encode_test_driver.h
+++ b/test/encode_test_driver.h
@@ -17,11 +17,11 @@
 
 #include "./vpx_config.h"
 #if CONFIG_VP10_ENCODER
-#include "vpx/vp8cx.h"
+#include "aom/vp8cx.h"
 #endif
-#include "vpx/vpx_encoder.h"
+#include "aom/vpx_encoder.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 
 class CodecFactory;
 class VideoSource;
@@ -34,18 +34,18 @@
   kTwoPassBest
 };
 #define ALL_TEST_MODES                                                        \
-  ::testing::Values(::libvpx_test::kRealTime, ::libvpx_test::kOnePassGood,    \
-                    ::libvpx_test::kOnePassBest, ::libvpx_test::kTwoPassGood, \
-                    ::libvpx_test::kTwoPassBest)
+  ::testing::Values(::libaom_test::kRealTime, ::libaom_test::kOnePassGood,    \
+                    ::libaom_test::kOnePassBest, ::libaom_test::kTwoPassGood, \
+                    ::libaom_test::kTwoPassBest)
 
 #define ONE_PASS_TEST_MODES                                                \
-  ::testing::Values(::libvpx_test::kRealTime, ::libvpx_test::kOnePassGood, \
-                    ::libvpx_test::kOnePassBest)
+  ::testing::Values(::libaom_test::kRealTime, ::libaom_test::kOnePassGood, \
+                    ::libaom_test::kOnePassBest)
 
 #define TWO_PASS_TEST_MODES \
-  ::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kTwoPassBest)
+  ::testing::Values(::libaom_test::kTwoPassGood, ::libaom_test::kTwoPassBest)
 
-// Provides an object to handle the libvpx get_cx_data() iteration pattern
+// Provides an object to handle the libaom get_cx_data() iteration pattern
 class CxDataIterator {
  public:
   explicit CxDataIterator(vpx_codec_ctx_t *encoder)
@@ -60,7 +60,7 @@
   vpx_codec_iter_t iter_;
 };
 
-// Implements an in-memory store for libvpx twopass statistics
+// Implements an in-memory store for libaom twopass statistics
 class TwopassStatsStore {
  public:
   void Append(const vpx_codec_cx_pkt_t &pkt) {
@@ -250,6 +250,6 @@
   vpx_codec_pts_t last_pts_;
 };
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #endif  // TEST_ENCODE_TEST_DRIVER_H_
diff --git a/test/encoder_parms_get_to_decoder.cc b/test/encoder_parms_get_to_decoder.cc
index 8af0b7d..e2fe537 100644
--- a/test/encoder_parms_get_to_decoder.cc
+++ b/test/encoder_parms_get_to_decoder.cc
@@ -14,7 +14,7 @@
 #include "test/encode_test_driver.h"
 #include "test/util.h"
 #include "test/y4m_video_source.h"
-#include "vp10/vp10_dx_iface.c"
+#include "av1/vp10_dx_iface.c"
 
 namespace {
 
@@ -53,8 +53,8 @@
 };
 
 class VpxEncoderParmsGetToDecoder
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith2Params<EncodeParameters,
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith2Params<EncodeParameters,
                                                  EncodePerfTestVideo> {
  protected:
   VpxEncoderParmsGetToDecoder()
@@ -64,7 +64,7 @@
 
   virtual void SetUp() {
     InitializeConfig();
-    SetMode(::libvpx_test::kTwoPassGood);
+    SetMode(::libaom_test::kTwoPassGood);
     cfg_.g_lag_in_frames = 25;
     cfg_.g_error_resilient = encode_parms.error_resilient;
     dec_cfg_.threads = 4;
@@ -72,8 +72,8 @@
     cfg_.rc_target_bitrate = test_video_.bitrate;
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 1) {
       encoder->Control(VP9E_SET_COLOR_SPACE, encode_parms.cs);
       encoder->Control(VP9E_SET_COLOR_RANGE, encode_parms.color_range);
@@ -93,8 +93,8 @@
   }
 
   virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec,
-                                  const libvpx_test::VideoSource & /*video*/,
-                                  libvpx_test::Decoder *decoder) {
+                                  const libaom_test::VideoSource & /*video*/,
+                                  libaom_test::Decoder *decoder) {
     vpx_codec_ctx_t *const vp9_decoder = decoder->GetDecoder();
     vpx_codec_alg_priv_t *const priv =
         reinterpret_cast<vpx_codec_alg_priv_t *>(vp9_decoder->priv);
@@ -135,8 +135,8 @@
 TEST_P(VpxEncoderParmsGetToDecoder, BitstreamParms) {
   init_flags_ = VPX_CODEC_USE_PSNR;
 
-  libvpx_test::VideoSource *const video =
-      new libvpx_test::Y4mVideoSource(test_video_.name, 0, test_video_.frames);
+  libaom_test::VideoSource *const video =
+      new libaom_test::Y4mVideoSource(test_video_.name, 0, test_video_.frames);
   ASSERT_TRUE(video != NULL);
 
   ASSERT_NO_FATAL_FAILURE(RunLoop(video));
diff --git a/test/end_to_end_test.cc b/test/end_to_end_test.cc
index fe5c479..693df78 100644
--- a/test/end_to_end_test.cc
+++ b/test/end_to_end_test.cc
@@ -68,9 +68,9 @@
 };
 
 // Encoding modes tested
-const libvpx_test::TestMode kEncodingModeVectors[] = {
-  ::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
-  ::libvpx_test::kRealTime,
+const libaom_test::TestMode kEncodingModeVectors[] = {
+  ::libaom_test::kTwoPassGood, ::libaom_test::kOnePassGood,
+  ::libaom_test::kRealTime,
 };
 
 // Speed settings tested
@@ -85,8 +85,8 @@
 }
 
 class EndToEndTestLarge
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith3Params<libvpx_test::TestMode,
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith3Params<libaom_test::TestMode,
                                                  TestVideoParam, int> {
  protected:
   EndToEndTestLarge()
@@ -99,7 +99,7 @@
   virtual void SetUp() {
     InitializeConfig();
     SetMode(encoding_mode_);
-    if (encoding_mode_ != ::libvpx_test::kRealTime) {
+    if (encoding_mode_ != ::libaom_test::kRealTime) {
       cfg_.g_lag_in_frames = 5;
       cfg_.rc_end_usage = VPX_VBR;
     } else {
@@ -122,18 +122,18 @@
     nframes_++;
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 1) {
       encoder->Control(VP9E_SET_FRAME_PARALLEL_DECODING, 1);
       encoder->Control(VP9E_SET_TILE_COLUMNS, 4);
       encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
       // Test screen coding tools at cpu_used = 1 && encoding mode is two-pass.
-      if (cpu_used_ == 1 && encoding_mode_ == ::libvpx_test::kTwoPassGood)
+      if (cpu_used_ == 1 && encoding_mode_ == ::libaom_test::kTwoPassGood)
         encoder->Control(VP9E_SET_TUNE_CONTENT, VPX_CONTENT_SCREEN);
       else
         encoder->Control(VP9E_SET_TUNE_CONTENT, VPX_CONTENT_DEFAULT);
-      if (encoding_mode_ != ::libvpx_test::kRealTime) {
+      if (encoding_mode_ != ::libaom_test::kRealTime) {
         encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
         encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
         encoder->Control(VP8E_SET_ARNR_STRENGTH, 5);
@@ -157,7 +157,7 @@
  private:
   double psnr_;
   unsigned int nframes_;
-  libvpx_test::TestMode encoding_mode_;
+  libaom_test::TestMode encoding_mode_;
 };
 
 TEST_P(EndToEndTestLarge, EndtoEndPSNRTest) {
@@ -169,12 +169,12 @@
   init_flags_ = VPX_CODEC_USE_PSNR;
   if (cfg_.g_bit_depth > 8) init_flags_ |= VPX_CODEC_USE_HIGHBITDEPTH;
 
-  libvpx_test::VideoSource *video;
+  libaom_test::VideoSource *video;
   if (is_extension_y4m(test_video_param_.filename)) {
     video =
-        new libvpx_test::Y4mVideoSource(test_video_param_.filename, 0, kFrames);
+        new libaom_test::Y4mVideoSource(test_video_param_.filename, 0, kFrames);
   } else {
-    video = new libvpx_test::YUVVideoSource(test_video_param_.filename,
+    video = new libaom_test::YUVVideoSource(test_video_param_.filename,
                                             test_video_param_.fmt, kWidth,
                                             kHeight, kFramerate, 1, 0, kFrames);
   }
diff --git a/test/error_block_test.cc b/test/error_block_test.cc
index 90130ca..8047e3d 100644
--- a/test/error_block_test.cc
+++ b/test/error_block_test.cc
@@ -20,11 +20,11 @@
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-#include "vp10/common/entropy.h"
-#include "vpx/vpx_codec.h"
-#include "vpx/vpx_integer.h"
+#include "av1/common/entropy.h"
+#include "aom/vpx_codec.h"
+#include "aom/vpx_integer.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 #if CONFIG_VP9_HIGHBITDEPTH
@@ -46,7 +46,7 @@
     bit_depth_ = GET_PARAM(2);
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   vpx_bit_depth_t bit_depth_;
diff --git a/test/error_resilience_test.cc b/test/error_resilience_test.cc
index 2c1392c..f86f85d 100644
--- a/test/error_resilience_test.cc
+++ b/test/error_resilience_test.cc
@@ -20,8 +20,8 @@
 const int kMaxDroppableFrames = 12;
 
 class ErrorResilienceTestLarge
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> {
  protected:
   ErrorResilienceTestLarge()
       : EncoderTest(GET_PARAM(0)), psnr_(0.0), nframes_(0), mismatch_psnr_(0.0),
@@ -54,8 +54,8 @@
     nframes_++;
   }
 
-  virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder * /*encoder*/) {
+  virtual void PreEncodeFrameHook(libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder * /*encoder*/) {
     frame_flags_ &=
         ~(VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF);
     if (droppable_nframes_ > 0 &&
@@ -101,7 +101,7 @@
     mismatch_psnr_ += mismatch_psnr;
     ++mismatch_nframes_;
     // std::cout << "Mismatch frame psnr: " << mismatch_psnr << "\n";
-    ::libvpx_test::EncoderTest::MismatchHook(img1, img2);
+    ::libaom_test::EncoderTest::MismatchHook(img1, img2);
   }
 
   void SetErrorFrames(int num, unsigned int *list) {
@@ -138,7 +138,7 @@
   unsigned int mismatch_nframes_;
   unsigned int error_frames_[kMaxErrorFrames];
   unsigned int droppable_frames_[kMaxDroppableFrames];
-  libvpx_test::TestMode encoding_mode_;
+  libaom_test::TestMode encoding_mode_;
 };
 
 TEST_P(ErrorResilienceTestLarge, OnVersusOff) {
@@ -149,7 +149,7 @@
 
   init_flags_ = VPX_CODEC_USE_PSNR;
 
-  libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+  libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                      timebase.den, timebase.num, 0, 30);
 
   // Error resilient mode OFF.
@@ -186,7 +186,7 @@
 
   init_flags_ = VPX_CODEC_USE_PSNR;
 
-  libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+  libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                      timebase.den, timebase.num, 0, 40);
 
   // Error resilient mode ON.
diff --git a/test/ethread_test.cc b/test/ethread_test.cc
index 6b80ccc..0a32458 100644
--- a/test/ethread_test.cc
+++ b/test/ethread_test.cc
@@ -19,8 +19,8 @@
 
 namespace {
 class VPxEncoderThreadTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> {
  protected:
   VPxEncoderThreadTest()
       : EncoderTest(GET_PARAM(0)), encoder_initialized_(false),
@@ -47,7 +47,7 @@
     InitializeConfig();
     SetMode(encoding_mode_);
 
-    if (encoding_mode_ != ::libvpx_test::kRealTime) {
+    if (encoding_mode_ != ::libaom_test::kRealTime) {
       cfg_.g_lag_in_frames = 3;
       cfg_.rc_end_usage = VPX_VBR;
       cfg_.rc_2pass_vbr_minsection_pct = 5;
@@ -65,12 +65,12 @@
     encoder_initialized_ = false;
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource * /*video*/,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource * /*video*/,
+                                  ::libaom_test::Encoder *encoder) {
     if (!encoder_initialized_) {
 #if CONFIG_VP10 && CONFIG_EXT_TILE
       encoder->Control(VP9E_SET_TILE_COLUMNS, 1);
-      if (codec_ == &libvpx_test::kVP10) {
+      if (codec_ == &libaom_test::kVP10) {
         // TODO(geza): Start using multiple tile rows when the multi-threaded
         // encoder can handle them
         encoder->Control(VP9E_SET_TILE_ROWS, 32);
@@ -83,7 +83,7 @@
       encoder->Control(VP9E_SET_TILE_ROWS, 0);
 #endif  // CONFIG_VP10 && CONFIG_EXT_TILE
       encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
-      if (encoding_mode_ != ::libvpx_test::kRealTime) {
+      if (encoding_mode_ != ::libaom_test::kRealTime) {
         encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
         encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
         encoder->Control(VP8E_SET_ARNR_STRENGTH, 5);
@@ -99,7 +99,7 @@
   virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
     size_enc_.push_back(pkt->data.frame.sz);
 
-    ::libvpx_test::MD5 md5_enc;
+    ::libaom_test::MD5 md5_enc;
     md5_enc.Add(reinterpret_cast<uint8_t *>(pkt->data.frame.buf),
                 pkt->data.frame.sz);
     md5_enc_.push_back(md5_enc.Get());
@@ -113,14 +113,14 @@
     const vpx_image_t *img = decoder_->GetDxData().Next();
 
     if (img) {
-      ::libvpx_test::MD5 md5_res;
+      ::libaom_test::MD5 md5_res;
       md5_res.Add(img);
       md5_dec_.push_back(md5_res.Get());
     }
   }
 
   void DoTest() {
-    ::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 15, 18);
+    ::libaom_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 15, 18);
     cfg_.rc_target_bitrate = 1000;
 
     // Encode using single thread.
@@ -157,9 +157,9 @@
   }
 
   bool encoder_initialized_;
-  ::libvpx_test::TestMode encoding_mode_;
+  ::libaom_test::TestMode encoding_mode_;
   int set_cpu_used_;
-  ::libvpx_test::Decoder *decoder_;
+  ::libaom_test::Decoder *decoder_;
   std::vector<size_t> size_enc_;
   std::vector<std::string> md5_enc_;
   std::vector<std::string> md5_dec_;
@@ -172,12 +172,12 @@
 TEST_P(VPxEncoderThreadTestLarge, EncoderResultTest) { DoTest(); }
 
 VP10_INSTANTIATE_TEST_CASE(VPxEncoderThreadTest,
-                           ::testing::Values(::libvpx_test::kTwoPassGood,
-                                             ::libvpx_test::kOnePassGood),
+                           ::testing::Values(::libaom_test::kTwoPassGood,
+                                             ::libaom_test::kOnePassGood),
                            ::testing::Range(3, 9));
 
 VP10_INSTANTIATE_TEST_CASE(VPxEncoderThreadTestLarge,
-                           ::testing::Values(::libvpx_test::kTwoPassGood,
-                                             ::libvpx_test::kOnePassGood),
+                           ::testing::Values(::libaom_test::kTwoPassGood,
+                                             ::libaom_test::kOnePassGood),
                            ::testing::Range(1, 3));
 }  // namespace
diff --git a/test/examples.sh b/test/examples.sh
index 39f7e39..1ee120a 100755
--- a/test/examples.sh
+++ b/test/examples.sh
@@ -8,7 +8,7 @@
 ##  in the file PATENTS.  All contributing project authors may
 ##  be found in the AUTHORS file in the root of the source tree.
 ##
-##  This file runs all of the tests for the libvpx examples.
+##  This file runs all of the tests for the libaom examples.
 ##
 . $(dirname $0)/tools_common.sh
 
diff --git a/test/fdct4x4_test.cc b/test/fdct4x4_test.cc
index 7b195b5..dda6e68 100644
--- a/test/fdct4x4_test.cc
+++ b/test/fdct4x4_test.cc
@@ -21,19 +21,19 @@
 #include "test/register_state_check.h"
 #include "test/transform_test_base.h"
 #include "test/util.h"
-#include "vp10/common/entropy.h"
-#include "vpx/vpx_codec.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/entropy.h"
+#include "aom/vpx_codec.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride);
 typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride);
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
                         int tx_type);
-using libvpx_test::FhtFunc;
+using libaom_test::FhtFunc;
 
 typedef std::tr1::tuple<FdctFunc, IdctFunc, int, vpx_bit_depth_t, int>
     Dct4x4Param;
@@ -89,7 +89,7 @@
 #endif  // HAVE_SSE2
 #endif  // CONFIG_VP9_HIGHBITDEPTH
 
-class Trans4x4DCT : public libvpx_test::TransformTestBase,
+class Trans4x4DCT : public libaom_test::TransformTestBase,
                     public ::testing::TestWithParam<Dct4x4Param> {
  public:
   virtual ~Trans4x4DCT() {}
@@ -104,7 +104,7 @@
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
   }
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
@@ -126,7 +126,7 @@
 
 TEST_P(Trans4x4DCT, InvAccuracyCheck) { RunInvAccuracyCheck(1); }
 
-class Trans4x4HT : public libvpx_test::TransformTestBase,
+class Trans4x4HT : public libaom_test::TransformTestBase,
                    public ::testing::TestWithParam<Ht4x4Param> {
  public:
   virtual ~Trans4x4HT() {}
@@ -141,7 +141,7 @@
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
   }
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
@@ -164,7 +164,7 @@
 
 TEST_P(Trans4x4HT, InvAccuracyCheck) { RunInvAccuracyCheck(1); }
 
-class Trans4x4WHT : public libvpx_test::TransformTestBase,
+class Trans4x4WHT : public libaom_test::TransformTestBase,
                     public ::testing::TestWithParam<Dct4x4Param> {
  public:
   virtual ~Trans4x4WHT() {}
@@ -179,7 +179,7 @@
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
   }
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc
index 78c7791..5f07468 100644
--- a/test/fdct8x8_test.cc
+++ b/test/fdct8x8_test.cc
@@ -20,13 +20,13 @@
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-#include "vp10/common/entropy.h"
-#include "vp10/common/scan.h"
-#include "vpx/vpx_codec.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/entropy.h"
+#include "av1/common/scan.h"
+#include "aom/vpx_codec.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 
@@ -530,7 +530,7 @@
     mask_ = (1 << bit_depth_) - 1;
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {
@@ -569,7 +569,7 @@
     mask_ = (1 << bit_depth_) - 1;
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {
@@ -603,7 +603,7 @@
     mask_ = (1 << bit_depth_) - 1;
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
diff --git a/test/frame_size_tests.cc b/test/frame_size_tests.cc
index cc72d8e..ff05119 100644
--- a/test/frame_size_tests.cc
+++ b/test/frame_size_tests.cc
@@ -13,27 +13,27 @@
 
 namespace {
 
-class VP9FrameSizeTestsLarge : public ::libvpx_test::EncoderTest,
+class VP9FrameSizeTestsLarge : public ::libaom_test::EncoderTest,
                                public ::testing::Test {
  protected:
   VP9FrameSizeTestsLarge()
-      : EncoderTest(&::libvpx_test::kVP10), expected_res_(VPX_CODEC_OK) {}
+      : EncoderTest(&::libaom_test::kVP10), expected_res_(VPX_CODEC_OK) {}
   virtual ~VP9FrameSizeTestsLarge() {}
 
   virtual void SetUp() {
     InitializeConfig();
-    SetMode(::libvpx_test::kRealTime);
+    SetMode(::libaom_test::kRealTime);
   }
 
   virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec,
-                                  const libvpx_test::VideoSource & /*video*/,
-                                  libvpx_test::Decoder *decoder) {
+                                  const libaom_test::VideoSource & /*video*/,
+                                  libaom_test::Decoder *decoder) {
     EXPECT_EQ(expected_res_, res_dec) << decoder->DecodeError();
     return !::testing::Test::HasFailure();
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 1) {
       encoder->Control(VP8E_SET_CPUUSED, 7);
       encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
@@ -47,7 +47,7 @@
 };
 
 TEST_F(VP9FrameSizeTestsLarge, TestInvalidSizes) {
-  ::libvpx_test::RandomVideoSource video;
+  ::libaom_test::RandomVideoSource video;
 
 #if CONFIG_SIZE_LIMIT
   video.SetSize(DECODE_WIDTH_LIMIT + 16, DECODE_HEIGHT_LIMIT + 16);
@@ -58,7 +58,7 @@
 }
 
 TEST_F(VP9FrameSizeTestsLarge, ValidSizes) {
-  ::libvpx_test::RandomVideoSource video;
+  ::libaom_test::RandomVideoSource video;
 
 #if CONFIG_SIZE_LIMIT
   video.SetSize(DECODE_WIDTH_LIMIT, DECODE_HEIGHT_LIMIT);
@@ -85,7 +85,7 @@
 }
 
 TEST_F(VP9FrameSizeTestsLarge, OneByOneVideo) {
-  ::libvpx_test::RandomVideoSource video;
+  ::libaom_test::RandomVideoSource video;
 
   video.SetSize(1, 1);
   video.set_limit(2);
diff --git a/test/function_equivalence_test.h b/test/function_equivalence_test.h
index 4c5a97f..dcb5829 100644
--- a/test/function_equivalence_test.h
+++ b/test/function_equivalence_test.h
@@ -16,9 +16,9 @@
 #include "test/clear_system_state.h"
 #include "test/util.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
-namespace libvpx_test {
+namespace libaom_test {
 // Base class for tests that compare 2 implementations of the same function
 // for equivalence. The template parameter should be pointer to a function
 // that is being tested.
@@ -50,12 +50,12 @@
 
   virtual void SetUp() { params_ = this->GetParam(); }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   ACMRandom rng_;
   FuncParam<T> params_;
 };
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 #endif  // TEST_FUNCTION_EQUIVALENCE_TEST_H_
diff --git a/test/hadamard_test.cc b/test/hadamard_test.cc
index e771595..1f86e9c 100644
--- a/test/hadamard_test.cc
+++ b/test/hadamard_test.cc
@@ -19,7 +19,7 @@
 
 namespace {
 
-using ::libvpx_test::ACMRandom;
+using ::libaom_test::ACMRandom;
 
 typedef void (*HadamardFunc)(const int16_t *a, int a_stride, int16_t *b);
 
diff --git a/test/hbd_metrics_test.cc b/test/hbd_metrics_test.cc
index abe82be..a7c1ec3 100644
--- a/test/hbd_metrics_test.cc
+++ b/test/hbd_metrics_test.cc
@@ -16,13 +16,13 @@
 #include "test/acm_random.h"
 #include "test/util.h"
 #include "./vpx_config.h"
-#include "vpx_dsp/psnr.h"
-#include "vpx_dsp/ssim.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/msvc.h"
-#include "vpx_scale/yv12config.h"
+#include "aom_dsp/psnr.h"
+#include "aom_dsp/ssim.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/msvc.h"
+#include "aom_scale/yv12config.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 
diff --git a/test/i420_video_source.h b/test/i420_video_source.h
index 4957382..d1324af 100644
--- a/test/i420_video_source.h
+++ b/test/i420_video_source.h
@@ -15,7 +15,7 @@
 
 #include "test/yuv_video_source.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 
 // This class extends VideoSource to allow parsing of raw yv12
 // so that we can do actual file encodes.
@@ -28,6 +28,6 @@
                        rate_numerator, rate_denominator, start, limit) {}
 };
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #endif  // TEST_I420_VIDEO_SOURCE_H_
diff --git a/test/idct8x8_test.cc b/test/idct8x8_test.cc
index ee75805..52d3f4f 100644
--- a/test/idct8x8_test.cc
+++ b/test/idct8x8_test.cc
@@ -16,10 +16,10 @@
 
 #include "./vpx_dsp_rtcd.h"
 #include "test/acm_random.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/msvc.h"  // for round()
+#include "aom/vpx_integer.h"
+#include "aom_ports/msvc.h"  // for round()
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 
diff --git a/test/idct_test.cc b/test/idct_test.cc
index 6b619a0..a1264a8 100644
--- a/test/idct_test.cc
+++ b/test/idct_test.cc
@@ -14,7 +14,7 @@
 
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 typedef void (*IdctFunc)(int16_t *input, unsigned char *pred_ptr,
                          int pred_stride, unsigned char *dst_ptr,
@@ -31,7 +31,7 @@
     for (i = 0; i < 256; i++) output[i] = ((i & 0xF) < 4 && (i < 64)) ? 0 : -1;
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
   IdctFunc UUT;
   int16_t input[16];
diff --git a/test/intrapred_test.cc b/test/intrapred_test.cc
index 5d0cb58..0cedb12 100644
--- a/test/intrapred_test.cc
+++ b/test/intrapred_test.cc
@@ -18,13 +18,13 @@
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-#include "vp10/common/blockd.h"
-#include "vp10/common/pred_common.h"
-#include "vpx_mem/vpx_mem.h"
+#include "av1/common/blockd.h"
+#include "av1/common/pred_common.h"
+#include "aom_mem/vpx_mem.h"
 
 namespace {
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 const int count_test_block = 100000;
 
diff --git a/test/ivf_video_source.h b/test/ivf_video_source.h
index b87624a..7b81bb9 100644
--- a/test/ivf_video_source.h
+++ b/test/ivf_video_source.h
@@ -15,7 +15,7 @@
 #include <string>
 #include "test/video_source.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 const unsigned int kCodeBufferSize = 256 * 1024;
 const unsigned int kIvfFileHdrSize = 32;
 const unsigned int kIvfFrameHdrSize = 12;
@@ -40,7 +40,7 @@
 
   virtual void Init() {
     // Allocate a buffer for read in the compressed video frame.
-    compressed_frame_buf_ = new uint8_t[libvpx_test::kCodeBufferSize];
+    compressed_frame_buf_ = new uint8_t[libaom_test::kCodeBufferSize];
     ASSERT_TRUE(compressed_frame_buf_ != NULL)
         << "Allocate frame buffer failed";
   }
@@ -101,6 +101,6 @@
   bool end_of_file_;
 };
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #endif  // TEST_IVF_VIDEO_SOURCE_H_
diff --git a/test/level_test.cc b/test/level_test.cc
index fbbb539..0a12668 100644
--- a/test/level_test.cc
+++ b/test/level_test.cc
@@ -15,8 +15,8 @@
 
 namespace {
 class LevelTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> {
  protected:
   LevelTest()
       : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
@@ -27,7 +27,7 @@
   virtual void SetUp() {
     InitializeConfig();
     SetMode(encoding_mode_);
-    if (encoding_mode_ != ::libvpx_test::kRealTime) {
+    if (encoding_mode_ != ::libaom_test::kRealTime) {
       cfg_.g_lag_in_frames = 25;
       cfg_.rc_end_usage = VPX_VBR;
     } else {
@@ -41,13 +41,13 @@
     cfg_.rc_min_quantizer = 0;
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 0) {
       encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
       encoder->Control(VP9E_SET_TARGET_LEVEL, target_level_);
       encoder->Control(VP9E_SET_MIN_GF_INTERVAL, min_gf_internal_);
-      if (encoding_mode_ != ::libvpx_test::kRealTime) {
+      if (encoding_mode_ != ::libaom_test::kRealTime) {
         encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
         encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
         encoder->Control(VP8E_SET_ARNR_STRENGTH, 5);
@@ -59,7 +59,7 @@
     ASSERT_GE(level_, 0);
   }
 
-  ::libvpx_test::TestMode encoding_mode_;
+  ::libaom_test::TestMode encoding_mode_;
   int cpu_used_;
   int min_gf_internal_;
   int target_level_;
@@ -68,7 +68,7 @@
 
 // Test for keeping level stats only
 TEST_P(LevelTest, TestTargetLevel0) {
-  ::libvpx_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
+  ::libaom_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
                                        40);
   target_level_ = 0;
   min_gf_internal_ = 4;
@@ -82,14 +82,14 @@
 
 // Test for level control being turned off
 TEST_P(LevelTest, TestTargetLevel255) {
-  ::libvpx_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
+  ::libaom_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
                                        30);
   target_level_ = 255;
   ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 }
 
 TEST_P(LevelTest, TestTargetLevelApi) {
-  ::libvpx_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0, 1);
+  ::libaom_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0, 1);
   static const vpx_codec_iface_t *codec = &vpx_codec_vp9_cx_algo;
   vpx_codec_ctx_t enc;
   vpx_codec_enc_cfg_t cfg;
@@ -110,7 +110,7 @@
 }
 
 VP9_INSTANTIATE_TEST_CASE(LevelTest,
-                          ::testing::Values(::libvpx_test::kTwoPassGood,
-                                            ::libvpx_test::kOnePassGood),
+                          ::testing::Values(::libaom_test::kTwoPassGood,
+                                            ::libaom_test::kOnePassGood),
                           ::testing::Range(0, 9));
 }  // namespace
diff --git a/test/lossless_test.cc b/test/lossless_test.cc
index c7f1963..3989e93 100644
--- a/test/lossless_test.cc
+++ b/test/lossless_test.cc
@@ -22,8 +22,8 @@
 const int kMaxPsnr = 100;
 
 class LosslessTestLarge
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> {
  protected:
   LosslessTestLarge()
       : EncoderTest(GET_PARAM(0)), psnr_(kMaxPsnr), nframes_(0),
@@ -36,8 +36,8 @@
     SetMode(encoding_mode_);
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 1) {
       // Only call Control if quantizer > 0 to verify that using quantizer
       // alone will activate lossless
@@ -61,7 +61,7 @@
  private:
   double psnr_;
   unsigned int nframes_;
-  libvpx_test::TestMode encoding_mode_;
+  libaom_test::TestMode encoding_mode_;
 };
 
 TEST_P(LosslessTestLarge, TestLossLessEncoding) {
@@ -75,7 +75,7 @@
   init_flags_ = VPX_CODEC_USE_PSNR;
 
   // intentionally changed the dimension for better testing coverage
-  libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+  libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                      timebase.den, timebase.num, 0, 5);
   ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
   const double psnr_lossless = GetMinPsnr();
@@ -83,7 +83,7 @@
 }
 
 TEST_P(LosslessTestLarge, TestLossLessEncoding444) {
-  libvpx_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 5);
+  libaom_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 5);
 
   cfg_.g_profile = 1;
   cfg_.g_timebase = video.timebase();
@@ -111,7 +111,7 @@
 
   init_flags_ = VPX_CODEC_USE_PSNR;
 
-  libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+  libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                      timebase.den, timebase.num, 0, 5);
   ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
   const double psnr_lossless = GetMinPsnr();
@@ -119,6 +119,6 @@
 }
 
 VP10_INSTANTIATE_TEST_CASE(LosslessTestLarge,
-                           ::testing::Values(::libvpx_test::kOnePassGood,
-                                             ::libvpx_test::kTwoPassGood));
+                           ::testing::Values(::libaom_test::kOnePassGood,
+                                             ::libaom_test::kTwoPassGood));
 }  // namespace
diff --git a/test/lpf_8_test.cc b/test/lpf_8_test.cc
index 8aaab23..3088b4a 100644
--- a/test/lpf_8_test.cc
+++ b/test/lpf_8_test.cc
@@ -20,11 +20,11 @@
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-#include "vp10/common/entropy.h"
-#include "vp10/common/loopfilter.h"
-#include "vpx/vpx_integer.h"
+#include "av1/common/entropy.h"
+#include "av1/common/loopfilter.h"
+#include "aom/vpx_integer.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 // Horizontally and Vertically need 32x32: 8  Coeffs preceeding filtered section
@@ -63,7 +63,7 @@
     mask_ = (1 << bit_depth_) - 1;
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   int bit_depth_;
@@ -82,7 +82,7 @@
     mask_ = (1 << bit_depth_) - 1;
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   int bit_depth_;
diff --git a/test/masked_sad_test.cc b/test/masked_sad_test.cc
index c5b5081..b9af5ad 100644
--- a/test/masked_sad_test.cc
+++ b/test/masked_sad_test.cc
@@ -20,9 +20,9 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 const int number_of_iterations = 500;
@@ -40,7 +40,7 @@
     ref_maskedSAD_op_ = GET_PARAM(1);
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   MaskedSADFunc maskedSAD_op_;
@@ -97,7 +97,7 @@
     ref_maskedSAD_op_ = GET_PARAM(1);
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   HighbdMaskedSADFunc maskedSAD_op_;
diff --git a/test/masked_variance_test.cc b/test/masked_variance_test.cc
index 131599f..36fde93 100644
--- a/test/masked_variance_test.cc
+++ b/test/masked_variance_test.cc
@@ -20,12 +20,12 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_codec.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_dsp/vpx_filter.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom/vpx_codec.h"
+#include "aom/vpx_integer.h"
+#include "aom_dsp/vpx_filter.h"
+#include "aom_mem/vpx_mem.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 const int number_of_iterations = 500;
@@ -47,7 +47,7 @@
     ref_func_ = GET_PARAM(1);
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   MaskedVarianceFunc opt_func_;
@@ -142,7 +142,7 @@
     ref_func_ = GET_PARAM(1);
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   MaskedSubPixelVarianceFunc opt_func_;
@@ -262,7 +262,7 @@
     bit_depth_ = GET_PARAM(2);
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   MaskedVarianceFunc opt_func_;
@@ -361,7 +361,7 @@
     bit_depth_ = GET_PARAM(2);
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   MaskedSubPixelVarianceFunc opt_func_;
diff --git a/test/md5_helper.h b/test/md5_helper.h
index ef310a2..b995619 100644
--- a/test/md5_helper.h
+++ b/test/md5_helper.h
@@ -12,9 +12,9 @@
 #define TEST_MD5_HELPER_H_
 
 #include "./md5_utils.h"
-#include "vpx/vpx_decoder.h"
+#include "aom/vpx_decoder.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 class MD5 {
  public:
   MD5() { MD5Init(&md5_); }
@@ -70,6 +70,6 @@
   MD5Context md5_;
 };
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #endif  // TEST_MD5_HELPER_H_
diff --git a/test/minmax_test.cc b/test/minmax_test.cc
index e51c9fd..026f79a 100644
--- a/test/minmax_test.cc
+++ b/test/minmax_test.cc
@@ -14,14 +14,14 @@
 #include "third_party/googletest/src/include/gtest/gtest.h"
 
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #include "test/acm_random.h"
 #include "test/register_state_check.h"
 
 namespace {
 
-using ::libvpx_test::ACMRandom;
+using ::libaom_test::ACMRandom;
 
 typedef void (*MinMaxFunc)(const uint8_t *a, int a_stride, const uint8_t *b,
                            int b_stride, int *min, int *max);
diff --git a/test/obmc_sad_test.cc b/test/obmc_sad_test.cc
index de80373..c47bd26 100644
--- a/test/obmc_sad_test.cc
+++ b/test/obmc_sad_test.cc
@@ -15,11 +15,11 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
 
-using libvpx_test::FunctionEquivalenceTest;
+using libaom_test::FunctionEquivalenceTest;
 
 namespace {
 
@@ -28,7 +28,7 @@
 
 typedef unsigned int (*ObmcSadF)(const uint8_t *pre, int pre_stride,
                                  const int32_t *wsrc, const int32_t *mask);
-typedef libvpx_test::FuncParam<ObmcSadF> TestFuncs;
+typedef libaom_test::FuncParam<ObmcSadF> TestFuncs;
 
 ////////////////////////////////////////////////////////////////////////////////
 // 8 bit
diff --git a/test/obmc_variance_test.cc b/test/obmc_variance_test.cc
index 2bddcd2..ff4dd4a 100644
--- a/test/obmc_variance_test.cc
+++ b/test/obmc_variance_test.cc
@@ -16,12 +16,12 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 #define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
 
-using libvpx_test::ACMRandom;
-using libvpx_test::FunctionEquivalenceTest;
+using libaom_test::ACMRandom;
+using libaom_test::FunctionEquivalenceTest;
 
 namespace {
 
@@ -31,7 +31,7 @@
 typedef unsigned int (*ObmcVarF)(const uint8_t *pre, int pre_stride,
                                  const int32_t *wsrc, const int32_t *mask,
                                  unsigned int *sse);
-typedef libvpx_test::FuncParam<ObmcVarF> TestFuncs;
+typedef libaom_test::FuncParam<ObmcVarF> TestFuncs;
 
 ////////////////////////////////////////////////////////////////////////////////
 // 8 bit
diff --git a/test/partial_idct_test.cc b/test/partial_idct_test.cc
index 439888d..8d3bd72 100644
--- a/test/partial_idct_test.cc
+++ b/test/partial_idct_test.cc
@@ -20,11 +20,11 @@
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-#include "vp10/common/blockd.h"
-#include "vp10/common/scan.h"
-#include "vpx/vpx_integer.h"
+#include "av1/common/blockd.h"
+#include "av1/common/scan.h"
+#include "aom/vpx_integer.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 typedef void (*FwdTxfmFunc)(const int16_t *in, tran_low_t *out, int stride);
@@ -43,7 +43,7 @@
     last_nonzero_ = GET_PARAM(4);
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   int last_nonzero_;
diff --git a/test/quantize_test.cc b/test/quantize_test.cc
index 0232ab9..bfebdc5 100644
--- a/test/quantize_test.cc
+++ b/test/quantize_test.cc
@@ -22,8 +22,8 @@
 #include "vp8/encoder/block.h"
 #include "vp8/encoder/onyx_int.h"
 #include "vp8/encoder/quantize.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom/vpx_integer.h"
+#include "aom_mem/vpx_mem.h"
 
 namespace {
 #if !CONFIG_AOM_QM
@@ -35,7 +35,7 @@
 
 typedef std::tr1::tuple<VP8Quantize, VP8Quantize> VP8QuantizeParam;
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 using std::tr1::make_tuple;
 
 // Create and populate a VP8_COMP instance which has a complete set of
@@ -47,7 +47,7 @@
     vp8_comp_ = NULL;
     vpx_free(macroblockd_dst_);
     macroblockd_dst_ = NULL;
-    libvpx_test::ClearSystemState();
+    libaom_test::ClearSystemState();
   }
 
  protected:
diff --git a/test/realtime_test.cc b/test/realtime_test.cc
index 63f1ac3..d48f7fb 100644
--- a/test/realtime_test.cc
+++ b/test/realtime_test.cc
@@ -20,8 +20,8 @@
 const int kFramesToEncode = 2;
 
 class RealtimeTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> {
  protected:
   RealtimeTest() : EncoderTest(GET_PARAM(0)), frame_packets_(0) {}
   virtual ~RealtimeTest() {}
@@ -29,7 +29,7 @@
   virtual void SetUp() {
     InitializeConfig();
     cfg_.g_lag_in_frames = 0;
-    SetMode(::libvpx_test::kRealTime);
+    SetMode(::libaom_test::kRealTime);
   }
 
   virtual void BeginPassHook(unsigned int /*pass*/) {
@@ -48,7 +48,7 @@
 };
 
 TEST_P(RealtimeTest, RealtimeFirstPassProducesFrames) {
-  ::libvpx_test::RandomVideoSource video;
+  ::libaom_test::RandomVideoSource video;
   video.SetSize(kVideoSourceWidth, kVideoSourceHeight);
   video.set_limit(kFramesToEncode);
   ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
@@ -56,8 +56,8 @@
 }
 
 VP8_INSTANTIATE_TEST_CASE(RealtimeTest,
-                          ::testing::Values(::libvpx_test::kRealTime));
+                          ::testing::Values(::libaom_test::kRealTime));
 VP9_INSTANTIATE_TEST_CASE(RealtimeTest,
-                          ::testing::Values(::libvpx_test::kRealTime));
+                          ::testing::Values(::libaom_test::kRealTime));
 
 }  // namespace
diff --git a/test/reconintra_predictors_test.cc b/test/reconintra_predictors_test.cc
index 7f9fc8d..cddf3c1 100644
--- a/test/reconintra_predictors_test.cc
+++ b/test/reconintra_predictors_test.cc
@@ -15,12 +15,12 @@
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-#include "vp10/common/enums.h"
+#include "av1/common/enums.h"
 
 namespace {
 
 using std::tr1::tuple;
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 typedef void (*Predictor)(uint8_t *dst, ptrdiff_t stride, int bs,
                           const uint8_t *above, const uint8_t *left);
@@ -76,7 +76,7 @@
     delete[] alloc_;
     delete[] predRef_;
     delete[] pred_;
-    libvpx_test::ClearSystemState();
+    libaom_test::ClearSystemState();
   }
 
  protected:
@@ -170,7 +170,7 @@
     delete[] alloc_;
     delete[] predRef_;
     delete[] pred_;
-    libvpx_test::ClearSystemState();
+    libaom_test::ClearSystemState();
   }
 
  protected:
diff --git a/test/register_state_check.h b/test/register_state_check.h
index a6744b7..4ec53f4 100644
--- a/test/register_state_check.h
+++ b/test/register_state_check.h
@@ -13,7 +13,7 @@
 
 #include "third_party/googletest/src/include/gtest/gtest.h"
 #include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 
 // ASM_REGISTER_STATE_CHECK(asm_function)
 //   Minimally validates the environment pre & post function execution. This
@@ -40,7 +40,7 @@
   return (lhs.Low == rhs.Low && lhs.High == rhs.High);
 }
 
-namespace libvpx_test {
+namespace libaom_test {
 
 // Compares the state of xmm[6-15] at construction with their state at
 // destruction. These registers should be preserved by the callee on
@@ -82,11 +82,11 @@
 
 #define ASM_REGISTER_STATE_CHECK(statement)    \
   do {                                         \
-    libvpx_test::RegisterStateCheck reg_check; \
+    libaom_test::RegisterStateCheck reg_check; \
     statement;                                 \
   } while (false)
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #elif defined(CONFIG_SHARED) && defined(HAVE_NEON_ASM) && \
     defined(CONFIG_VP10) && !CONFIG_SHARED && HAVE_NEON_ASM && CONFIG_VP10
@@ -96,7 +96,7 @@
 void vpx_push_neon(int64_t *store);
 }
 
-namespace libvpx_test {
+namespace libaom_test {
 
 // Compares the state of d8-d15 at construction with their state at
 // destruction. These registers should be preserved by the callee on
@@ -130,27 +130,27 @@
 
 #define ASM_REGISTER_STATE_CHECK(statement)    \
   do {                                         \
-    libvpx_test::RegisterStateCheck reg_check; \
+    libaom_test::RegisterStateCheck reg_check; \
     statement;                                 \
   } while (false)
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #else
 
-namespace libvpx_test {
+namespace libaom_test {
 
 class RegisterStateCheck {};
 #define ASM_REGISTER_STATE_CHECK(statement) statement
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #endif  // _WIN64
 
 #if ARCH_X86 || ARCH_X86_64
 #if defined(__GNUC__)
 
-namespace libvpx_test {
+namespace libaom_test {
 
 // Checks the FPU tag word pre/post execution to ensure emms has been called.
 class RegisterStateCheckMMX {
@@ -179,11 +179,11 @@
 
 #define API_REGISTER_STATE_CHECK(statement)       \
   do {                                            \
-    libvpx_test::RegisterStateCheckMMX reg_check; \
+    libaom_test::RegisterStateCheckMMX reg_check; \
     ASM_REGISTER_STATE_CHECK(statement);          \
   } while (false)
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #endif  // __GNUC__
 #endif  // ARCH_X86 || ARCH_X86_64
diff --git a/test/resize_test.cc b/test/resize_test.cc
index 3738a09..9b4808b 100644
--- a/test/resize_test.cc
+++ b/test/resize_test.cc
@@ -243,7 +243,7 @@
   *h = initial_h;
 }
 
-class ResizingVideoSource : public ::libvpx_test::DummyVideoSource {
+class ResizingVideoSource : public ::libaom_test::DummyVideoSource {
  public:
   ResizingVideoSource() {
     SetSize(kInitialWidth, kInitialHeight);
@@ -265,8 +265,8 @@
 };
 
 class ResizeTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWithParam<libaom_test::TestMode> {
  protected:
   ResizeTest() : EncoderTest(GET_PARAM(0)) {}
 
@@ -336,8 +336,8 @@
 #endif
   }
 
-  virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
-                                  libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(libaom_test::VideoSource *video,
+                                  libaom_test::Encoder *encoder) {
     if (change_config_) {
       int new_q = 60;
       if (video->frame() == 0) {
@@ -389,7 +389,7 @@
 };
 
 TEST_P(ResizeInternalTest, TestInternalResizeWorks) {
-  ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+  ::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                        30, 1, 0, 10);
   init_flags_ = VPX_CODEC_USE_PSNR;
   change_config_ = false;
@@ -418,7 +418,7 @@
 }
 
 TEST_P(ResizeInternalTest, TestInternalResizeChangeConfig) {
-  ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+  ::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                        30, 1, 0, 10);
   cfg_.g_w = 352;
   cfg_.g_h = 288;
@@ -427,14 +427,14 @@
 }
 
 class ResizeRealtimeTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> {
  protected:
   ResizeRealtimeTest() : EncoderTest(GET_PARAM(0)) {}
   virtual ~ResizeRealtimeTest() {}
 
-  virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
-                                  libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(libaom_test::VideoSource *video,
+                                  libaom_test::Encoder *encoder) {
     if (video->frame() == 0) {
       encoder->Control(VP9E_SET_AQ_MODE, 3);
       encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
@@ -525,7 +525,7 @@
 // Run at low bitrate, with resize_allowed = 1, and verify that we get
 // one resize down event.
 TEST_P(ResizeRealtimeTest, TestInternalResizeDown) {
-  ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+  ::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                        30, 1, 0, 299);
   DefaultConfig();
   cfg_.g_w = 352;
@@ -563,7 +563,7 @@
 // Start at low target bitrate, raise the bitrate in the middle of the clip,
 // scaling-up should occur after bitrate changed.
 TEST_P(ResizeRealtimeTest, TestInternalResizeDownUpChangeBitRate) {
-  ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+  ::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                        30, 1, 0, 359);
   DefaultConfig();
   cfg_.g_w = 352;
@@ -641,8 +641,8 @@
 #endif
   }
 
-  virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
-                                  libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(libaom_test::VideoSource *video,
+                                  libaom_test::Encoder *encoder) {
     if (CspForFrameNumber(video->frame()) != VPX_IMG_FMT_I420 &&
         cfg_.g_profile != 1) {
       cfg_.g_profile = 1;
@@ -680,7 +680,7 @@
 #endif
 };
 
-class ResizingCspVideoSource : public ::libvpx_test::DummyVideoSource {
+class ResizingCspVideoSource : public ::libaom_test::DummyVideoSource {
  public:
   ResizingCspVideoSource() {
     SetSize(kInitialWidth, kInitialHeight);
@@ -706,12 +706,12 @@
 }
 
 VP10_INSTANTIATE_TEST_CASE(ResizeTest,
-                           ::testing::Values(::libvpx_test::kRealTime));
+                           ::testing::Values(::libaom_test::kRealTime));
 VP10_INSTANTIATE_TEST_CASE(ResizeInternalTest,
-                           ::testing::Values(::libvpx_test::kOnePassBest));
+                           ::testing::Values(::libaom_test::kOnePassBest));
 VP10_INSTANTIATE_TEST_CASE(ResizeRealtimeTest,
-                           ::testing::Values(::libvpx_test::kRealTime),
+                           ::testing::Values(::libaom_test::kRealTime),
                            ::testing::Range(5, 9));
 VP10_INSTANTIATE_TEST_CASE(ResizeCspTest,
-                           ::testing::Values(::libvpx_test::kRealTime));
+                           ::testing::Values(::libaom_test::kRealTime));
 }  // namespace
diff --git a/test/resize_util.sh b/test/resize_util.sh
index 5e47271..0c5851d 100755
--- a/test/resize_util.sh
+++ b/test/resize_util.sh
@@ -8,7 +8,7 @@
 ##  in the file PATENTS.  All contributing project authors may
 ##  be found in the AUTHORS file in the root of the source tree.
 ##
-##  This file tests the libvpx resize_util example code. To add new tests to
+##  This file tests the libaom resize_util example code. To add new tests to
 ##  this file, do the following:
 ##    1. Write a shell function (this is your test).
 ##    2. Add the function to resize_util_tests (on a new line).
@@ -26,7 +26,7 @@
 # Resizes $YUV_RAW_INPUT using the resize_util example. $1 is the output
 # dimensions that will be passed to resize_util.
 resize_util() {
-  local resizer="${LIBVPX_BIN_PATH}/resize_util${VPX_TEST_EXE_SUFFIX}"
+  local resizer="${LIBAOM_BIN_PATH}/resize_util${VPX_TEST_EXE_SUFFIX}"
   local output_file="${VPX_TEST_OUTPUT_DIR}/resize_util.raw"
   local frames_to_resize="10"
   local target_dimensions="$1"
diff --git a/test/sad_test.cc b/test/sad_test.cc
index 1e6295d..8276cd4 100644
--- a/test/sad_test.cc
+++ b/test/sad_test.cc
@@ -20,9 +20,9 @@
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-#include "vpx/vpx_codec.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_codec.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
 typedef unsigned int (*SadMxNFunc)(const uint8_t *src_ptr, int src_stride,
                                    const uint8_t *ref_ptr, int ref_stride);
@@ -38,7 +38,7 @@
                              uint32_t *sad_array);
 typedef std::tr1::tuple<int, int, SadMxNx4Func, int> SadMxNx4Param;
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 class SADTestBase : public ::testing::Test {
@@ -76,7 +76,7 @@
     second_pred16_ = NULL;
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   // Handle up to 4 128x128 blocks, with stride up to 256
diff --git a/test/set_maps.sh b/test/set_maps.sh
index e7c8d43..b50453e 100755
--- a/test/set_maps.sh
+++ b/test/set_maps.sh
@@ -8,7 +8,7 @@
 ##  in the file PATENTS.  All contributing project authors may
 ##  be found in the AUTHORS file in the root of the source tree.
 ##
-##  This file tests the libvpx set_maps example. To add new tests to this file,
+##  This file tests the libaom set_maps example. To add new tests to this file,
 ##  do the following:
 ##    1. Write a shell function (this is your test).
 ##    2. Add the function to set_maps_tests (on a new line).
@@ -16,14 +16,14 @@
 . $(dirname $0)/tools_common.sh
 
 # Environment check: $YUV_RAW_INPUT is required, and set_maps must exist in
-# $LIBVPX_BIN_PATH.
+# $LIBAOM_BIN_PATH.
 set_maps_verify_environment() {
   if [ ! -e "${YUV_RAW_INPUT}" ]; then
     echo "Libvpx test data must exist in LIBVPX_TEST_DATA_PATH."
     return 1
   fi
   if [ -z "$(vpx_tool_path set_maps)" ]; then
-    elog "set_maps not found. It must exist in LIBVPX_BIN_PATH or its parent."
+    elog "set_maps not found. It must exist in LIBAOM_BIN_PATH or its parent."
     return 1
   fi
 }
diff --git a/test/simple_decoder.sh b/test/simple_decoder.sh
index 7eeaf71..0955c92 100755
--- a/test/simple_decoder.sh
+++ b/test/simple_decoder.sh
@@ -8,7 +8,7 @@
 ##  in the file PATENTS.  All contributing project authors may
 ##  be found in the AUTHORS file in the root of the source tree.
 ##
-##  This file tests the libvpx simple_decoder example code. To add new tests to
+##  This file tests the libaom simple_decoder example code. To add new tests to
 ##  this file, do the following:
 ##    1. Write a shell function (this is your test).
 ##    2. Add the function to simple_decoder_tests (on a new line).
@@ -27,7 +27,7 @@
 # Runs simple_decoder using $1 as input file. $2 is the codec name, and is used
 # solely to name the output file.
 simple_decoder() {
-  local decoder="${LIBVPX_BIN_PATH}/simple_decoder${VPX_TEST_EXE_SUFFIX}"
+  local decoder="${LIBAOM_BIN_PATH}/simple_decoder${VPX_TEST_EXE_SUFFIX}"
   local input_file="$1"
   local codec="$2"
   local output_file="${VPX_TEST_OUTPUT_DIR}/simple_decoder_${codec}.raw"
diff --git a/test/simple_encoder.sh b/test/simple_encoder.sh
index ee633ae..e0da0ec 100755
--- a/test/simple_encoder.sh
+++ b/test/simple_encoder.sh
@@ -8,7 +8,7 @@
 ##  in the file PATENTS.  All contributing project authors may
 ##  be found in the AUTHORS file in the root of the source tree.
 ##
-##  This file tests the libvpx simple_encoder example. To add new tests to this
+##  This file tests the libaom simple_encoder example. To add new tests to this
 ##  file, do the following:
 ##    1. Write a shell function (this is your test).
 ##    2. Add the function to simple_encoder_tests (on a new line).
@@ -25,7 +25,7 @@
 
 # Runs simple_encoder using the codec specified by $1 with a frame limit of 100.
 simple_encoder() {
-  local encoder="${LIBVPX_BIN_PATH}/simple_encoder${VPX_TEST_EXE_SUFFIX}"
+  local encoder="${LIBAOM_BIN_PATH}/simple_encoder${VPX_TEST_EXE_SUFFIX}"
   local codec="$1"
   local output_file="${VPX_TEST_OUTPUT_DIR}/simple_encoder_${codec}.ivf"
 
diff --git a/test/subtract_test.cc b/test/subtract_test.cc
index 498b6fa..a6ba557 100644
--- a/test/subtract_test.cc
+++ b/test/subtract_test.cc
@@ -17,10 +17,10 @@
 #include "test/register_state_check.h"
 #include "test/util.h"
 #if CONFIG_VP10
-#include "vp10/common/blockd.h"
+#include "av1/common/blockd.h"
 #endif
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
 #define USE_SPEED_TEST (0)
 
@@ -33,10 +33,10 @@
 
 class VP9SubtractBlockTest : public ::testing::TestWithParam<SubtractFunc> {
  public:
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 };
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 TEST_P(VP9SubtractBlockTest, SimpleSubtract) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
diff --git a/test/sum_squares_test.cc b/test/sum_squares_test.cc
index 4991a04..c4ddf57 100644
--- a/test/sum_squares_test.cc
+++ b/test/sum_squares_test.cc
@@ -16,15 +16,15 @@
 
 #include "./vpx_config.h"
 #include "./vpx_dsp_rtcd.h"
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 #include "test/acm_random.h"
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
 #include "test/function_equivalence_test.h"
 
-using libvpx_test::ACMRandom;
-using libvpx_test::FunctionEquivalenceTest;
+using libaom_test::ACMRandom;
+using libaom_test::FunctionEquivalenceTest;
 
 namespace {
 const int kNumIterations = 10000;
@@ -32,14 +32,14 @@
 static const int16_t kInt13Max = (1 << 12) - 1;
 
 typedef uint64_t (*SSI16Func)(const int16_t *src, int stride, int size);
-typedef libvpx_test::FuncParam<SSI16Func> TestFuncs;
+typedef libaom_test::FuncParam<SSI16Func> TestFuncs;
 
 class SumSquaresTest : public ::testing::TestWithParam<TestFuncs> {
  public:
   virtual ~SumSquaresTest() {}
   virtual void SetUp() { params_ = this->GetParam(); }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   TestFuncs params_;
@@ -130,7 +130,7 @@
 //////////////////////////////////////////////////////////////////////////////
 
 typedef uint64_t (*F1D)(const int16_t *src, uint32_t N);
-typedef libvpx_test::FuncParam<F1D> TestFuncs1D;
+typedef libaom_test::FuncParam<F1D> TestFuncs1D;
 
 class SumSquares1DTest : public FunctionEquivalenceTest<F1D> {
  protected:
diff --git a/test/superframe_test.cc b/test/superframe_test.cc
index 7580375..2f7132a 100644
--- a/test/superframe_test.cc
+++ b/test/superframe_test.cc
@@ -21,12 +21,12 @@
 const int kTileCols = 2;
 const int kTileRows = 3;
 
-typedef std::tr1::tuple<libvpx_test::TestMode, int, int, int>
+typedef std::tr1::tuple<libaom_test::TestMode, int, int, int>
     SuperframeTestParam;
 
 class SuperframeTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWithParam<SuperframeTestParam> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWithParam<SuperframeTestParam> {
  protected:
   SuperframeTest()
       : EncoderTest(GET_PARAM(0)), modified_buf_(NULL), last_sf_pts_(0) {}
@@ -35,7 +35,7 @@
   virtual void SetUp() {
     InitializeConfig();
     const SuperframeTestParam input = GET_PARAM(1);
-    const libvpx_test::TestMode mode = std::tr1::get<kTestMode>(input);
+    const libaom_test::TestMode mode = std::tr1::get<kTestMode>(input);
     const int syntax = std::tr1::get<kSuperframeSyntax>(input);
     SetMode(mode);
     sf_count_ = 0;
@@ -47,8 +47,8 @@
 
   virtual void TearDown() { delete[] modified_buf_; }
 
-  virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
-                                  libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(libaom_test::VideoSource *video,
+                                  libaom_test::Encoder *encoder) {
     if (video->frame() == 1) {
       encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
       encoder->Control(VP8E_SET_CPUUSED, 2);
@@ -104,7 +104,7 @@
   sf_count_max_ = 0;  // early exit on successful test.
   cfg_.g_lag_in_frames = 25;
 
-  ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+  ::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
                                        30, 1, 0, 40);
   ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 #if CONFIG_EXT_REFS
@@ -128,7 +128,7 @@
 const int tile_row_values[] = { 1, 2, 32 };
 VP10_INSTANTIATE_TEST_CASE(
     SuperframeTest,
-    ::testing::Combine(::testing::Values(::libvpx_test::kTwoPassGood),
+    ::testing::Combine(::testing::Values(::libaom_test::kTwoPassGood),
                        ::testing::Values(1),
                        ::testing::ValuesIn(tile_col_values),
                        ::testing::ValuesIn(tile_row_values)));
@@ -136,7 +136,7 @@
 #if !CONFIG_ANS
 VP10_INSTANTIATE_TEST_CASE(
     SuperframeTest,
-    ::testing::Combine(::testing::Values(::libvpx_test::kTwoPassGood),
+    ::testing::Combine(::testing::Values(::libaom_test::kTwoPassGood),
                        ::testing::Values(1), ::testing::Values(0),
                        ::testing::Values(0)));
 #endif  // !CONFIG_ANS
diff --git a/test/test-data.mk b/test/test-data.mk
index c03159c..fd33627 100644
--- a/test/test-data.mk
+++ b/test/test-data.mk
@@ -1,118 +1,116 @@
-LIBVPX_TEST_SRCS-yes += test-data.mk
+LIBAOM_TEST_SRCS-yes += test-data.mk
 
 # Encoder test source
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += hantro_collage_w352h288.yuv
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += hantro_odd.yuv
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += hantro_collage_w352h288.yuv
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += hantro_odd.yuv
 
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_420.y4m
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_422.y4m
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_444.y4m
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_440.yuv
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_420.y4m
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_422.y4m
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_444.y4m
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_440.yuv
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_420_a10-1.y4m
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_420.y4m
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_422.y4m
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_444.y4m
-LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_440.yuv
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_420.y4m
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_422.y4m
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_444.y4m
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_440.yuv
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_420.y4m
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_422.y4m
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_444.y4m
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_440.yuv
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_420_a10-1.y4m
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_420.y4m
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_422.y4m
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_444.y4m
+LIBAOM_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_440.yuv
 
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += desktop_credits.y4m
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += niklas_1280_720_30.y4m
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += rush_hour_444.y4m
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += screendata.y4m
-
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += desktop_credits.y4m
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += desktop_credits.y4m
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += niklas_1280_720_30.y4m
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += rush_hour_444.y4m
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += screendata.y4m
 
 ifeq ($(CONFIG_DECODE_PERF_TESTS),yes)
 # Encode / Decode test
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += niklas_1280_720_30.yuv
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += niklas_1280_720_30.yuv
 # BBB VP9 streams
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_426x240_tile_1x1_180kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_640x360_tile_1x2_337kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_854x480_tile_1x2_651kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_1280x720_tile_1x4_1310kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_1920x1080_tile_1x1_2581kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_1920x1080_tile_1x4_2586kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_1920x1080_tile_1x4_fpm_2304kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_426x240_tile_1x1_180kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_640x360_tile_1x2_337kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_854x480_tile_1x2_651kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_1280x720_tile_1x4_1310kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_1920x1080_tile_1x1_2581kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_1920x1080_tile_1x4_2586kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-bbb_1920x1080_tile_1x4_fpm_2304kbps.webm
 # Sintel VP9 streams
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_426x182_tile_1x1_171kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_640x272_tile_1x2_318kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_854x364_tile_1x2_621kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_1280x546_tile_1x4_1257kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_1920x818_tile_1x4_fpm_2279kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_426x182_tile_1x1_171kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_640x272_tile_1x2_318kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_854x364_tile_1x2_621kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_1280x546_tile_1x4_1257kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-sintel_1920x818_tile_1x4_fpm_2279kbps.webm
 # TOS VP9 streams
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_426x178_tile_1x1_181kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_640x266_tile_1x2_336kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_854x356_tile_1x2_656kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_854x356_tile_1x2_fpm_546kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_1280x534_tile_1x4_1306kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_1280x534_tile_1x4_fpm_952kbps.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_1920x800_tile_1x4_fpm_2335kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_426x178_tile_1x1_181kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_640x266_tile_1x2_336kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_854x356_tile_1x2_656kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_854x356_tile_1x2_fpm_546kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_1280x534_tile_1x4_1306kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_1280x534_tile_1x4_fpm_952kbps.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-tos_1920x800_tile_1x4_fpm_2335kbps.webm
 endif  # CONFIG_DECODE_PERF_TESTS
 
 ifeq ($(CONFIG_ENCODE_PERF_TESTS),yes)
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += desktop_640_360_30.yuv
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += kirland_640_480_30.yuv
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += macmarcomoving_640_480_30.yuv
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += macmarcostationary_640_480_30.yuv
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += niklas_1280_720_30.yuv
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += niklas_640_480_30.yuv
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += tacomanarrows_640_480_30.yuv
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += tacomasmallcameramovement_640_480_30.yuv
-LIBVPX_TEST_DATA-$(CONFIG_VP10_ENCODER) += thaloundeskmtg_640_480_30.yuv
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += desktop_640_360_30.yuv
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += kirland_640_480_30.yuv
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += macmarcomoving_640_480_30.yuv
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += macmarcostationary_640_480_30.yuv
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += niklas_1280_720_30.yuv
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += niklas_640_480_30.yuv
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += tacomanarrows_640_480_30.yuv
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += tacomasmallcameramovement_640_480_30.yuv
+LIBAOM_TEST_DATA-$(CONFIG_VP10_ENCODER) += thaloundeskmtg_640_480_30.yuv
 endif  # CONFIG_ENCODE_PERF_TESTS
 
 # sort and remove duplicates
-LIBVPX_TEST_DATA-yes := $(sort $(LIBVPX_TEST_DATA-yes))
+LIBAOM_TEST_DATA-yes := $(sort $(LIBAOM_TEST_DATA-yes))
 
 # VP9 dynamic resizing test (decoder)
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_5_1-2.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_5_1-2.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_5_3-4.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_5_3-4.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_7_1-2.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_7_1-2.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_7_3-4.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_7_3-4.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_5_1-2.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_5_1-2.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_5_3-4.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_5_3-4.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_7_1-2.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_7_1-2.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_7_3-4.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_7_3-4.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_5_1-2.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_5_1-2.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_5_3-4.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_5_3-4.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_7_1-2.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_7_1-2.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_7_3-4.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_7_3-4.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_5_1-2.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_5_1-2.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_5_3-4.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_5_3-4.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_7_1-2.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_7_1-2.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_7_3-4.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_7_3-4.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_5_1-2.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_5_1-2.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_5_3-4.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_5_3-4.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_7_1-2.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_7_1-2.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_7_3-4.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_7_3-4.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_5_1-2.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_5_1-2.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_5_3-4.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_5_3-4.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_7_1-2.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_7_1-2.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_7_3-4.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_7_3-4.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_5_1-2.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_5_1-2.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_5_3-4.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_5_3-4.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_7_1-2.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_7_1-2.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_7_3-4.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_7_3-4.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_5_1-2.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_5_1-2.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_5_3-4.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_5_3-4.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_7_1-2.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_7_1-2.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_7_3-4.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_7_3-4.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_5_1-2.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_5_1-2.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_5_3-4.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_5_3-4.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_7_1-2.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_7_1-2.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_7_3-4.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_7_3-4.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_5_1-2.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_5_1-2.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_5_3-4.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_5_3-4.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_7_1-2.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_7_1-2.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_7_3-4.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_7_3-4.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_5_1-2.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_5_1-2.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_5_3-4.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_5_3-4.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_7_1-2.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_7_1-2.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_7_3-4.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_7_3-4.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_5_1-2.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_5_1-2.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_5_3-4.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_5_3-4.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_7_1-2.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_7_1-2.webm.md5
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_7_3-4.webm
+LIBAOM_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_7_3-4.webm.md5
diff --git a/test/test.mk b/test/test.mk
index feb3f49..d7f2391 100644
--- a/test/test.mk
+++ b/test/test.mk
@@ -1,53 +1,53 @@
-LIBVPX_TEST_SRCS-yes += acm_random.h
-LIBVPX_TEST_SRCS-yes += clear_system_state.h
-LIBVPX_TEST_SRCS-yes += codec_factory.h
-LIBVPX_TEST_SRCS-yes += md5_helper.h
-LIBVPX_TEST_SRCS-yes += register_state_check.h
-LIBVPX_TEST_SRCS-yes += test.mk
-LIBVPX_TEST_SRCS-yes += test_libvpx.cc
-LIBVPX_TEST_SRCS-yes += util.h
-LIBVPX_TEST_SRCS-yes += video_source.h
-LIBVPX_TEST_SRCS-yes += transform_test_base.h
-LIBVPX_TEST_SRCS-yes += function_equivalence_test.h
+LIBAOM_TEST_SRCS-yes += acm_random.h
+LIBAOM_TEST_SRCS-yes += clear_system_state.h
+LIBAOM_TEST_SRCS-yes += codec_factory.h
+LIBAOM_TEST_SRCS-yes += md5_helper.h
+LIBAOM_TEST_SRCS-yes += register_state_check.h
+LIBAOM_TEST_SRCS-yes += test.mk
+LIBAOM_TEST_SRCS-yes += test_libvpx.cc
+LIBAOM_TEST_SRCS-yes += util.h
+LIBAOM_TEST_SRCS-yes += video_source.h
+LIBAOM_TEST_SRCS-yes += transform_test_base.h
+LIBAOM_TEST_SRCS-yes += function_equivalence_test.h
 
 ##
 ## BLACK BOX TESTS
 ##
 ## Black box tests only use the public API.
 ##
-LIBVPX_TEST_SRCS-yes                   += ../md5_utils.h ../md5_utils.c
-LIBVPX_TEST_SRCS-$(CONFIG_DECODERS)    += ivf_video_source.h
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += ../y4minput.h ../y4minput.c
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += altref_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += aq_segment_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += datarate_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += encode_api_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += error_resilience_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += i420_video_source.h
-#LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += realtime_test.cc
-#LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += resize_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += y4m_video_source.h
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += yuv_video_source.h
+LIBAOM_TEST_SRCS-yes                   += ../md5_utils.h ../md5_utils.c
+LIBAOM_TEST_SRCS-$(CONFIG_DECODERS)    += ivf_video_source.h
+LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += ../y4minput.h ../y4minput.c
+LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += altref_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += aq_segment_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += datarate_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += encode_api_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += error_resilience_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += i420_video_source.h
+#LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += realtime_test.cc
+#LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += resize_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += y4m_video_source.h
+LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += yuv_video_source.h
 
-#LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += level_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += active_map_refresh_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += active_map_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += borders_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += cpu_speed_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += frame_size_tests.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += lossless_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += ethread_test.cc
+#LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += level_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += active_map_refresh_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += active_map_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += borders_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += cpu_speed_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += frame_size_tests.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += lossless_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += ethread_test.cc
 
-LIBVPX_TEST_SRCS-yes                   += decode_test_driver.cc
-LIBVPX_TEST_SRCS-yes                   += decode_test_driver.h
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += encode_test_driver.cc
-LIBVPX_TEST_SRCS-yes                   += encode_test_driver.h
+LIBAOM_TEST_SRCS-yes                   += decode_test_driver.cc
+LIBAOM_TEST_SRCS-yes                   += decode_test_driver.h
+LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += encode_test_driver.cc
+LIBAOM_TEST_SRCS-yes                   += encode_test_driver.h
 
 ## IVF writing.
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += ../ivfenc.c ../ivfenc.h
+LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += ../ivfenc.c ../ivfenc.h
 
 ## Y4m parsing.
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)    += y4m_test.cc ../y4menc.c ../y4menc.h
+LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS)    += y4m_test.cc ../y4menc.c ../y4menc.h
 
 ## WebM Parsing
 ifeq ($(CONFIG_WEBM_IO), yes)
@@ -55,32 +55,32 @@
 LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser/mkvreader.cc
 LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser/mkvparser.h
 LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser/mkvreader.h
-LIBVPX_TEST_SRCS-$(CONFIG_DECODERS)    += $(LIBWEBM_PARSER_SRCS)
-LIBVPX_TEST_SRCS-$(CONFIG_DECODERS)    += ../tools_common.h
-LIBVPX_TEST_SRCS-$(CONFIG_DECODERS)    += ../webmdec.cc
-LIBVPX_TEST_SRCS-$(CONFIG_DECODERS)    += ../webmdec.h
-LIBVPX_TEST_SRCS-$(CONFIG_DECODERS)    += webm_video_source.h
+LIBAOM_TEST_SRCS-$(CONFIG_DECODERS)    += $(LIBWEBM_PARSER_SRCS)
+LIBAOM_TEST_SRCS-$(CONFIG_DECODERS)    += ../tools_common.h
+LIBAOM_TEST_SRCS-$(CONFIG_DECODERS)    += ../webmdec.cc
+LIBAOM_TEST_SRCS-$(CONFIG_DECODERS)    += ../webmdec.h
+LIBAOM_TEST_SRCS-$(CONFIG_DECODERS)    += webm_video_source.h
 endif
 
-LIBVPX_TEST_SRCS-$(CONFIG_DECODERS)    += decode_api_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_DECODERS)    += decode_api_test.cc
 
 # Currently we only support decoder perf tests for vp9. Also they read from WebM
 # files, so WebM IO is required.
 ifeq ($(CONFIG_DECODE_PERF_TESTS)$(CONFIG_VP10_DECODER)$(CONFIG_WEBM_IO), \
       yesyesyes)
-LIBVPX_TEST_SRCS-yes                   += decode_perf_test.cc
+LIBAOM_TEST_SRCS-yes                   += decode_perf_test.cc
 endif
 
 # encode perf tests are vp9 only
 ifeq ($(CONFIG_ENCODE_PERF_TESTS)$(CONFIG_VP10_ENCODER), yesyes)
-LIBVPX_TEST_SRCS-yes += encode_perf_test.cc
+LIBAOM_TEST_SRCS-yes += encode_perf_test.cc
 endif
 
 ## Multi-codec / unconditional black box tests.
 ifeq ($(findstring yes,$(CONFIG_VP10_ENCODER)),yes)
-LIBVPX_TEST_SRCS-yes += active_map_refresh_test.cc
-LIBVPX_TEST_SRCS-yes += active_map_test.cc
-LIBVPX_TEST_SRCS-yes += end_to_end_test.cc
+LIBAOM_TEST_SRCS-yes += active_map_refresh_test.cc
+LIBAOM_TEST_SRCS-yes += active_map_test.cc
+LIBAOM_TEST_SRCS-yes += end_to_end_test.cc
 endif
 
 ##
@@ -97,87 +97,87 @@
 # These tests require both the encoder and decoder to be built.
 ifeq ($(CONFIG_VP10_ENCODER)$(CONFIG_VP10_DECODER),yesyes)
 # IDCT test currently depends on FDCT function
-LIBVPX_TEST_SRCS-yes                   += idct8x8_test.cc
-LIBVPX_TEST_SRCS-yes                   += partial_idct_test.cc
-LIBVPX_TEST_SRCS-yes                   += superframe_test.cc
-LIBVPX_TEST_SRCS-yes                   += tile_independence_test.cc
-LIBVPX_TEST_SRCS-yes                   += boolcoder_test.cc
-LIBVPX_TEST_SRCS-yes                   += divu_small_test.cc
-#LIBVPX_TEST_SRCS-yes                   += encoder_parms_get_to_decoder.cc
+LIBAOM_TEST_SRCS-yes                   += idct8x8_test.cc
+LIBAOM_TEST_SRCS-yes                   += partial_idct_test.cc
+LIBAOM_TEST_SRCS-yes                   += superframe_test.cc
+LIBAOM_TEST_SRCS-yes                   += tile_independence_test.cc
+LIBAOM_TEST_SRCS-yes                   += boolcoder_test.cc
+LIBAOM_TEST_SRCS-yes                   += divu_small_test.cc
+#LIBAOM_TEST_SRCS-yes                   += encoder_parms_get_to_decoder.cc
 endif
 
-#LIBVPX_TEST_SRCS-yes                   += convolve_test.cc
-LIBVPX_TEST_SRCS-yes                   += lpf_8_test.cc
-LIBVPX_TEST_SRCS-yes                   += intrapred_test.cc
-#LIBVPX_TEST_SRCS-$(CONFIG_VP10_DECODER) += vp9_thread_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += dct16x16_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += dct32x32_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += fdct4x4_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += fdct8x8_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += hadamard_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += minmax_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += variance_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += error_block_test.cc
-#LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp9_quantize_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += subtract_test.cc
+#LIBAOM_TEST_SRCS-yes                   += convolve_test.cc
+LIBAOM_TEST_SRCS-yes                   += lpf_8_test.cc
+LIBAOM_TEST_SRCS-yes                   += intrapred_test.cc
+#LIBAOM_TEST_SRCS-$(CONFIG_VP10_DECODER) += vp9_thread_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += dct16x16_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += dct32x32_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += fdct4x4_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += fdct8x8_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += hadamard_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += minmax_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += variance_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += error_block_test.cc
+#LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp9_quantize_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += subtract_test.cc
 
 ifeq ($(CONFIG_VP10_ENCODER)$(CONFIG_VP10_TEMPORAL_DENOISING),yesyes)
-LIBVPX_TEST_SRCS-$(HAVE_SSE2) += denoiser_sse2_test.cc
+LIBAOM_TEST_SRCS-$(HAVE_SSE2) += denoiser_sse2_test.cc
 endif
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += arf_freq_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += arf_freq_test.cc
 
 
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp10_inv_txfm_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp10_dct_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp10_fht4x4_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp10_fht8x8_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp10_fht16x16_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_ANS)          += vp10_ans_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_EXT_TILE)     += vp10_ext_tile_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp10_inv_txfm_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp10_dct_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp10_fht4x4_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp10_fht8x8_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp10_fht16x16_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_ANS)          += vp10_ans_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_EXT_TILE)     += vp10_ext_tile_test.cc
 
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += sum_squares_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += subtract_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += blend_a64_mask_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += blend_a64_mask_1d_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += sum_squares_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += subtract_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += blend_a64_mask_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += blend_a64_mask_1d_test.cc
 
 ifeq ($(CONFIG_EXT_INTER),yes)
-LIBVPX_TEST_SRCS-$(HAVE_SSSE3) += masked_variance_test.cc
-LIBVPX_TEST_SRCS-$(HAVE_SSSE3) += masked_sad_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp10_wedge_utils_test.cc
+LIBAOM_TEST_SRCS-$(HAVE_SSSE3) += masked_variance_test.cc
+LIBAOM_TEST_SRCS-$(HAVE_SSSE3) += masked_sad_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp10_wedge_utils_test.cc
 endif
 
 ifeq ($(CONFIG_EXT_INTRA),yes)
-LIBVPX_TEST_SRCS-$(HAVE_SSE4_1) += reconintra_predictors_test.cc
+LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += reconintra_predictors_test.cc
 endif
 
 ifeq ($(CONFIG_OBMC),yes)
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += obmc_sad_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += obmc_variance_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += obmc_sad_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10_ENCODER) += obmc_variance_test.cc
 endif
 
 ifeq ($(CONFIG_VP9_HIGHBITDEPTH),yes)
-LIBVPX_TEST_SRCS-$(HAVE_SSE4_1) += vp10_quantize_test.cc
-LIBVPX_TEST_SRCS-$(HAVE_SSE4_1) += vp10_highbd_iht_test.cc
+LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += vp10_quantize_test.cc
+LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += vp10_highbd_iht_test.cc
 endif # CONFIG_VP9_HIGHBITDEPTH
 endif # VP10
 
 ## Multi-codec / unconditional whitebox tests.
 
 ifeq ($(CONFIG_VP10_ENCODER),yes)
-LIBVPX_TEST_SRCS-yes += avg_test.cc
+LIBAOM_TEST_SRCS-yes += avg_test.cc
 endif
 ifeq ($(CONFIG_INTERNAL_STATS),yes)
-LIBVPX_TEST_SRCS-$(CONFIG_VP9_HIGHBITDEPTH) += hbd_metrics_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP9_HIGHBITDEPTH) += hbd_metrics_test.cc
 endif
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += sad_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10) += vp10_txfm_test.h
-LIBVPX_TEST_SRCS-$(CONFIG_VP10) += vp10_txfm_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10) += vp10_fwd_txfm1d_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10) += vp10_inv_txfm1d_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10) += vp10_fwd_txfm2d_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10) += vp10_inv_txfm2d_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10) += vp10_convolve_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP10) += vp10_convolve_optimz_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_ENCODERS) += sad_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10) += vp10_txfm_test.h
+LIBAOM_TEST_SRCS-$(CONFIG_VP10) += vp10_txfm_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10) += vp10_fwd_txfm1d_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10) += vp10_inv_txfm1d_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10) += vp10_fwd_txfm2d_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10) += vp10_inv_txfm2d_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10) += vp10_convolve_test.cc
+LIBAOM_TEST_SRCS-$(CONFIG_VP10) += vp10_convolve_optimz_test.cc
 
 TEST_INTRA_PRED_SPEED_SRCS-yes := test_intra_pred_speed.cc
 TEST_INTRA_PRED_SPEED_SRCS-yes += ../md5_utils.h ../md5_utils.c
diff --git a/test/test_intra_pred_speed.cc b/test/test_intra_pred_speed.cc
index 4306fab..41bc4ec 100644
--- a/test/test_intra_pred_speed.cc
+++ b/test/test_intra_pred_speed.cc
@@ -18,9 +18,9 @@
 #include "test/acm_random.h"
 #include "test/clear_system_state.h"
 #include "test/md5_helper.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem.h"
-#include "vpx_ports/vpx_timer.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/vpx_timer.h"
 
 // -----------------------------------------------------------------------------
 
@@ -40,7 +40,7 @@
                    const char *const pred_func_names[], int num_funcs,
                    const char *const signatures[], int block_size,
                    int num_pixels_per_test) {
-  libvpx_test::ACMRandom rnd(libvpx_test::ACMRandom::DeterministicSeed());
+  libaom_test::ACMRandom rnd(libaom_test::ACMRandom::DeterministicSeed());
   const int kBPS = 32;
   const int kTotalPixels = 32 * kBPS;
   DECLARE_ALIGNED(16, uint8_t, src[kTotalPixels]);
@@ -67,11 +67,11 @@
     for (int num_tests = 0; num_tests < kNumTests; ++num_tests) {
       pred_funcs[k](src, kBPS, above, left);
     }
-    libvpx_test::ClearSystemState();
+    libaom_test::ClearSystemState();
     vpx_usec_timer_mark(&timer);
     const int elapsed_time =
         static_cast<int>(vpx_usec_timer_elapsed(&timer) / 1000);
-    libvpx_test::MD5 md5;
+    libaom_test::MD5 md5;
     md5.Add(src, sizeof(src));
     printf("Mode %s[%12s]: %5d ms     MD5: %s\n", name, pred_func_names[k],
            elapsed_time, md5.Get());
diff --git a/test/test_libvpx.cc b/test/test_libvpx.cc
index 9867f9d..3f650ab 100644
--- a/test/test_libvpx.cc
+++ b/test/test_libvpx.cc
@@ -13,7 +13,7 @@
 
 #include "./vpx_config.h"
 #if ARCH_X86 || ARCH_X86_64
-#include "vpx_ports/x86.h"
+#include "aom_ports/x86.h"
 #endif
 extern "C" {
 #if CONFIG_VP10
diff --git a/test/tile_independence_test.cc b/test/tile_independence_test.cc
index 6fb8adb..4cb50c3 100644
--- a/test/tile_independence_test.cc
+++ b/test/tile_independence_test.cc
@@ -17,12 +17,12 @@
 #include "test/i420_video_source.h"
 #include "test/util.h"
 #include "test/md5_helper.h"
-#include "vpx_mem/vpx_mem.h"
+#include "aom_mem/vpx_mem.h"
 
 namespace {
 class TileIndependenceTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith2Params<int, int> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith2Params<int, int> {
  protected:
   TileIndependenceTest()
       : EncoderTest(GET_PARAM(0)), md5_fw_order_(), md5_inv_order_(),
@@ -53,11 +53,11 @@
 
   virtual void SetUp() {
     InitializeConfig();
-    SetMode(libvpx_test::kTwoPassGood);
+    SetMode(libaom_test::kTwoPassGood);
   }
 
-  virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
-                                  libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(libaom_test::VideoSource *video,
+                                  libaom_test::Encoder *encoder) {
     if (video->frame() == 1) {
       encoder->Control(VP9E_SET_TILE_COLUMNS, n_tile_cols_);
       encoder->Control(VP9E_SET_TILE_ROWS, n_tile_rows_);
@@ -65,13 +65,13 @@
     }
   }
 
-  virtual void SetCpuUsed(libvpx_test::Encoder *encoder) {
+  virtual void SetCpuUsed(libaom_test::Encoder *encoder) {
     static const int kCpuUsed = 3;
     encoder->Control(VP8E_SET_CPUUSED, kCpuUsed);
   }
 
-  void UpdateMD5(::libvpx_test::Decoder *dec, const vpx_codec_cx_pkt_t *pkt,
-                 ::libvpx_test::MD5 *md5) {
+  void UpdateMD5(::libaom_test::Decoder *dec, const vpx_codec_cx_pkt_t *pkt,
+                 ::libaom_test::MD5 *md5) {
     const vpx_codec_err_t res = dec->DecodeFrame(
         reinterpret_cast<uint8_t *>(pkt->data.frame.buf), pkt->data.frame.sz);
     if (res != VPX_CODEC_OK) {
@@ -94,7 +94,7 @@
     cfg_.g_lag_in_frames = 12;
     cfg_.rc_end_usage = VPX_VBR;
 
-    libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 704, 576,
+    libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 704, 576,
                                        timebase.den, timebase.num, 0, 5);
     ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 
@@ -103,8 +103,8 @@
     ASSERT_STREQ(md5_fw_str, md5_inv_str);
   }
 
-  ::libvpx_test::MD5 md5_fw_order_, md5_inv_order_;
-  ::libvpx_test::Decoder *fw_dec_, *inv_dec_;
+  ::libaom_test::MD5 md5_fw_order_, md5_inv_order_;
+  ::libaom_test::Decoder *fw_dec_, *inv_dec_;
 
  private:
   int n_tile_cols_;
@@ -117,7 +117,7 @@
 TEST_P(TileIndependenceTest, MD5Match) { DoTest(); }
 
 class TileIndependenceTestLarge : public TileIndependenceTest {
-  virtual void SetCpuUsed(libvpx_test::Encoder *encoder) {
+  virtual void SetCpuUsed(libaom_test::Encoder *encoder) {
     static const int kCpuUsed = 0;
     encoder->Control(VP8E_SET_CPUUSED, kCpuUsed);
   }
diff --git a/test/tools_common.sh b/test/tools_common.sh
index ce0b47b..2e10437 100755
--- a/test/tools_common.sh
+++ b/test/tools_common.sh
@@ -8,7 +8,7 @@
 ##  in the file PATENTS.  All contributing project authors may
 ##  be found in the AUTHORS file in the root of the source tree.
 ##
-##  This file contains shell code shared by test scripts for libvpx tools.
+##  This file contains shell code shared by test scripts for libaom tools.
 
 # Use $VPX_TEST_TOOLS_COMMON_SH as a pseudo include guard.
 if [ -z "${VPX_TEST_TOOLS_COMMON_SH}" ]; then
@@ -47,7 +47,7 @@
 
 # Echoes the target configuration being tested.
 test_configuration_target() {
-  vpx_config_mk="${LIBVPX_CONFIG_PATH}/config.mk"
+  vpx_config_mk="${LIBAOM_CONFIG_PATH}/config.mk"
   # Find the TOOLCHAIN line, split it using ':=' as the field separator, and
   # print the last field to get the value. Then pipe the value to tr to consume
   # any leading/trailing spaces while allowing tr to echo the output to stdout.
@@ -67,10 +67,10 @@
 }
 
 # Echoes the git hash portion of the VERSION_STRING variable defined in
-# $LIBVPX_CONFIG_PATH/config.mk to stdout, or the version number string when
+# $LIBAOM_CONFIG_PATH/config.mk to stdout, or the version number string when
 # no git hash is contained in VERSION_STRING.
 config_hash() {
-  vpx_config_mk="${LIBVPX_CONFIG_PATH}/config.mk"
+  vpx_config_mk="${LIBAOM_CONFIG_PATH}/config.mk"
   # Find VERSION_STRING line, split it with "-g" and print the last field to
   # output the git hash to stdout.
   vpx_version=$(awk -F -g '/VERSION_STRING/ {print $NF}' "${vpx_config_mk}")
@@ -117,21 +117,21 @@
   fi
 }
 
-# This script requires that the LIBVPX_BIN_PATH, LIBVPX_CONFIG_PATH, and
+# This script requires that the LIBAOM_BIN_PATH, LIBAOM_CONFIG_PATH, and
 # LIBVPX_TEST_DATA_PATH variables are in the environment: Confirm that
 # the variables are set and that they all evaluate to directory paths.
 verify_vpx_test_environment() {
-  test_env_var_dir "LIBVPX_BIN_PATH" \
-    && test_env_var_dir "LIBVPX_CONFIG_PATH" \
+  test_env_var_dir "LIBAOM_BIN_PATH" \
+    && test_env_var_dir "LIBAOM_CONFIG_PATH" \
     && test_env_var_dir "LIBVPX_TEST_DATA_PATH"
 }
 
-# Greps vpx_config.h in LIBVPX_CONFIG_PATH for positional parameter one, which
-# should be a LIBVPX preprocessor flag. Echoes yes to stdout when the feature
+# Greps vpx_config.h in LIBAOM_CONFIG_PATH for positional parameter one, which
+# should be a LIBAOM preprocessor flag. Echoes yes to stdout when the feature
 # is available.
 vpx_config_option_enabled() {
   vpx_config_option="${1}"
-  vpx_config_file="${LIBVPX_CONFIG_PATH}/vpx_config.h"
+  vpx_config_file="${LIBAOM_CONFIG_PATH}/vpx_config.h"
   config_line=$(grep "${vpx_config_option}" "${vpx_config_file}")
   if echo "${config_line}" | egrep -q '1$'; then
     echo yes
@@ -146,16 +146,16 @@
   fi
 }
 
-# Echoes path to $1 when it's executable and exists in ${LIBVPX_BIN_PATH}, or an
+# Echoes path to $1 when it's executable and exists in ${LIBAOM_BIN_PATH}, or an
 # empty string. Caller is responsible for testing the string once the function
 # returns.
 vpx_tool_path() {
   local readonly tool_name="$1"
-  local tool_path="${LIBVPX_BIN_PATH}/${tool_name}${VPX_TEST_EXE_SUFFIX}"
+  local tool_path="${LIBAOM_BIN_PATH}/${tool_name}${VPX_TEST_EXE_SUFFIX}"
   if [ ! -x "${tool_path}" ]; then
     # Try one directory up: when running via examples.sh the tool could be in
-    # the parent directory of $LIBVPX_BIN_PATH.
-    tool_path="${LIBVPX_BIN_PATH}/../${tool_name}${VPX_TEST_EXE_SUFFIX}"
+    # the parent directory of $LIBAOM_BIN_PATH.
+    tool_path="${LIBAOM_BIN_PATH}/../${tool_name}${VPX_TEST_EXE_SUFFIX}"
   fi
 
   if [ ! -x "${tool_path}" ]; then
@@ -165,10 +165,10 @@
 }
 
 # Echoes yes to stdout when the file named by positional parameter one exists
-# in LIBVPX_BIN_PATH, and is executable.
+# in LIBAOM_BIN_PATH, and is executable.
 vpx_tool_available() {
   local tool_name="$1"
-  local tool="${LIBVPX_BIN_PATH}/${tool_name}${VPX_TEST_EXE_SUFFIX}"
+  local tool="${LIBAOM_BIN_PATH}/${tool_name}${VPX_TEST_EXE_SUFFIX}"
   [ -x "${tool}" ] && echo yes
 }
 
@@ -275,12 +275,12 @@
 vpx_test_usage() {
 cat << EOF
   Usage: ${0##*/} [arguments]
-    --bin-path <path to libvpx binaries directory>
-    --config-path <path to libvpx config directory>
+    --bin-path <path to libaom binaries directory>
+    --config-path <path to libaom config directory>
     --filter <filter>: User test filter. Only tests matching filter are run.
     --run-disabled-tests: Run disabled tests.
     --help: Display this message and exit.
-    --test-data-path <path to libvpx test data directory>
+    --test-data-path <path to libaom test data directory>
     --show-program-output: Shows output from all programs being tested.
     --prefix: Allows for a user specified prefix to be inserted before all test
               programs. Grants the ability, for example, to run test programs
@@ -289,10 +289,10 @@
     --verbose: Verbose output.
 
     When the --bin-path option is not specified the script attempts to use
-    \$LIBVPX_BIN_PATH and then the current directory.
+    \$LIBAOM_BIN_PATH and then the current directory.
 
     When the --config-path option is not specified the script attempts to use
-    \$LIBVPX_CONFIG_PATH and then the current directory.
+    \$LIBAOM_CONFIG_PATH and then the current directory.
 
     When the -test-data-path option is not specified the script attempts to use
     \$LIBVPX_TEST_DATA_PATH and then the current directory.
@@ -302,8 +302,8 @@
 # Returns non-zero (failure) when required environment variables are empty
 # strings.
 vpx_test_check_environment() {
-  if [ -z "${LIBVPX_BIN_PATH}" ] || \
-     [ -z "${LIBVPX_CONFIG_PATH}" ] || \
+  if [ -z "${LIBAOM_BIN_PATH}" ] || \
+     [ -z "${LIBAOM_CONFIG_PATH}" ] || \
      [ -z "${LIBVPX_TEST_DATA_PATH}" ]; then
     return 1
   fi
@@ -313,11 +313,11 @@
 while [ -n "$1" ]; do
   case "$1" in
     --bin-path)
-      LIBVPX_BIN_PATH="$2"
+      LIBAOM_BIN_PATH="$2"
       shift
       ;;
     --config-path)
-      LIBVPX_CONFIG_PATH="$2"
+      LIBAOM_CONFIG_PATH="$2"
       shift
       ;;
     --filter)
@@ -358,8 +358,8 @@
 
 # Handle running the tests from a build directory without arguments when running
 # the tests on *nix/macosx.
-LIBVPX_BIN_PATH="${LIBVPX_BIN_PATH:-.}"
-LIBVPX_CONFIG_PATH="${LIBVPX_CONFIG_PATH:-.}"
+LIBAOM_BIN_PATH="${LIBAOM_BIN_PATH:-.}"
+LIBAOM_CONFIG_PATH="${LIBAOM_CONFIG_PATH:-.}"
 LIBVPX_TEST_DATA_PATH="${LIBVPX_TEST_DATA_PATH:-.}"
 
 # Create a temporary directory for output files, and a trap to clean it up.
@@ -403,8 +403,8 @@
 trap cleanup EXIT
 
 vlog "$(basename "${0%.*}") test configuration:
-  LIBVPX_BIN_PATH=${LIBVPX_BIN_PATH}
-  LIBVPX_CONFIG_PATH=${LIBVPX_CONFIG_PATH}
+  LIBAOM_BIN_PATH=${LIBAOM_BIN_PATH}
+  LIBAOM_CONFIG_PATH=${LIBAOM_CONFIG_PATH}
   LIBVPX_TEST_DATA_PATH=${LIBVPX_TEST_DATA_PATH}
   VP8_IVF_FILE=${VP8_IVF_FILE}
   VP9_IVF_FILE=${VP9_IVF_FILE}
diff --git a/test/transform_test_base.h b/test/transform_test_base.h
index 071018c..a09897c 100644
--- a/test/transform_test_base.h
+++ b/test/transform_test_base.h
@@ -11,14 +11,14 @@
 #define TEST_TRANSFORM_TEST_BASE_H_
 
 #include "./vpx_config.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx/vpx_codec.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom/vpx_codec.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 
 //  Note:
 //   Same constant are defined in vp9/common/vp9_entropy.h and
-//   vp10/common/entropy.h.  Goal is to make this base class
+//   av1/common/entropy.h.  Goal is to make this base class
 //   to use for future codec transform testing.  But including
 //   either of them would lead to compiling error when we do
 //   unit test for another codec. Suggest to move the definition
@@ -280,6 +280,6 @@
   }
 };
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #endif  // TEST_TRANSFORM_TEST_BASE_H_
diff --git a/test/twopass_encoder.sh b/test/twopass_encoder.sh
index 7a223f2..222f170 100755
--- a/test/twopass_encoder.sh
+++ b/test/twopass_encoder.sh
@@ -8,7 +8,7 @@
 ##  in the file PATENTS.  All contributing project authors may
 ##  be found in the AUTHORS file in the root of the source tree.
 ##
-##  This file tests the libvpx twopass_encoder example. To add new tests to this
+##  This file tests the libaom twopass_encoder example. To add new tests to this
 ##  file, do the following:
 ##    1. Write a shell function (this is your test).
 ##    2. Add the function to twopass_encoder_tests (on a new line).
@@ -26,7 +26,7 @@
 # Runs twopass_encoder using the codec specified by $1 with a frame limit of
 # 100.
 twopass_encoder() {
-  local encoder="${LIBVPX_BIN_PATH}/twopass_encoder${VPX_TEST_EXE_SUFFIX}"
+  local encoder="${LIBAOM_BIN_PATH}/twopass_encoder${VPX_TEST_EXE_SUFFIX}"
   local codec="$1"
   local output_file="${VPX_TEST_OUTPUT_DIR}/twopass_encoder_${codec}.ivf"
 
diff --git a/test/user_priv_test.cc b/test/user_priv_test.cc
index 4b5de09..7e8d398 100644
--- a/test/user_priv_test.cc
+++ b/test/user_priv_test.cc
@@ -22,13 +22,13 @@
 #if CONFIG_WEBM_IO
 #include "test/webm_video_source.h"
 #endif
-#include "vpx_mem/vpx_mem.h"
-#include "vpx/vp8.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom/vp8.h"
 
 namespace {
 
 using std::string;
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 #if CONFIG_WEBM_IO
 
@@ -44,13 +44,13 @@
 // should match.
 string DecodeFile(const string &filename) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
-  libvpx_test::WebMVideoSource video(filename);
+  libaom_test::WebMVideoSource video(filename);
   video.Init();
 
   vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
-  libvpx_test::VP9Decoder decoder(cfg, 0);
+  libaom_test::VP9Decoder decoder(cfg, 0);
 
-  libvpx_test::MD5 md5;
+  libaom_test::MD5 md5;
   int frame_num = 0;
   for (video.Begin(); !::testing::Test::HasFailure() && video.cxdata();
        video.Next()) {
@@ -62,7 +62,7 @@
       EXPECT_EQ(VPX_CODEC_OK, res) << decoder.DecodeError();
       break;
     }
-    libvpx_test::DxDataIterator dec_iter = decoder.GetDxData();
+    libaom_test::DxDataIterator dec_iter = decoder.GetDxData();
     const vpx_image_t *img = NULL;
 
     // Get decompressed data.
diff --git a/test/util.h b/test/util.h
index 0ef2ad8..6567253 100644
--- a/test/util.h
+++ b/test/util.h
@@ -14,7 +14,7 @@
 #include <stdio.h>
 #include <math.h>
 #include "third_party/googletest/src/include/gtest/gtest.h"
-#include "vpx/vpx_image.h"
+#include "aom/vpx_image.h"
 
 // Macros
 #define GET_PARAM(k) std::tr1::get<k>(GetParam())
diff --git a/test/variance_test.cc b/test/variance_test.cc
index e8b5669..1541f8e 100644
--- a/test/variance_test.cc
+++ b/test/variance_test.cc
@@ -18,10 +18,10 @@
 #include "test/acm_random.h"
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
-#include "vpx/vpx_codec.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_ports/mem.h"
+#include "aom/vpx_codec.h"
+#include "aom/vpx_integer.h"
+#include "aom_mem/vpx_mem.h"
+#include "aom_ports/mem.h"
 
 namespace {
 
@@ -41,7 +41,7 @@
                                       const uint8_t *b, int b_stride);
 typedef unsigned int (*SumOfSquaresFunction)(const int16_t *src);
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 // Truncate high bit depth results by downshifting (with rounding) by:
 // 2 * (bit_depth - 8) for sse
@@ -220,7 +220,7 @@
  public:
   SumOfSquaresTest() : func_(GetParam()) {}
 
-  virtual ~SumOfSquaresTest() { libvpx_test::ClearSystemState(); }
+  virtual ~SumOfSquaresTest() { libaom_test::ClearSystemState(); }
 
  protected:
   void ConstTest();
@@ -331,7 +331,7 @@
     delete[] ref_;
     src_ = NULL;
     ref_ = NULL;
-    libvpx_test::ClearSystemState();
+    libaom_test::ClearSystemState();
   }
 
  protected:
@@ -588,7 +588,7 @@
       vpx_free(CONVERT_TO_SHORTPTR(sec_));
 #endif  // CONFIG_VP9_HIGHBITDEPTH
     }
-    libvpx_test::ClearSystemState();
+    libaom_test::ClearSystemState();
   }
 
  protected:
diff --git a/test/video_source.h b/test/video_source.h
index 94a95ce..7fde59c 100644
--- a/test/video_source.h
+++ b/test/video_source.h
@@ -20,9 +20,9 @@
 #include <cstdlib>
 #include <string>
 #include "test/acm_random.h"
-#include "vpx/vpx_encoder.h"
+#include "aom/vpx_encoder.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 
 // Helper macros to ensure LIBVPX_TEST_DATA_PATH is a quoted string.
 // These are undefined right below GetDataPath
@@ -250,6 +250,6 @@
   virtual unsigned int frame_number() const = 0;
 };
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #endif  // TEST_VIDEO_SOURCE_H_
diff --git a/test/vp10_ans_test.cc b/test/vp10_ans_test.cc
index ca89f20..ddedbea 100644
--- a/test/vp10_ans_test.cc
+++ b/test/vp10_ans_test.cc
@@ -20,17 +20,17 @@
 #include "third_party/googletest/src/include/gtest/gtest.h"
 
 #include "test/acm_random.h"
-#include "vp10/common/ans.h"
-#include "vp10/encoder/treewriter.h"
-#include "vpx_dsp/bitreader.h"
-#include "vpx_dsp/bitwriter.h"
+#include "av1/common/ans.h"
+#include "av1/encoder/treewriter.h"
+#include "aom_dsp/bitreader.h"
+#include "aom_dsp/bitwriter.h"
 
 namespace {
 typedef std::vector<std::pair<uint8_t, bool> > PvVec;
 
 PvVec abs_encode_build_vals(int iters) {
   PvVec ret;
-  libvpx_test::ACMRandom gen(0x30317076);
+  libaom_test::ACMRandom gen(0x30317076);
   double entropy = 0;
   for (int i = 0; i < iters; ++i) {
     uint8_t p;
@@ -167,7 +167,7 @@
   }
   assert(p_to_sym.size() == rans_precision);
   std::vector<int> ret;
-  libvpx_test::ACMRandom gen(18543637);
+  libaom_test::ACMRandom gen(18543637);
   for (int i = 0; i < iters; ++i) {
     int sym = p_to_sym[gen.Rand8() * 4];
     ret.push_back(sym);
diff --git a/test/vp10_convolve_optimz_test.cc b/test/vp10_convolve_optimz_test.cc
index 2235088..cb8b8fb 100644
--- a/test/vp10_convolve_optimz_test.cc
+++ b/test/vp10_convolve_optimz_test.cc
@@ -19,7 +19,7 @@
 namespace {
 
 using std::tr1::tuple;
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 typedef void (*conv_filter_t)(const uint8_t *, int, uint8_t *, int, int, int,
                               const InterpFilterParams, const int, int, int);
@@ -79,7 +79,7 @@
 
   virtual void TearDown() {
     delete[] alloc_;
-    libvpx_test::ClearSystemState();
+    libaom_test::ClearSystemState();
   }
 
  protected:
@@ -255,7 +255,7 @@
 
   virtual void TearDown() {
     delete[] alloc_;
-    libvpx_test::ClearSystemState();
+    libaom_test::ClearSystemState();
   }
 
  protected:
diff --git a/test/vp10_convolve_test.cc b/test/vp10_convolve_test.cc
index da750b5..2ec6ae7 100644
--- a/test/vp10_convolve_test.cc
+++ b/test/vp10_convolve_test.cc
@@ -3,12 +3,12 @@
 #include "./vp10_rtcd.h"
 #include "./vpx_dsp_rtcd.h"
 #include "test/acm_random.h"
-#include "vp10/common/filter.h"
-#include "vp10/common/vp10_convolve.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/filter.h"
+#include "av1/common/vp10_convolve.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 void setup_convolve() {
diff --git a/test/vp10_dct_test.cc b/test/vp10_dct_test.cc
index 63e0202..5d31adf 100644
--- a/test/vp10_dct_test.cc
+++ b/test/vp10_dct_test.cc
@@ -16,13 +16,13 @@
 #include "test/acm_random.h"
 #include "test/util.h"
 #include "./vpx_config.h"
-#include "vpx_ports/msvc.h"
+#include "aom_ports/msvc.h"
 
 #undef CONFIG_COEFFICIENT_RANGE_CHECKING
 #define CONFIG_COEFFICIENT_RANGE_CHECKING 1
-#include "vp10/encoder/dct.c"
+#include "av1/encoder/dct.c"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 void reference_dct_1d(const double *in, double *out, int size) {
diff --git a/test/vp10_ext_tile_test.cc b/test/vp10_ext_tile_test.cc
index e3b24e7..6ca7ec8 100644
--- a/test/vp10_ext_tile_test.cc
+++ b/test/vp10_ext_tile_test.cc
@@ -30,8 +30,8 @@
 const int kImgHeight = 576;
 
 class VP10ExtTileTest
-    : public ::libvpx_test::EncoderTest,
-      public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
+    : public ::libaom_test::EncoderTest,
+      public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int> {
  protected:
   VP10ExtTileTest()
       : EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
@@ -69,8 +69,8 @@
     cfg_.rc_min_quantizer = 0;
   }
 
-  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
-                                  ::libvpx_test::Encoder *encoder) {
+  virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
+                                  ::libaom_test::Encoder *encoder) {
     if (video->frame() == 0) {
       // Encode setting
       encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
@@ -99,7 +99,7 @@
     if (pts == (vpx_codec_pts_t)kSkip) return;
 
     // Calculate MD5 as the reference.
-    ::libvpx_test::MD5 md5_res;
+    ::libaom_test::MD5 md5_res;
     md5_res.Add(&img);
     md5_.push_back(md5_res.Get());
   }
@@ -133,7 +133,7 @@
 
         if (!IsLastFrame) {
           if (img) {
-            ::libvpx_test::MD5 md5_res;
+            ::libaom_test::MD5 md5_res;
             md5_res.Add(img);
             tile_md5_.push_back(md5_res.Get());
           }
@@ -159,22 +159,22 @@
     }
 
     if (IsLastFrame) {
-      ::libvpx_test::MD5 md5_res;
+      ::libaom_test::MD5 md5_res;
       md5_res.Add(&tile_img_);
       tile_md5_.push_back(md5_res.Get());
     }
   }
 
-  ::libvpx_test::TestMode encoding_mode_;
+  ::libaom_test::TestMode encoding_mode_;
   int set_cpu_used_;
-  ::libvpx_test::Decoder *decoder_;
+  ::libaom_test::Decoder *decoder_;
   vpx_image_t tile_img_;
   std::vector<std::string> md5_;
   std::vector<std::string> tile_md5_;
 };
 
 TEST_P(VP10ExtTileTest, DecoderResultTest) {
-  ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", kImgWidth,
+  ::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", kImgWidth,
                                        kImgHeight, 30, 1, 0, kLimit);
   cfg_.rc_target_bitrate = 500;
   cfg_.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT;
@@ -191,6 +191,6 @@
 
 VP10_INSTANTIATE_TEST_CASE(
     // Now only test 2-pass mode.
-    VP10ExtTileTest, ::testing::Values(::libvpx_test::kTwoPassGood),
+    VP10ExtTileTest, ::testing::Values(::libaom_test::kTwoPassGood),
     ::testing::Range(0, 4));
 }  // namespace
diff --git a/test/vp10_fht16x16_test.cc b/test/vp10_fht16x16_test.cc
index cc15353..40884f3 100644
--- a/test/vp10_fht16x16_test.cc
+++ b/test/vp10_fht16x16_test.cc
@@ -18,15 +18,15 @@
 #include "test/register_state_check.h"
 #include "test/transform_test_base.h"
 #include "test/util.h"
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
                         int tx_type);
 using std::tr1::tuple;
-using libvpx_test::FhtFunc;
+using libaom_test::FhtFunc;
 typedef tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t, int> Ht16x16Param;
 
 void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
@@ -48,7 +48,7 @@
 }
 #endif  // CONFIG_VP9_HIGHBITDEPTH
 
-class VP10Trans16x16HT : public libvpx_test::TransformTestBase,
+class VP10Trans16x16HT : public libaom_test::TransformTestBase,
                          public ::testing::TestWithParam<Ht16x16Param> {
  public:
   virtual ~VP10Trans16x16HT() {}
@@ -63,7 +63,7 @@
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
   }
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
@@ -106,7 +106,7 @@
     vpx_free(input_);
     vpx_free(output_);
     vpx_free(output_ref_);
-    libvpx_test::ClearSystemState();
+    libaom_test::ClearSystemState();
   }
 
  protected:
diff --git a/test/vp10_fht4x4_test.cc b/test/vp10_fht4x4_test.cc
index f1db663..1f4aa1e 100644
--- a/test/vp10_fht4x4_test.cc
+++ b/test/vp10_fht4x4_test.cc
@@ -18,15 +18,15 @@
 #include "test/register_state_check.h"
 #include "test/transform_test_base.h"
 #include "test/util.h"
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
                         int tx_type);
 using std::tr1::tuple;
-using libvpx_test::FhtFunc;
+using libaom_test::FhtFunc;
 typedef tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t, int> Ht4x4Param;
 
 void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
@@ -49,7 +49,7 @@
 }
 #endif  // CONFIG_VP9_HIGHBITDEPTH
 
-class VP10Trans4x4HT : public libvpx_test::TransformTestBase,
+class VP10Trans4x4HT : public libaom_test::TransformTestBase,
                        public ::testing::TestWithParam<Ht4x4Param> {
  public:
   virtual ~VP10Trans4x4HT() {}
@@ -64,7 +64,7 @@
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
   }
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
@@ -106,7 +106,7 @@
     vpx_free(input_);
     vpx_free(output_);
     vpx_free(output_ref_);
-    libvpx_test::ClearSystemState();
+    libaom_test::ClearSystemState();
   }
 
  protected:
diff --git a/test/vp10_fht8x8_test.cc b/test/vp10_fht8x8_test.cc
index a711901..3990bd5 100644
--- a/test/vp10_fht8x8_test.cc
+++ b/test/vp10_fht8x8_test.cc
@@ -18,15 +18,15 @@
 #include "test/register_state_check.h"
 #include "test/transform_test_base.h"
 #include "test/util.h"
-#include "vpx_ports/mem.h"
+#include "aom_ports/mem.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
                         int tx_type);
 
-using libvpx_test::FhtFunc;
+using libaom_test::FhtFunc;
 using std::tr1::tuple;
 typedef tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t, int> Ht8x8Param;
 
@@ -48,7 +48,7 @@
 }
 #endif  // CONFIG_VP9_HIGHBITDEPTH
 
-class VP10Trans8x8HT : public libvpx_test::TransformTestBase,
+class VP10Trans8x8HT : public libaom_test::TransformTestBase,
                        public ::testing::TestWithParam<Ht8x8Param> {
  public:
   virtual ~VP10Trans8x8HT() {}
@@ -63,7 +63,7 @@
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
   }
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
@@ -105,7 +105,7 @@
     vpx_free(input_);
     vpx_free(output_);
     vpx_free(output_ref_);
-    libvpx_test::ClearSystemState();
+    libaom_test::ClearSystemState();
   }
 
  protected:
diff --git a/test/vp10_fwd_txfm1d_test.cc b/test/vp10_fwd_txfm1d_test.cc
index d6bb32f..2b9cfe5 100644
--- a/test/vp10_fwd_txfm1d_test.cc
+++ b/test/vp10_fwd_txfm1d_test.cc
@@ -8,15 +8,15 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include "vp10/common/vp10_fwd_txfm1d.h"
+#include "av1/common/vp10_fwd_txfm1d.h"
 #include "test/vp10_txfm_test.h"
 
-using libvpx_test::ACMRandom;
-using libvpx_test::input_base;
-using libvpx_test::reference_hybrid_1d;
-using libvpx_test::TYPE_TXFM;
-using libvpx_test::TYPE_DCT;
-using libvpx_test::TYPE_ADST;
+using libaom_test::ACMRandom;
+using libaom_test::input_base;
+using libaom_test::reference_hybrid_1d;
+using libaom_test::TYPE_TXFM;
+using libaom_test::TYPE_DCT;
+using libaom_test::TYPE_ADST;
 
 namespace {
 const int txfm_type_num = 2;
diff --git a/test/vp10_fwd_txfm2d_test.cc b/test/vp10_fwd_txfm2d_test.cc
index c522c45..7dbb922 100644
--- a/test/vp10_fwd_txfm2d_test.cc
+++ b/test/vp10_fwd_txfm2d_test.cc
@@ -15,15 +15,15 @@
 #include "test/acm_random.h"
 #include "test/util.h"
 #include "test/vp10_txfm_test.h"
-#include "vp10/common/vp10_txfm.h"
+#include "av1/common/vp10_txfm.h"
 #include "./vp10_rtcd.h"
 
-using libvpx_test::ACMRandom;
-using libvpx_test::input_base;
-using libvpx_test::bd;
-using libvpx_test::compute_avg_abs_error;
-using libvpx_test::Fwd_Txfm2d_Func;
-using libvpx_test::TYPE_TXFM;
+using libaom_test::ACMRandom;
+using libaom_test::input_base;
+using libaom_test::bd;
+using libaom_test::compute_avg_abs_error;
+using libaom_test::Fwd_Txfm2d_Func;
+using libaom_test::TYPE_TXFM;
 
 namespace {
 #if CONFIG_VP9_HIGHBITDEPTH
@@ -48,8 +48,8 @@
     amplify_factor_ =
         amplify_bit >= 0 ? (1 << amplify_bit) : (1.0 / (1 << -amplify_bit));
 
-    fwd_txfm_ = libvpx_test::fwd_txfm_func_ls[tx_size_];
-    txfm1d_size_ = libvpx_test::get_txfm1d_size(tx_size_);
+    fwd_txfm_ = libaom_test::fwd_txfm_func_ls[tx_size_];
+    txfm1d_size_ = libaom_test::get_txfm1d_size(tx_size_);
     txfm2d_size_ = txfm1d_size_ * txfm1d_size_;
     get_txfm1d_type(tx_type_, &type0_, &type1_);
     input_ = reinterpret_cast<int16_t *>(
@@ -76,11 +76,11 @@
       fwd_txfm_(input_, output_, txfm1d_size_, tx_type_, bd);
 
       if (lr_flip_ && ud_flip_)
-        libvpx_test::fliplrud(ref_input_, txfm1d_size_, txfm1d_size_);
+        libaom_test::fliplrud(ref_input_, txfm1d_size_, txfm1d_size_);
       else if (lr_flip_)
-        libvpx_test::fliplr(ref_input_, txfm1d_size_, txfm1d_size_);
+        libaom_test::fliplr(ref_input_, txfm1d_size_, txfm1d_size_);
       else if (ud_flip_)
-        libvpx_test::flipud(ref_input_, txfm1d_size_, txfm1d_size_);
+        libaom_test::flipud(ref_input_, txfm1d_size_, txfm1d_size_);
 
       reference_hybrid_2d(ref_input_, ref_output_, txfm1d_size_, type0_,
                           type1_);
diff --git a/test/vp10_highbd_iht_test.cc b/test/vp10_highbd_iht_test.cc
index b632b40..6190971 100644
--- a/test/vp10_highbd_iht_test.cc
+++ b/test/vp10_highbd_iht_test.cc
@@ -15,14 +15,14 @@
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-#include "vp10/common/enums.h"
-#include "vpx_dsp/vpx_dsp_common.h"
-#include "vpx_ports/mem.h"
+#include "av1/common/enums.h"
+#include "aom_dsp/vpx_dsp_common.h"
+#include "aom_ports/mem.h"
 
 namespace {
 
 using std::tr1::tuple;
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 typedef void (*HbdHtFunc)(const int16_t *input, int32_t *output, int stride,
                           int tx_type, int bd);
@@ -56,7 +56,7 @@
 
     // Note:
     // Inverse transform input buffer is 32-byte aligned
-    // Refer to <root>/vp10/encoder/context_tree.c, function,
+    // Refer to <root>/av1/encoder/context_tree.c, function,
     // void alloc_mode_context().
     coeffs_ = reinterpret_cast<int32_t *>(
         vpx_memalign(32, sizeof(coeffs_[0]) * num_coeffs_));
@@ -71,7 +71,7 @@
     vpx_free(coeffs_);
     vpx_free(output_);
     vpx_free(output_ref_);
-    libvpx_test::ClearSystemState();
+    libaom_test::ClearSystemState();
   }
 
  protected:
diff --git a/test/vp10_inv_txfm1d_test.cc b/test/vp10_inv_txfm1d_test.cc
index 77e1122..744aae8 100644
--- a/test/vp10_inv_txfm1d_test.cc
+++ b/test/vp10_inv_txfm1d_test.cc
@@ -9,11 +9,11 @@
  */
 
 #include "test/vp10_txfm_test.h"
-#include "vp10/common/vp10_fwd_txfm1d.h"
-#include "vp10/common/vp10_inv_txfm1d.h"
+#include "av1/common/vp10_fwd_txfm1d.h"
+#include "av1/common/vp10_inv_txfm1d.h"
 
-using libvpx_test::ACMRandom;
-using libvpx_test::input_base;
+using libaom_test::ACMRandom;
+using libaom_test::input_base;
 
 namespace {
 const int txfm_type_num = 2;
diff --git a/test/vp10_inv_txfm2d_test.cc b/test/vp10_inv_txfm2d_test.cc
index 8cbca5a..bbd0aaf 100644
--- a/test/vp10_inv_txfm2d_test.cc
+++ b/test/vp10_inv_txfm2d_test.cc
@@ -16,14 +16,14 @@
 #include "test/acm_random.h"
 #include "test/util.h"
 #include "test/vp10_txfm_test.h"
-#include "vp10/common/vp10_inv_txfm2d_cfg.h"
+#include "av1/common/vp10_inv_txfm2d_cfg.h"
 
-using libvpx_test::ACMRandom;
-using libvpx_test::input_base;
-using libvpx_test::bd;
-using libvpx_test::compute_avg_abs_error;
-using libvpx_test::Fwd_Txfm2d_Func;
-using libvpx_test::Inv_Txfm2d_Func;
+using libaom_test::ACMRandom;
+using libaom_test::input_base;
+using libaom_test::bd;
+using libaom_test::compute_avg_abs_error;
+using libaom_test::Fwd_Txfm2d_Func;
+using libaom_test::Inv_Txfm2d_Func;
 
 namespace {
 
@@ -39,7 +39,7 @@
     tx_size_ = GET_PARAM(1);
     max_error_ = GET_PARAM(2);
     max_avg_error_ = GET_PARAM(3);
-    txfm1d_size_ = libvpx_test::get_txfm1d_size(tx_size_);
+    txfm1d_size_ = libaom_test::get_txfm1d_size(tx_size_);
     txfm2d_size_ = txfm1d_size_ * txfm1d_size_;
     count_ = 500;
 
@@ -53,9 +53,9 @@
 
   void RunRoundtripCheck() {
     const Fwd_Txfm2d_Func fwd_txfm_func =
-        libvpx_test::fwd_txfm_func_ls[tx_size_];
+        libaom_test::fwd_txfm_func_ls[tx_size_];
     const Inv_Txfm2d_Func inv_txfm_func =
-        libvpx_test::inv_txfm_func_ls[tx_size_];
+        libaom_test::inv_txfm_func_ls[tx_size_];
     double avg_abs_error = 0;
     ACMRandom rnd(ACMRandom::DeterministicSeed());
     for (int ci = 0; ci < count_; ci++) {
diff --git a/test/vp10_inv_txfm_test.cc b/test/vp10_inv_txfm_test.cc
index 3469d19..df8787d 100644
--- a/test/vp10_inv_txfm_test.cc
+++ b/test/vp10_inv_txfm_test.cc
@@ -20,12 +20,12 @@
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
 #include "test/util.h"
-#include "vp10/common/blockd.h"
-#include "vp10/common/scan.h"
-#include "vpx/vpx_integer.h"
-#include "vp10/common/vp10_inv_txfm.h"
+#include "av1/common/blockd.h"
+#include "av1/common/scan.h"
+#include "aom/vpx_integer.h"
+#include "av1/common/vp10_inv_txfm.h"
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 namespace {
 const double kInvSqrt2 = 0.707106781186547524400844362104;
@@ -125,7 +125,7 @@
     last_nonzero_ = GET_PARAM(4);
   }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   int last_nonzero_;
diff --git a/test/vp10_quantize_test.cc b/test/vp10_quantize_test.cc
index e7365bb..f3990ae 100644
--- a/test/vp10_quantize_test.cc
+++ b/test/vp10_quantize_test.cc
@@ -17,7 +17,7 @@
 #include "test/acm_random.h"
 #include "test/clear_system_state.h"
 #include "test/register_state_check.h"
-#include "vp10/common/scan.h"
+#include "av1/common/scan.h"
 
 namespace {
 
@@ -37,7 +37,7 @@
   int coeffCount;
 };
 
-using libvpx_test::ACMRandom;
+using libaom_test::ACMRandom;
 
 const int numTests = 1000;
 const int maxSize = 1024;
@@ -173,7 +173,7 @@
 
   virtual void SetUp() { params_ = GetParam(); }
 
-  virtual void TearDown() { libvpx_test::ClearSystemState(); }
+  virtual void TearDown() { libaom_test::ClearSystemState(); }
 
   virtual ~VP10QuantizeTest() {}
 
diff --git a/test/vp10_txfm_test.cc b/test/vp10_txfm_test.cc
index f9055f1..718d71b 100644
--- a/test/vp10_txfm_test.cc
+++ b/test/vp10_txfm_test.cc
@@ -11,7 +11,7 @@
 #include <stdio.h>
 #include "test/vp10_txfm_test.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 
 int get_txfm1d_size(TX_SIZE tx_size) { return 1 << (tx_size + 2); }
 
@@ -160,4 +160,4 @@
 template void flipud<double>(double *dest, int stride, int length);
 template void fliplrud<double>(double *dest, int stride, int length);
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
diff --git a/test/vp10_txfm_test.h b/test/vp10_txfm_test.h
index 4b7d978..bfae073 100644
--- a/test/vp10_txfm_test.h
+++ b/test/vp10_txfm_test.h
@@ -21,11 +21,11 @@
 #include "third_party/googletest/src/include/gtest/gtest.h"
 
 #include "test/acm_random.h"
-#include "vp10/common/enums.h"
-#include "vp10/common/vp10_txfm.h"
+#include "av1/common/enums.h"
+#include "av1/common/vp10_txfm.h"
 #include "./vp10_rtcd.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 typedef enum {
   TYPE_DCT = 0,
   TYPE_ADST,
@@ -87,5 +87,5 @@
 };
 #endif  // CONFIG_VP9_HIGHBITDEPTH
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 #endif  // VP10_TXFM_TEST_H_
diff --git a/test/vp10_wedge_utils_test.cc b/test/vp10_wedge_utils_test.cc
index 57008c6..127a32f 100644
--- a/test/vp10_wedge_utils_test.cc
+++ b/test/vp10_wedge_utils_test.cc
@@ -15,9 +15,9 @@
 #include "./vpx_dsp_rtcd.h"
 #include "./vp10_rtcd.h"
 
-#include "vpx_dsp/vpx_dsp_common.h"
+#include "aom_dsp/vpx_dsp_common.h"
 
-#include "vp10/common/enums.h"
+#include "av1/common/enums.h"
 
 #include "test/acm_random.h"
 #include "test/function_equivalence_test.h"
@@ -26,8 +26,8 @@
 #define WEDGE_WEIGHT_BITS 6
 #define MAX_MASK_VALUE (1 << (WEDGE_WEIGHT_BITS))
 
-using libvpx_test::ACMRandom;
-using libvpx_test::FunctionEquivalenceTest;
+using libaom_test::ACMRandom;
+using libaom_test::FunctionEquivalenceTest;
 
 namespace {
 
@@ -158,7 +158,7 @@
 
 typedef uint64_t (*FSSE)(const int16_t *r1, const int16_t *d, const uint8_t *m,
                          int N);
-typedef libvpx_test::FuncParam<FSSE> TestFuncsFSSE;
+typedef libaom_test::FuncParam<FSSE> TestFuncsFSSE;
 
 class WedgeUtilsSSEOptTest : public FunctionEquivalenceTest<FSSE> {
  protected:
@@ -230,7 +230,7 @@
 //////////////////////////////////////////////////////////////////////////////
 
 typedef int (*FSign)(const int16_t *ds, const uint8_t *m, int N, int64_t limit);
-typedef libvpx_test::FuncParam<FSign> TestFuncsFSign;
+typedef libaom_test::FuncParam<FSign> TestFuncsFSign;
 
 class WedgeUtilsSignOptTest : public FunctionEquivalenceTest<FSign> {
  protected:
@@ -339,7 +339,7 @@
 //////////////////////////////////////////////////////////////////////////////
 
 typedef void (*FDS)(int16_t *d, const int16_t *a, const int16_t *b, int N);
-typedef libvpx_test::FuncParam<FDS> TestFuncsFDS;
+typedef libaom_test::FuncParam<FDS> TestFuncsFDS;
 
 class WedgeUtilsDeltaSquaresOptTest : public FunctionEquivalenceTest<FDS> {
  protected:
diff --git a/test/vp8_multi_resolution_encoder.sh b/test/vp8_multi_resolution_encoder.sh
index a8b7fe7..9b09daa 100755
--- a/test/vp8_multi_resolution_encoder.sh
+++ b/test/vp8_multi_resolution_encoder.sh
@@ -8,7 +8,7 @@
 ##  in the file PATENTS.  All contributing project authors may
 ##  be found in the AUTHORS file in the root of the source tree.
 ##
-##  This file tests the libvpx vp8_multi_resolution_encoder example. To add new
+##  This file tests the libaom vp8_multi_resolution_encoder example. To add new
 ##  tests to this file, do the following:
 ##    1. Write a shell function (this is your test).
 ##    2. Add the function to vp8_mre_tests (on a new line).
@@ -24,7 +24,7 @@
     fi
     local readonly app="vp8_multi_resolution_encoder"
     if [ -z "$(vpx_tool_path "${app}")" ]; then
-      elog "${app} not found. It must exist in LIBVPX_BIN_PATH or its parent."
+      elog "${app} not found. It must exist in LIBAOM_BIN_PATH or its parent."
       return 1
     fi
   fi
diff --git a/test/vpxdec.sh b/test/vpxdec.sh
index de51c80..8b213ea 100755
--- a/test/vpxdec.sh
+++ b/test/vpxdec.sh
@@ -23,13 +23,13 @@
     return 1
   fi
   if [ -z "$(vpx_tool_path vpxdec)" ]; then
-    elog "vpxdec not found. It must exist in LIBVPX_BIN_PATH or its parent."
+    elog "vpxdec not found. It must exist in LIBAOM_BIN_PATH or its parent."
     return 1
   fi
 }
 
 # Wrapper function for running vpxdec with pipe input. Requires that
-# LIBVPX_BIN_PATH points to the directory containing vpxdec. $1 is used as the
+# LIBAOM_BIN_PATH points to the directory containing vpxdec. $1 is used as the
 # input file path and shifted away. All remaining parameters are passed through
 # to vpxdec.
 vpxdec_pipe() {
@@ -39,7 +39,7 @@
   cat "${input}" | eval "${VPX_TEST_PREFIX}" "${decoder}" - "$@" ${devnull}
 }
 
-# Wrapper function for running vpxdec. Requires that LIBVPX_BIN_PATH points to
+# Wrapper function for running vpxdec. Requires that LIBAOM_BIN_PATH points to
 # the directory containing vpxdec. $1 one is used as the input file path and
 # shifted away. All remaining parameters are passed through to vpxdec.
 vpxdec() {
diff --git a/test/vpxenc.sh b/test/vpxenc.sh
index e899499..20e147f 100755
--- a/test/vpxenc.sh
+++ b/test/vpxenc.sh
@@ -31,7 +31,7 @@
     fi
   fi
   if [ -z "$(vpx_tool_path vpxenc)" ]; then
-    elog "vpxenc not found. It must exist in LIBVPX_BIN_PATH or its parent."
+    elog "vpxenc not found. It must exist in LIBAOM_BIN_PATH or its parent."
     return 1
   fi
 }
@@ -91,7 +91,7 @@
 }
 
 # Wrapper function for running vpxenc with pipe input. Requires that
-# LIBVPX_BIN_PATH points to the directory containing vpxenc. $1 is used as the
+# LIBAOM_BIN_PATH points to the directory containing vpxenc. $1 is used as the
 # input file path and shifted away. All remaining parameters are passed through
 # to vpxenc.
 vpxenc_pipe() {
@@ -103,7 +103,7 @@
     "$@" ${devnull}
 }
 
-# Wrapper function for running vpxenc. Requires that LIBVPX_BIN_PATH points to
+# Wrapper function for running vpxenc. Requires that LIBAOM_BIN_PATH points to
 # the directory containing vpxenc. $1 one is used as the input file path and
 # shifted away. All remaining parameters are passed through to vpxenc.
 vpxenc() {
diff --git a/test/webm_video_source.h b/test/webm_video_source.h
index 5371361..c0e1cb1 100644
--- a/test/webm_video_source.h
+++ b/test/webm_video_source.h
@@ -18,7 +18,7 @@
 #include "../webmdec.h"
 #include "test/video_source.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 
 // This class extends VideoSource to allow parsing of WebM files,
 // so that we can do actual file decodes.
@@ -88,6 +88,6 @@
   bool end_of_file_;
 };
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #endif  // TEST_WEBM_VIDEO_SOURCE_H_
diff --git a/test/y4m_test.cc b/test/y4m_test.cc
index 000bab6..d68d3d1 100644
--- a/test/y4m_test.cc
+++ b/test/y4m_test.cc
@@ -74,7 +74,7 @@
 }
 
 class Y4mVideoSourceTest : public ::testing::TestWithParam<Y4mTestParam>,
-                           public ::libvpx_test::Y4mVideoSource {
+                           public ::libaom_test::Y4mVideoSource {
  protected:
   Y4mVideoSourceTest() : Y4mVideoSource("", 0, 0) {}
 
@@ -117,7 +117,7 @@
   // Checks MD5 of the raw frame data
   void Md5Check(const string &expected_md5) {
     ASSERT_TRUE(input_file_ != NULL);
-    libvpx_test::MD5 md5;
+    libaom_test::MD5 md5;
     for (unsigned int i = start_; i < limit_; i++) {
       md5.Add(img());
       Next();
@@ -158,7 +158,7 @@
     ASSERT_TRUE(input_file_ != NULL);
     char buf[Y4M_BUFFER_SIZE] = { 0 };
     const struct VpxRational framerate = { y4m_.fps_n, y4m_.fps_d };
-    tmpfile_ = new libvpx_test::TempOutFile;
+    tmpfile_ = new libaom_test::TempOutFile;
     ASSERT_TRUE(tmpfile_->file() != NULL);
     y4m_write_file_header(buf, sizeof(buf), kWidth, kHeight, &framerate,
                           y4m_.vpx_fmt, y4m_.bit_depth);
@@ -176,7 +176,7 @@
     Y4mVideoSourceTest::Init(file_name, limit);
     WriteY4mAndReadBack();
   }
-  libvpx_test::TempOutFile *tmpfile_;
+  libaom_test::TempOutFile *tmpfile_;
 };
 
 TEST_P(Y4mVideoWriteTest, WriteTest) {
diff --git a/test/y4m_video_source.h b/test/y4m_video_source.h
index 2682ddd..094cdbe 100644
--- a/test/y4m_video_source.h
+++ b/test/y4m_video_source.h
@@ -15,7 +15,7 @@
 #include "test/video_source.h"
 #include "./y4minput.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 
 // This class extends VideoSource to allow parsing of raw yv12
 // so that we can do actual file encodes.
@@ -117,6 +117,6 @@
   y4m_input y4m_;
 };
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #endif  // TEST_Y4M_VIDEO_SOURCE_H_
diff --git a/test/yuv_video_source.h b/test/yuv_video_source.h
index 2cc81a0..33a31d4 100644
--- a/test/yuv_video_source.h
+++ b/test/yuv_video_source.h
@@ -15,9 +15,9 @@
 #include <string>
 
 #include "test/video_source.h"
-#include "vpx/vpx_image.h"
+#include "aom/vpx_image.h"
 
-namespace libvpx_test {
+namespace libaom_test {
 
 // This class extends VideoSource to allow parsing of raw YUV
 // formats of various color sampling and bit-depths so that we can
@@ -119,6 +119,6 @@
   int framerate_denominator_;
 };
 
-}  // namespace libvpx_test
+}  // namespace libaom_test
 
 #endif  // TEST_YUV_VIDEO_SOURCE_H_
diff --git a/third_party/libyuv/source/cpu_id.cc b/third_party/libyuv/source/cpu_id.cc
index 8a10b00..72f686e 100644
--- a/third_party/libyuv/source/cpu_id.cc
+++ b/third_party/libyuv/source/cpu_id.cc
@@ -121,7 +121,7 @@
 }
 #endif  // defined(_M_IX86) || defined(_M_X64) ..
 
-// based on libvpx arm_cpudetect.c
+// based on libaom arm_cpudetect.c
 // For Arm, but public to allow testing on any CPU
 LIBYUV_API SAFEBUFFERS
 int ArmCpuCaps(const char* cpuinfo_name) {
diff --git a/third_party/x86inc/README.libvpx b/third_party/x86inc/README.libvpx
index 8d3cd96..6347614 100644
--- a/third_party/x86inc/README.libvpx
+++ b/third_party/x86inc/README.libvpx
@@ -11,8 +11,8 @@
 Get configuration from vpx_config.asm.
 Prefix functions with vpx by default.
 Manage name mangling (prefixing with '_') manually because 'PREFIX' does not
-  exist in libvpx.
-Expand PIC default to macho64 and respect CONFIG_PIC from libvpx
+  exist in libaom.
+Expand PIC default to macho64 and respect CONFIG_PIC from libaom
 Set 'private_extern' visibility for macho targets.
 Copy PIC 'GLOBAL' macros from x86_abi_support.asm
 Use .text instead of .rodata on macho to avoid broken tables in PIC mode.
diff --git a/third_party/x86inc/x86inc.asm b/third_party/x86inc/x86inc.asm
index b647dff..bb84f61 100644
--- a/third_party/x86inc/x86inc.asm
+++ b/third_party/x86inc/x86inc.asm
@@ -82,7 +82,7 @@
      %define FORMAT_MACHO 1
 %endif
 
-; Set PREFIX for libvpx builds.
+; Set PREFIX for libaom builds.
 %if FORMAT_ELF
     %undef PREFIX
 %elif WIN64
@@ -100,7 +100,7 @@
 ; In some instances macho32 tables get misaligned when using .rodata.
 ; When looking at the disassembly it appears that the offset is either
 ; correct or consistently off by 90. Placing them in the .text section
-; works around the issue. It appears to be specific to the way libvpx
+; works around the issue. It appears to be specific to the way libaom
 ; handles the tables.
 %macro SECTION_RODATA 0-1 16
     %ifidn __OUTPUT_FORMAT__,macho32
@@ -113,7 +113,7 @@
     %endif
 %endmacro
 
-; PIC macros are copied from vpx_ports/x86_abi_support.asm. The "define PIC"
+; PIC macros are copied from aom_ports/x86_abi_support.asm. The "define PIC"
 ; from original code is added in for 64bit.
 %ifidn __OUTPUT_FORMAT__,elf32
 %define ABI_IS_32BIT 1
@@ -790,7 +790,7 @@
     annotate_function_size
     %if %1
         %xdefine %%FUNCTION_PREFIX private_prefix
-        ; libvpx explicitly sets visibility in shared object builds. Avoid
+        ; libaom explicitly sets visibility in shared object builds. Avoid
         ; setting visibility to hidden as it may break builds that split
         ; sources on e.g., directory boundaries.
         %ifdef CHROMIUM
diff --git a/tools_common.c b/tools_common.c
index e1c89a4..33d8bef 100644
--- a/tools_common.c
+++ b/tools_common.c
@@ -17,11 +17,11 @@
 #include "./tools_common.h"
 
 #if CONFIG_VP10_ENCODER
-#include "vpx/vp8cx.h"
+#include "aom/vp8cx.h"
 #endif
 
 #if CONFIG_VP10_DECODER
-#include "vpx/vp8dx.h"
+#include "aom/vp8dx.h"
 #endif
 
 #if defined(_WIN32) || defined(__OS2__)
diff --git a/tools_common.h b/tools_common.h
index ce4fbf8..4cdb312 100644
--- a/tools_common.h
+++ b/tools_common.h
@@ -13,10 +13,10 @@
 #include <stdio.h>
 
 #include "./vpx_config.h"
-#include "vpx/vpx_codec.h"
-#include "vpx/vpx_image.h"
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/msvc.h"
+#include "aom/vpx_codec.h"
+#include "aom/vpx_image.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/msvc.h"
 
 #if CONFIG_ENCODERS
 #include "./y4minput.h"
diff --git a/video_reader.c b/video_reader.c
index a0ba252..c3a19d3 100644
--- a/video_reader.c
+++ b/video_reader.c
@@ -14,7 +14,7 @@
 #include "./ivfdec.h"
 #include "./video_reader.h"
 
-#include "vpx_ports/mem_ops.h"
+#include "aom_ports/mem_ops.h"
 
 static const char *const kIVFSignature = "DKIF";
 
diff --git a/video_writer.c b/video_writer.c
index 56d428b..c0c292f 100644
--- a/video_writer.c
+++ b/video_writer.c
@@ -12,7 +12,7 @@
 
 #include "./ivfenc.h"
 #include "./video_writer.h"
-#include "vpx/vpx_encoder.h"
+#include "aom/vpx_encoder.h"
 
 struct VpxVideoWriterStruct {
   VpxVideoInfo info;
diff --git a/vp10/common/x86/vp10_fwd_dct32x32_impl_sse2.h b/vp10/common/x86/vp10_fwd_dct32x32_impl_sse2.h
deleted file mode 100644
index eea9f97..0000000
--- a/vp10/common/x86/vp10_fwd_dct32x32_impl_sse2.h
+++ /dev/null
@@ -1,3201 +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.
- */
-
-#include <emmintrin.h>  // SSE2
-
-#include "./vp10_rtcd.h"
-#include "vp10/common/vp10_fwd_txfm.h"
-#include "vpx_dsp/txfm_common.h"
-#include "vpx_dsp/x86/txfm_common_sse2.h"
-
-// TODO(jingning) The high bit-depth version needs re-work for performance.
-// The current SSE2 implementation also causes cross reference to the static
-// functions in the C implementation file.
-#if DCT_HIGH_BIT_DEPTH
-#define ADD_EPI16 _mm_adds_epi16
-#define SUB_EPI16 _mm_subs_epi16
-#if FDCT32x32_HIGH_PRECISION
-void vp10_fdct32x32_rows_c(const int16_t *intermediate, tran_low_t *out) {
-  int i, j;
-  for (i = 0; i < 32; ++i) {
-    tran_high_t temp_in[32], temp_out[32];
-    for (j = 0; j < 32; ++j) temp_in[j] = intermediate[j * 32 + i];
-    vp10_fdct32(temp_in, temp_out, 0);
-    for (j = 0; j < 32; ++j)
-      out[j + i * 32] =
-          (tran_low_t)((temp_out[j] + 1 + (temp_out[j] < 0)) >> 2);
-  }
-}
-#define HIGH_FDCT32x32_2D_C vp10_highbd_fdct32x32_c
-#define HIGH_FDCT32x32_2D_ROWS_C vp10_fdct32x32_rows_c
-#else
-void vp10_fdct32x32_rd_rows_c(const int16_t *intermediate, tran_low_t *out) {
-  int i, j;
-  for (i = 0; i < 32; ++i) {
-    tran_high_t temp_in[32], temp_out[32];
-    for (j = 0; j < 32; ++j) temp_in[j] = intermediate[j * 32 + i];
-    vp10_fdct32(temp_in, temp_out, 1);
-    for (j = 0; j < 32; ++j) out[j + i * 32] = (tran_low_t)temp_out[j];
-  }
-}
-#define HIGH_FDCT32x32_2D_C vp10_highbd_fdct32x32_rd_c
-#define HIGH_FDCT32x32_2D_ROWS_C vp10_fdct32x32_rd_rows_c
-#endif  // FDCT32x32_HIGH_PRECISION
-#else
-#define ADD_EPI16 _mm_add_epi16
-#define SUB_EPI16 _mm_sub_epi16
-#endif  // DCT_HIGH_BIT_DEPTH
-
-void FDCT32x32_2D(const int16_t *input, tran_low_t *output_org, int stride) {
-  // Calculate pre-multiplied strides
-  const int str1 = stride;
-  const int str2 = 2 * stride;
-  const int str3 = 2 * stride + str1;
-  // We need an intermediate buffer between passes.
-  DECLARE_ALIGNED(16, int16_t, intermediate[32 * 32]);
-  // Constants
-  //    When we use them, in one case, they are all the same. In all others
-  //    it's a pair of them that we need to repeat four times. This is done
-  //    by constructing the 32 bit constant corresponding to that pair.
-  const __m128i k__cospi_p16_p16 = _mm_set1_epi16((int16_t)cospi_16_64);
-  const __m128i k__cospi_p16_m16 = pair_set_epi16(+cospi_16_64, -cospi_16_64);
-  const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64);
-  const __m128i k__cospi_m24_m08 = pair_set_epi16(-cospi_24_64, -cospi_8_64);
-  const __m128i k__cospi_p24_p08 = pair_set_epi16(+cospi_24_64, cospi_8_64);
-  const __m128i k__cospi_p12_p20 = pair_set_epi16(+cospi_12_64, cospi_20_64);
-  const __m128i k__cospi_m20_p12 = pair_set_epi16(-cospi_20_64, cospi_12_64);
-  const __m128i k__cospi_m04_p28 = pair_set_epi16(-cospi_4_64, cospi_28_64);
-  const __m128i k__cospi_p28_p04 = pair_set_epi16(+cospi_28_64, cospi_4_64);
-  const __m128i k__cospi_m28_m04 = pair_set_epi16(-cospi_28_64, -cospi_4_64);
-  const __m128i k__cospi_m12_m20 = pair_set_epi16(-cospi_12_64, -cospi_20_64);
-  const __m128i k__cospi_p30_p02 = pair_set_epi16(+cospi_30_64, cospi_2_64);
-  const __m128i k__cospi_p14_p18 = pair_set_epi16(+cospi_14_64, cospi_18_64);
-  const __m128i k__cospi_p22_p10 = pair_set_epi16(+cospi_22_64, cospi_10_64);
-  const __m128i k__cospi_p06_p26 = pair_set_epi16(+cospi_6_64, cospi_26_64);
-  const __m128i k__cospi_m26_p06 = pair_set_epi16(-cospi_26_64, cospi_6_64);
-  const __m128i k__cospi_m10_p22 = pair_set_epi16(-cospi_10_64, cospi_22_64);
-  const __m128i k__cospi_m18_p14 = pair_set_epi16(-cospi_18_64, cospi_14_64);
-  const __m128i k__cospi_m02_p30 = pair_set_epi16(-cospi_2_64, cospi_30_64);
-  const __m128i k__cospi_p31_p01 = pair_set_epi16(+cospi_31_64, cospi_1_64);
-  const __m128i k__cospi_p15_p17 = pair_set_epi16(+cospi_15_64, cospi_17_64);
-  const __m128i k__cospi_p23_p09 = pair_set_epi16(+cospi_23_64, cospi_9_64);
-  const __m128i k__cospi_p07_p25 = pair_set_epi16(+cospi_7_64, cospi_25_64);
-  const __m128i k__cospi_m25_p07 = pair_set_epi16(-cospi_25_64, cospi_7_64);
-  const __m128i k__cospi_m09_p23 = pair_set_epi16(-cospi_9_64, cospi_23_64);
-  const __m128i k__cospi_m17_p15 = pair_set_epi16(-cospi_17_64, cospi_15_64);
-  const __m128i k__cospi_m01_p31 = pair_set_epi16(-cospi_1_64, cospi_31_64);
-  const __m128i k__cospi_p27_p05 = pair_set_epi16(+cospi_27_64, cospi_5_64);
-  const __m128i k__cospi_p11_p21 = pair_set_epi16(+cospi_11_64, cospi_21_64);
-  const __m128i k__cospi_p19_p13 = pair_set_epi16(+cospi_19_64, cospi_13_64);
-  const __m128i k__cospi_p03_p29 = pair_set_epi16(+cospi_3_64, cospi_29_64);
-  const __m128i k__cospi_m29_p03 = pair_set_epi16(-cospi_29_64, cospi_3_64);
-  const __m128i k__cospi_m13_p19 = pair_set_epi16(-cospi_13_64, cospi_19_64);
-  const __m128i k__cospi_m21_p11 = pair_set_epi16(-cospi_21_64, cospi_11_64);
-  const __m128i k__cospi_m05_p27 = pair_set_epi16(-cospi_5_64, cospi_27_64);
-  const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING);
-  const __m128i kZero = _mm_set1_epi16(0);
-  const __m128i kOne = _mm_set1_epi16(1);
-  // Do the two transform/transpose passes
-  int pass;
-#if DCT_HIGH_BIT_DEPTH
-  int overflow;
-#endif
-  for (pass = 0; pass < 2; ++pass) {
-    // We process eight columns (transposed rows in second pass) at a time.
-    int column_start;
-    for (column_start = 0; column_start < 32; column_start += 8) {
-      __m128i step1[32];
-      __m128i step2[32];
-      __m128i step3[32];
-      __m128i out[32];
-      // Stage 1
-      // Note: even though all the loads below are aligned, using the aligned
-      //       intrinsic make the code slightly slower.
-      if (0 == pass) {
-        const int16_t *in = &input[column_start];
-        // step1[i] =  (in[ 0 * stride] + in[(32 -  1) * stride]) << 2;
-        // Note: the next four blocks could be in a loop. That would help the
-        //       instruction cache but is actually slower.
-        {
-          const int16_t *ina = in + 0 * str1;
-          const int16_t *inb = in + 31 * str1;
-          __m128i *step1a = &step1[0];
-          __m128i *step1b = &step1[31];
-          const __m128i ina0 = _mm_loadu_si128((const __m128i *)(ina));
-          const __m128i ina1 = _mm_loadu_si128((const __m128i *)(ina + str1));
-          const __m128i ina2 = _mm_loadu_si128((const __m128i *)(ina + str2));
-          const __m128i ina3 = _mm_loadu_si128((const __m128i *)(ina + str3));
-          const __m128i inb3 = _mm_loadu_si128((const __m128i *)(inb - str3));
-          const __m128i inb2 = _mm_loadu_si128((const __m128i *)(inb - str2));
-          const __m128i inb1 = _mm_loadu_si128((const __m128i *)(inb - str1));
-          const __m128i inb0 = _mm_loadu_si128((const __m128i *)(inb));
-          step1a[0] = _mm_add_epi16(ina0, inb0);
-          step1a[1] = _mm_add_epi16(ina1, inb1);
-          step1a[2] = _mm_add_epi16(ina2, inb2);
-          step1a[3] = _mm_add_epi16(ina3, inb3);
-          step1b[-3] = _mm_sub_epi16(ina3, inb3);
-          step1b[-2] = _mm_sub_epi16(ina2, inb2);
-          step1b[-1] = _mm_sub_epi16(ina1, inb1);
-          step1b[-0] = _mm_sub_epi16(ina0, inb0);
-          step1a[0] = _mm_slli_epi16(step1a[0], 2);
-          step1a[1] = _mm_slli_epi16(step1a[1], 2);
-          step1a[2] = _mm_slli_epi16(step1a[2], 2);
-          step1a[3] = _mm_slli_epi16(step1a[3], 2);
-          step1b[-3] = _mm_slli_epi16(step1b[-3], 2);
-          step1b[-2] = _mm_slli_epi16(step1b[-2], 2);
-          step1b[-1] = _mm_slli_epi16(step1b[-1], 2);
-          step1b[-0] = _mm_slli_epi16(step1b[-0], 2);
-        }
-        {
-          const int16_t *ina = in + 4 * str1;
-          const int16_t *inb = in + 27 * str1;
-          __m128i *step1a = &step1[4];
-          __m128i *step1b = &step1[27];
-          const __m128i ina0 = _mm_loadu_si128((const __m128i *)(ina));
-          const __m128i ina1 = _mm_loadu_si128((const __m128i *)(ina + str1));
-          const __m128i ina2 = _mm_loadu_si128((const __m128i *)(ina + str2));
-          const __m128i ina3 = _mm_loadu_si128((const __m128i *)(ina + str3));
-          const __m128i inb3 = _mm_loadu_si128((const __m128i *)(inb - str3));
-          const __m128i inb2 = _mm_loadu_si128((const __m128i *)(inb - str2));
-          const __m128i inb1 = _mm_loadu_si128((const __m128i *)(inb - str1));
-          const __m128i inb0 = _mm_loadu_si128((const __m128i *)(inb));
-          step1a[0] = _mm_add_epi16(ina0, inb0);
-          step1a[1] = _mm_add_epi16(ina1, inb1);
-          step1a[2] = _mm_add_epi16(ina2, inb2);
-          step1a[3] = _mm_add_epi16(ina3, inb3);
-          step1b[-3] = _mm_sub_epi16(ina3, inb3);
-          step1b[-2] = _mm_sub_epi16(ina2, inb2);
-          step1b[-1] = _mm_sub_epi16(ina1, inb1);
-          step1b[-0] = _mm_sub_epi16(ina0, inb0);
-          step1a[0] = _mm_slli_epi16(step1a[0], 2);
-          step1a[1] = _mm_slli_epi16(step1a[1], 2);
-          step1a[2] = _mm_slli_epi16(step1a[2], 2);
-          step1a[3] = _mm_slli_epi16(step1a[3], 2);
-          step1b[-3] = _mm_slli_epi16(step1b[-3], 2);
-          step1b[-2] = _mm_slli_epi16(step1b[-2], 2);
-          step1b[-1] = _mm_slli_epi16(step1b[-1], 2);
-          step1b[-0] = _mm_slli_epi16(step1b[-0], 2);
-        }
-        {
-          const int16_t *ina = in + 8 * str1;
-          const int16_t *inb = in + 23 * str1;
-          __m128i *step1a = &step1[8];
-          __m128i *step1b = &step1[23];
-          const __m128i ina0 = _mm_loadu_si128((const __m128i *)(ina));
-          const __m128i ina1 = _mm_loadu_si128((const __m128i *)(ina + str1));
-          const __m128i ina2 = _mm_loadu_si128((const __m128i *)(ina + str2));
-          const __m128i ina3 = _mm_loadu_si128((const __m128i *)(ina + str3));
-          const __m128i inb3 = _mm_loadu_si128((const __m128i *)(inb - str3));
-          const __m128i inb2 = _mm_loadu_si128((const __m128i *)(inb - str2));
-          const __m128i inb1 = _mm_loadu_si128((const __m128i *)(inb - str1));
-          const __m128i inb0 = _mm_loadu_si128((const __m128i *)(inb));
-          step1a[0] = _mm_add_epi16(ina0, inb0);
-          step1a[1] = _mm_add_epi16(ina1, inb1);
-          step1a[2] = _mm_add_epi16(ina2, inb2);
-          step1a[3] = _mm_add_epi16(ina3, inb3);
-          step1b[-3] = _mm_sub_epi16(ina3, inb3);
-          step1b[-2] = _mm_sub_epi16(ina2, inb2);
-          step1b[-1] = _mm_sub_epi16(ina1, inb1);
-          step1b[-0] = _mm_sub_epi16(ina0, inb0);
-          step1a[0] = _mm_slli_epi16(step1a[0], 2);
-          step1a[1] = _mm_slli_epi16(step1a[1], 2);
-          step1a[2] = _mm_slli_epi16(step1a[2], 2);
-          step1a[3] = _mm_slli_epi16(step1a[3], 2);
-          step1b[-3] = _mm_slli_epi16(step1b[-3], 2);
-          step1b[-2] = _mm_slli_epi16(step1b[-2], 2);
-          step1b[-1] = _mm_slli_epi16(step1b[-1], 2);
-          step1b[-0] = _mm_slli_epi16(step1b[-0], 2);
-        }
-        {
-          const int16_t *ina = in + 12 * str1;
-          const int16_t *inb = in + 19 * str1;
-          __m128i *step1a = &step1[12];
-          __m128i *step1b = &step1[19];
-          const __m128i ina0 = _mm_loadu_si128((const __m128i *)(ina));
-          const __m128i ina1 = _mm_loadu_si128((const __m128i *)(ina + str1));
-          const __m128i ina2 = _mm_loadu_si128((const __m128i *)(ina + str2));
-          const __m128i ina3 = _mm_loadu_si128((const __m128i *)(ina + str3));
-          const __m128i inb3 = _mm_loadu_si128((const __m128i *)(inb - str3));
-          const __m128i inb2 = _mm_loadu_si128((const __m128i *)(inb - str2));
-          const __m128i inb1 = _mm_loadu_si128((const __m128i *)(inb - str1));
-          const __m128i inb0 = _mm_loadu_si128((const __m128i *)(inb));
-          step1a[0] = _mm_add_epi16(ina0, inb0);
-          step1a[1] = _mm_add_epi16(ina1, inb1);
-          step1a[2] = _mm_add_epi16(ina2, inb2);
-          step1a[3] = _mm_add_epi16(ina3, inb3);
-          step1b[-3] = _mm_sub_epi16(ina3, inb3);
-          step1b[-2] = _mm_sub_epi16(ina2, inb2);
-          step1b[-1] = _mm_sub_epi16(ina1, inb1);
-          step1b[-0] = _mm_sub_epi16(ina0, inb0);
-          step1a[0] = _mm_slli_epi16(step1a[0], 2);
-          step1a[1] = _mm_slli_epi16(step1a[1], 2);
-          step1a[2] = _mm_slli_epi16(step1a[2], 2);
-          step1a[3] = _mm_slli_epi16(step1a[3], 2);
-          step1b[-3] = _mm_slli_epi16(step1b[-3], 2);
-          step1b[-2] = _mm_slli_epi16(step1b[-2], 2);
-          step1b[-1] = _mm_slli_epi16(step1b[-1], 2);
-          step1b[-0] = _mm_slli_epi16(step1b[-0], 2);
-        }
-      } else {
-        int16_t *in = &intermediate[column_start];
-        // step1[i] =  in[ 0 * 32] + in[(32 -  1) * 32];
-        // Note: using the same approach as above to have common offset is
-        //       counter-productive as all offsets can be calculated at compile
-        //       time.
-        // Note: the next four blocks could be in a loop. That would help the
-        //       instruction cache but is actually slower.
-        {
-          __m128i in00 = _mm_loadu_si128((const __m128i *)(in + 0 * 32));
-          __m128i in01 = _mm_loadu_si128((const __m128i *)(in + 1 * 32));
-          __m128i in02 = _mm_loadu_si128((const __m128i *)(in + 2 * 32));
-          __m128i in03 = _mm_loadu_si128((const __m128i *)(in + 3 * 32));
-          __m128i in28 = _mm_loadu_si128((const __m128i *)(in + 28 * 32));
-          __m128i in29 = _mm_loadu_si128((const __m128i *)(in + 29 * 32));
-          __m128i in30 = _mm_loadu_si128((const __m128i *)(in + 30 * 32));
-          __m128i in31 = _mm_loadu_si128((const __m128i *)(in + 31 * 32));
-          step1[0] = ADD_EPI16(in00, in31);
-          step1[1] = ADD_EPI16(in01, in30);
-          step1[2] = ADD_EPI16(in02, in29);
-          step1[3] = ADD_EPI16(in03, in28);
-          step1[28] = SUB_EPI16(in03, in28);
-          step1[29] = SUB_EPI16(in02, in29);
-          step1[30] = SUB_EPI16(in01, in30);
-          step1[31] = SUB_EPI16(in00, in31);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x8(&step1[0], &step1[1], &step1[2],
-                                             &step1[3], &step1[28], &step1[29],
-                                             &step1[30], &step1[31]);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          __m128i in04 = _mm_loadu_si128((const __m128i *)(in + 4 * 32));
-          __m128i in05 = _mm_loadu_si128((const __m128i *)(in + 5 * 32));
-          __m128i in06 = _mm_loadu_si128((const __m128i *)(in + 6 * 32));
-          __m128i in07 = _mm_loadu_si128((const __m128i *)(in + 7 * 32));
-          __m128i in24 = _mm_loadu_si128((const __m128i *)(in + 24 * 32));
-          __m128i in25 = _mm_loadu_si128((const __m128i *)(in + 25 * 32));
-          __m128i in26 = _mm_loadu_si128((const __m128i *)(in + 26 * 32));
-          __m128i in27 = _mm_loadu_si128((const __m128i *)(in + 27 * 32));
-          step1[4] = ADD_EPI16(in04, in27);
-          step1[5] = ADD_EPI16(in05, in26);
-          step1[6] = ADD_EPI16(in06, in25);
-          step1[7] = ADD_EPI16(in07, in24);
-          step1[24] = SUB_EPI16(in07, in24);
-          step1[25] = SUB_EPI16(in06, in25);
-          step1[26] = SUB_EPI16(in05, in26);
-          step1[27] = SUB_EPI16(in04, in27);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x8(&step1[4], &step1[5], &step1[6],
-                                             &step1[7], &step1[24], &step1[25],
-                                             &step1[26], &step1[27]);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          __m128i in08 = _mm_loadu_si128((const __m128i *)(in + 8 * 32));
-          __m128i in09 = _mm_loadu_si128((const __m128i *)(in + 9 * 32));
-          __m128i in10 = _mm_loadu_si128((const __m128i *)(in + 10 * 32));
-          __m128i in11 = _mm_loadu_si128((const __m128i *)(in + 11 * 32));
-          __m128i in20 = _mm_loadu_si128((const __m128i *)(in + 20 * 32));
-          __m128i in21 = _mm_loadu_si128((const __m128i *)(in + 21 * 32));
-          __m128i in22 = _mm_loadu_si128((const __m128i *)(in + 22 * 32));
-          __m128i in23 = _mm_loadu_si128((const __m128i *)(in + 23 * 32));
-          step1[8] = ADD_EPI16(in08, in23);
-          step1[9] = ADD_EPI16(in09, in22);
-          step1[10] = ADD_EPI16(in10, in21);
-          step1[11] = ADD_EPI16(in11, in20);
-          step1[20] = SUB_EPI16(in11, in20);
-          step1[21] = SUB_EPI16(in10, in21);
-          step1[22] = SUB_EPI16(in09, in22);
-          step1[23] = SUB_EPI16(in08, in23);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x8(&step1[8], &step1[9], &step1[10],
-                                             &step1[11], &step1[20], &step1[21],
-                                             &step1[22], &step1[23]);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          __m128i in12 = _mm_loadu_si128((const __m128i *)(in + 12 * 32));
-          __m128i in13 = _mm_loadu_si128((const __m128i *)(in + 13 * 32));
-          __m128i in14 = _mm_loadu_si128((const __m128i *)(in + 14 * 32));
-          __m128i in15 = _mm_loadu_si128((const __m128i *)(in + 15 * 32));
-          __m128i in16 = _mm_loadu_si128((const __m128i *)(in + 16 * 32));
-          __m128i in17 = _mm_loadu_si128((const __m128i *)(in + 17 * 32));
-          __m128i in18 = _mm_loadu_si128((const __m128i *)(in + 18 * 32));
-          __m128i in19 = _mm_loadu_si128((const __m128i *)(in + 19 * 32));
-          step1[12] = ADD_EPI16(in12, in19);
-          step1[13] = ADD_EPI16(in13, in18);
-          step1[14] = ADD_EPI16(in14, in17);
-          step1[15] = ADD_EPI16(in15, in16);
-          step1[16] = SUB_EPI16(in15, in16);
-          step1[17] = SUB_EPI16(in14, in17);
-          step1[18] = SUB_EPI16(in13, in18);
-          step1[19] = SUB_EPI16(in12, in19);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x8(&step1[12], &step1[13], &step1[14],
-                                             &step1[15], &step1[16], &step1[17],
-                                             &step1[18], &step1[19]);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-      }
-      // Stage 2
-      {
-        step2[0] = ADD_EPI16(step1[0], step1[15]);
-        step2[1] = ADD_EPI16(step1[1], step1[14]);
-        step2[2] = ADD_EPI16(step1[2], step1[13]);
-        step2[3] = ADD_EPI16(step1[3], step1[12]);
-        step2[4] = ADD_EPI16(step1[4], step1[11]);
-        step2[5] = ADD_EPI16(step1[5], step1[10]);
-        step2[6] = ADD_EPI16(step1[6], step1[9]);
-        step2[7] = ADD_EPI16(step1[7], step1[8]);
-        step2[8] = SUB_EPI16(step1[7], step1[8]);
-        step2[9] = SUB_EPI16(step1[6], step1[9]);
-        step2[10] = SUB_EPI16(step1[5], step1[10]);
-        step2[11] = SUB_EPI16(step1[4], step1[11]);
-        step2[12] = SUB_EPI16(step1[3], step1[12]);
-        step2[13] = SUB_EPI16(step1[2], step1[13]);
-        step2[14] = SUB_EPI16(step1[1], step1[14]);
-        step2[15] = SUB_EPI16(step1[0], step1[15]);
-#if DCT_HIGH_BIT_DEPTH
-        overflow = check_epi16_overflow_x16(
-            &step2[0], &step2[1], &step2[2], &step2[3], &step2[4], &step2[5],
-            &step2[6], &step2[7], &step2[8], &step2[9], &step2[10], &step2[11],
-            &step2[12], &step2[13], &step2[14], &step2[15]);
-        if (overflow) {
-          if (pass == 0)
-            HIGH_FDCT32x32_2D_C(input, output_org, stride);
-          else
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-          return;
-        }
-#endif  // DCT_HIGH_BIT_DEPTH
-      }
-      {
-        const __m128i s2_20_0 = _mm_unpacklo_epi16(step1[27], step1[20]);
-        const __m128i s2_20_1 = _mm_unpackhi_epi16(step1[27], step1[20]);
-        const __m128i s2_21_0 = _mm_unpacklo_epi16(step1[26], step1[21]);
-        const __m128i s2_21_1 = _mm_unpackhi_epi16(step1[26], step1[21]);
-        const __m128i s2_22_0 = _mm_unpacklo_epi16(step1[25], step1[22]);
-        const __m128i s2_22_1 = _mm_unpackhi_epi16(step1[25], step1[22]);
-        const __m128i s2_23_0 = _mm_unpacklo_epi16(step1[24], step1[23]);
-        const __m128i s2_23_1 = _mm_unpackhi_epi16(step1[24], step1[23]);
-        const __m128i s2_20_2 = _mm_madd_epi16(s2_20_0, k__cospi_p16_m16);
-        const __m128i s2_20_3 = _mm_madd_epi16(s2_20_1, k__cospi_p16_m16);
-        const __m128i s2_21_2 = _mm_madd_epi16(s2_21_0, k__cospi_p16_m16);
-        const __m128i s2_21_3 = _mm_madd_epi16(s2_21_1, k__cospi_p16_m16);
-        const __m128i s2_22_2 = _mm_madd_epi16(s2_22_0, k__cospi_p16_m16);
-        const __m128i s2_22_3 = _mm_madd_epi16(s2_22_1, k__cospi_p16_m16);
-        const __m128i s2_23_2 = _mm_madd_epi16(s2_23_0, k__cospi_p16_m16);
-        const __m128i s2_23_3 = _mm_madd_epi16(s2_23_1, k__cospi_p16_m16);
-        const __m128i s2_24_2 = _mm_madd_epi16(s2_23_0, k__cospi_p16_p16);
-        const __m128i s2_24_3 = _mm_madd_epi16(s2_23_1, k__cospi_p16_p16);
-        const __m128i s2_25_2 = _mm_madd_epi16(s2_22_0, k__cospi_p16_p16);
-        const __m128i s2_25_3 = _mm_madd_epi16(s2_22_1, k__cospi_p16_p16);
-        const __m128i s2_26_2 = _mm_madd_epi16(s2_21_0, k__cospi_p16_p16);
-        const __m128i s2_26_3 = _mm_madd_epi16(s2_21_1, k__cospi_p16_p16);
-        const __m128i s2_27_2 = _mm_madd_epi16(s2_20_0, k__cospi_p16_p16);
-        const __m128i s2_27_3 = _mm_madd_epi16(s2_20_1, k__cospi_p16_p16);
-        // dct_const_round_shift
-        const __m128i s2_20_4 = _mm_add_epi32(s2_20_2, k__DCT_CONST_ROUNDING);
-        const __m128i s2_20_5 = _mm_add_epi32(s2_20_3, k__DCT_CONST_ROUNDING);
-        const __m128i s2_21_4 = _mm_add_epi32(s2_21_2, k__DCT_CONST_ROUNDING);
-        const __m128i s2_21_5 = _mm_add_epi32(s2_21_3, k__DCT_CONST_ROUNDING);
-        const __m128i s2_22_4 = _mm_add_epi32(s2_22_2, k__DCT_CONST_ROUNDING);
-        const __m128i s2_22_5 = _mm_add_epi32(s2_22_3, k__DCT_CONST_ROUNDING);
-        const __m128i s2_23_4 = _mm_add_epi32(s2_23_2, k__DCT_CONST_ROUNDING);
-        const __m128i s2_23_5 = _mm_add_epi32(s2_23_3, k__DCT_CONST_ROUNDING);
-        const __m128i s2_24_4 = _mm_add_epi32(s2_24_2, k__DCT_CONST_ROUNDING);
-        const __m128i s2_24_5 = _mm_add_epi32(s2_24_3, k__DCT_CONST_ROUNDING);
-        const __m128i s2_25_4 = _mm_add_epi32(s2_25_2, k__DCT_CONST_ROUNDING);
-        const __m128i s2_25_5 = _mm_add_epi32(s2_25_3, k__DCT_CONST_ROUNDING);
-        const __m128i s2_26_4 = _mm_add_epi32(s2_26_2, k__DCT_CONST_ROUNDING);
-        const __m128i s2_26_5 = _mm_add_epi32(s2_26_3, k__DCT_CONST_ROUNDING);
-        const __m128i s2_27_4 = _mm_add_epi32(s2_27_2, k__DCT_CONST_ROUNDING);
-        const __m128i s2_27_5 = _mm_add_epi32(s2_27_3, k__DCT_CONST_ROUNDING);
-        const __m128i s2_20_6 = _mm_srai_epi32(s2_20_4, DCT_CONST_BITS);
-        const __m128i s2_20_7 = _mm_srai_epi32(s2_20_5, DCT_CONST_BITS);
-        const __m128i s2_21_6 = _mm_srai_epi32(s2_21_4, DCT_CONST_BITS);
-        const __m128i s2_21_7 = _mm_srai_epi32(s2_21_5, DCT_CONST_BITS);
-        const __m128i s2_22_6 = _mm_srai_epi32(s2_22_4, DCT_CONST_BITS);
-        const __m128i s2_22_7 = _mm_srai_epi32(s2_22_5, DCT_CONST_BITS);
-        const __m128i s2_23_6 = _mm_srai_epi32(s2_23_4, DCT_CONST_BITS);
-        const __m128i s2_23_7 = _mm_srai_epi32(s2_23_5, DCT_CONST_BITS);
-        const __m128i s2_24_6 = _mm_srai_epi32(s2_24_4, DCT_CONST_BITS);
-        const __m128i s2_24_7 = _mm_srai_epi32(s2_24_5, DCT_CONST_BITS);
-        const __m128i s2_25_6 = _mm_srai_epi32(s2_25_4, DCT_CONST_BITS);
-        const __m128i s2_25_7 = _mm_srai_epi32(s2_25_5, DCT_CONST_BITS);
-        const __m128i s2_26_6 = _mm_srai_epi32(s2_26_4, DCT_CONST_BITS);
-        const __m128i s2_26_7 = _mm_srai_epi32(s2_26_5, DCT_CONST_BITS);
-        const __m128i s2_27_6 = _mm_srai_epi32(s2_27_4, DCT_CONST_BITS);
-        const __m128i s2_27_7 = _mm_srai_epi32(s2_27_5, DCT_CONST_BITS);
-        // Combine
-        step2[20] = _mm_packs_epi32(s2_20_6, s2_20_7);
-        step2[21] = _mm_packs_epi32(s2_21_6, s2_21_7);
-        step2[22] = _mm_packs_epi32(s2_22_6, s2_22_7);
-        step2[23] = _mm_packs_epi32(s2_23_6, s2_23_7);
-        step2[24] = _mm_packs_epi32(s2_24_6, s2_24_7);
-        step2[25] = _mm_packs_epi32(s2_25_6, s2_25_7);
-        step2[26] = _mm_packs_epi32(s2_26_6, s2_26_7);
-        step2[27] = _mm_packs_epi32(s2_27_6, s2_27_7);
-#if DCT_HIGH_BIT_DEPTH
-        overflow = check_epi16_overflow_x8(&step2[20], &step2[21], &step2[22],
-                                           &step2[23], &step2[24], &step2[25],
-                                           &step2[26], &step2[27]);
-        if (overflow) {
-          if (pass == 0)
-            HIGH_FDCT32x32_2D_C(input, output_org, stride);
-          else
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-          return;
-        }
-#endif  // DCT_HIGH_BIT_DEPTH
-      }
-
-#if !FDCT32x32_HIGH_PRECISION
-      // dump the magnitude by half, hence the intermediate values are within
-      // the range of 16 bits.
-      if (1 == pass) {
-        __m128i s3_00_0 = _mm_cmplt_epi16(step2[0], kZero);
-        __m128i s3_01_0 = _mm_cmplt_epi16(step2[1], kZero);
-        __m128i s3_02_0 = _mm_cmplt_epi16(step2[2], kZero);
-        __m128i s3_03_0 = _mm_cmplt_epi16(step2[3], kZero);
-        __m128i s3_04_0 = _mm_cmplt_epi16(step2[4], kZero);
-        __m128i s3_05_0 = _mm_cmplt_epi16(step2[5], kZero);
-        __m128i s3_06_0 = _mm_cmplt_epi16(step2[6], kZero);
-        __m128i s3_07_0 = _mm_cmplt_epi16(step2[7], kZero);
-        __m128i s2_08_0 = _mm_cmplt_epi16(step2[8], kZero);
-        __m128i s2_09_0 = _mm_cmplt_epi16(step2[9], kZero);
-        __m128i s3_10_0 = _mm_cmplt_epi16(step2[10], kZero);
-        __m128i s3_11_0 = _mm_cmplt_epi16(step2[11], kZero);
-        __m128i s3_12_0 = _mm_cmplt_epi16(step2[12], kZero);
-        __m128i s3_13_0 = _mm_cmplt_epi16(step2[13], kZero);
-        __m128i s2_14_0 = _mm_cmplt_epi16(step2[14], kZero);
-        __m128i s2_15_0 = _mm_cmplt_epi16(step2[15], kZero);
-        __m128i s3_16_0 = _mm_cmplt_epi16(step1[16], kZero);
-        __m128i s3_17_0 = _mm_cmplt_epi16(step1[17], kZero);
-        __m128i s3_18_0 = _mm_cmplt_epi16(step1[18], kZero);
-        __m128i s3_19_0 = _mm_cmplt_epi16(step1[19], kZero);
-        __m128i s3_20_0 = _mm_cmplt_epi16(step2[20], kZero);
-        __m128i s3_21_0 = _mm_cmplt_epi16(step2[21], kZero);
-        __m128i s3_22_0 = _mm_cmplt_epi16(step2[22], kZero);
-        __m128i s3_23_0 = _mm_cmplt_epi16(step2[23], kZero);
-        __m128i s3_24_0 = _mm_cmplt_epi16(step2[24], kZero);
-        __m128i s3_25_0 = _mm_cmplt_epi16(step2[25], kZero);
-        __m128i s3_26_0 = _mm_cmplt_epi16(step2[26], kZero);
-        __m128i s3_27_0 = _mm_cmplt_epi16(step2[27], kZero);
-        __m128i s3_28_0 = _mm_cmplt_epi16(step1[28], kZero);
-        __m128i s3_29_0 = _mm_cmplt_epi16(step1[29], kZero);
-        __m128i s3_30_0 = _mm_cmplt_epi16(step1[30], kZero);
-        __m128i s3_31_0 = _mm_cmplt_epi16(step1[31], kZero);
-
-        step2[0] = SUB_EPI16(step2[0], s3_00_0);
-        step2[1] = SUB_EPI16(step2[1], s3_01_0);
-        step2[2] = SUB_EPI16(step2[2], s3_02_0);
-        step2[3] = SUB_EPI16(step2[3], s3_03_0);
-        step2[4] = SUB_EPI16(step2[4], s3_04_0);
-        step2[5] = SUB_EPI16(step2[5], s3_05_0);
-        step2[6] = SUB_EPI16(step2[6], s3_06_0);
-        step2[7] = SUB_EPI16(step2[7], s3_07_0);
-        step2[8] = SUB_EPI16(step2[8], s2_08_0);
-        step2[9] = SUB_EPI16(step2[9], s2_09_0);
-        step2[10] = SUB_EPI16(step2[10], s3_10_0);
-        step2[11] = SUB_EPI16(step2[11], s3_11_0);
-        step2[12] = SUB_EPI16(step2[12], s3_12_0);
-        step2[13] = SUB_EPI16(step2[13], s3_13_0);
-        step2[14] = SUB_EPI16(step2[14], s2_14_0);
-        step2[15] = SUB_EPI16(step2[15], s2_15_0);
-        step1[16] = SUB_EPI16(step1[16], s3_16_0);
-        step1[17] = SUB_EPI16(step1[17], s3_17_0);
-        step1[18] = SUB_EPI16(step1[18], s3_18_0);
-        step1[19] = SUB_EPI16(step1[19], s3_19_0);
-        step2[20] = SUB_EPI16(step2[20], s3_20_0);
-        step2[21] = SUB_EPI16(step2[21], s3_21_0);
-        step2[22] = SUB_EPI16(step2[22], s3_22_0);
-        step2[23] = SUB_EPI16(step2[23], s3_23_0);
-        step2[24] = SUB_EPI16(step2[24], s3_24_0);
-        step2[25] = SUB_EPI16(step2[25], s3_25_0);
-        step2[26] = SUB_EPI16(step2[26], s3_26_0);
-        step2[27] = SUB_EPI16(step2[27], s3_27_0);
-        step1[28] = SUB_EPI16(step1[28], s3_28_0);
-        step1[29] = SUB_EPI16(step1[29], s3_29_0);
-        step1[30] = SUB_EPI16(step1[30], s3_30_0);
-        step1[31] = SUB_EPI16(step1[31], s3_31_0);
-#if DCT_HIGH_BIT_DEPTH
-        overflow = check_epi16_overflow_x32(
-            &step2[0], &step2[1], &step2[2], &step2[3], &step2[4], &step2[5],
-            &step2[6], &step2[7], &step2[8], &step2[9], &step2[10], &step2[11],
-            &step2[12], &step2[13], &step2[14], &step2[15], &step1[16],
-            &step1[17], &step1[18], &step1[19], &step2[20], &step2[21],
-            &step2[22], &step2[23], &step2[24], &step2[25], &step2[26],
-            &step2[27], &step1[28], &step1[29], &step1[30], &step1[31]);
-        if (overflow) {
-          HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-          return;
-        }
-#endif  // DCT_HIGH_BIT_DEPTH
-        step2[0] = _mm_add_epi16(step2[0], kOne);
-        step2[1] = _mm_add_epi16(step2[1], kOne);
-        step2[2] = _mm_add_epi16(step2[2], kOne);
-        step2[3] = _mm_add_epi16(step2[3], kOne);
-        step2[4] = _mm_add_epi16(step2[4], kOne);
-        step2[5] = _mm_add_epi16(step2[5], kOne);
-        step2[6] = _mm_add_epi16(step2[6], kOne);
-        step2[7] = _mm_add_epi16(step2[7], kOne);
-        step2[8] = _mm_add_epi16(step2[8], kOne);
-        step2[9] = _mm_add_epi16(step2[9], kOne);
-        step2[10] = _mm_add_epi16(step2[10], kOne);
-        step2[11] = _mm_add_epi16(step2[11], kOne);
-        step2[12] = _mm_add_epi16(step2[12], kOne);
-        step2[13] = _mm_add_epi16(step2[13], kOne);
-        step2[14] = _mm_add_epi16(step2[14], kOne);
-        step2[15] = _mm_add_epi16(step2[15], kOne);
-        step1[16] = _mm_add_epi16(step1[16], kOne);
-        step1[17] = _mm_add_epi16(step1[17], kOne);
-        step1[18] = _mm_add_epi16(step1[18], kOne);
-        step1[19] = _mm_add_epi16(step1[19], kOne);
-        step2[20] = _mm_add_epi16(step2[20], kOne);
-        step2[21] = _mm_add_epi16(step2[21], kOne);
-        step2[22] = _mm_add_epi16(step2[22], kOne);
-        step2[23] = _mm_add_epi16(step2[23], kOne);
-        step2[24] = _mm_add_epi16(step2[24], kOne);
-        step2[25] = _mm_add_epi16(step2[25], kOne);
-        step2[26] = _mm_add_epi16(step2[26], kOne);
-        step2[27] = _mm_add_epi16(step2[27], kOne);
-        step1[28] = _mm_add_epi16(step1[28], kOne);
-        step1[29] = _mm_add_epi16(step1[29], kOne);
-        step1[30] = _mm_add_epi16(step1[30], kOne);
-        step1[31] = _mm_add_epi16(step1[31], kOne);
-
-        step2[0] = _mm_srai_epi16(step2[0], 2);
-        step2[1] = _mm_srai_epi16(step2[1], 2);
-        step2[2] = _mm_srai_epi16(step2[2], 2);
-        step2[3] = _mm_srai_epi16(step2[3], 2);
-        step2[4] = _mm_srai_epi16(step2[4], 2);
-        step2[5] = _mm_srai_epi16(step2[5], 2);
-        step2[6] = _mm_srai_epi16(step2[6], 2);
-        step2[7] = _mm_srai_epi16(step2[7], 2);
-        step2[8] = _mm_srai_epi16(step2[8], 2);
-        step2[9] = _mm_srai_epi16(step2[9], 2);
-        step2[10] = _mm_srai_epi16(step2[10], 2);
-        step2[11] = _mm_srai_epi16(step2[11], 2);
-        step2[12] = _mm_srai_epi16(step2[12], 2);
-        step2[13] = _mm_srai_epi16(step2[13], 2);
-        step2[14] = _mm_srai_epi16(step2[14], 2);
-        step2[15] = _mm_srai_epi16(step2[15], 2);
-        step1[16] = _mm_srai_epi16(step1[16], 2);
-        step1[17] = _mm_srai_epi16(step1[17], 2);
-        step1[18] = _mm_srai_epi16(step1[18], 2);
-        step1[19] = _mm_srai_epi16(step1[19], 2);
-        step2[20] = _mm_srai_epi16(step2[20], 2);
-        step2[21] = _mm_srai_epi16(step2[21], 2);
-        step2[22] = _mm_srai_epi16(step2[22], 2);
-        step2[23] = _mm_srai_epi16(step2[23], 2);
-        step2[24] = _mm_srai_epi16(step2[24], 2);
-        step2[25] = _mm_srai_epi16(step2[25], 2);
-        step2[26] = _mm_srai_epi16(step2[26], 2);
-        step2[27] = _mm_srai_epi16(step2[27], 2);
-        step1[28] = _mm_srai_epi16(step1[28], 2);
-        step1[29] = _mm_srai_epi16(step1[29], 2);
-        step1[30] = _mm_srai_epi16(step1[30], 2);
-        step1[31] = _mm_srai_epi16(step1[31], 2);
-      }
-#endif  // !FDCT32x32_HIGH_PRECISION
-
-#if FDCT32x32_HIGH_PRECISION
-      if (pass == 0) {
-#endif
-        // Stage 3
-        {
-          step3[0] = ADD_EPI16(step2[(8 - 1)], step2[0]);
-          step3[1] = ADD_EPI16(step2[(8 - 2)], step2[1]);
-          step3[2] = ADD_EPI16(step2[(8 - 3)], step2[2]);
-          step3[3] = ADD_EPI16(step2[(8 - 4)], step2[3]);
-          step3[4] = SUB_EPI16(step2[(8 - 5)], step2[4]);
-          step3[5] = SUB_EPI16(step2[(8 - 6)], step2[5]);
-          step3[6] = SUB_EPI16(step2[(8 - 7)], step2[6]);
-          step3[7] = SUB_EPI16(step2[(8 - 8)], step2[7]);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x8(&step3[0], &step3[1], &step3[2],
-                                             &step3[3], &step3[4], &step3[5],
-                                             &step3[6], &step3[7]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          const __m128i s3_10_0 = _mm_unpacklo_epi16(step2[13], step2[10]);
-          const __m128i s3_10_1 = _mm_unpackhi_epi16(step2[13], step2[10]);
-          const __m128i s3_11_0 = _mm_unpacklo_epi16(step2[12], step2[11]);
-          const __m128i s3_11_1 = _mm_unpackhi_epi16(step2[12], step2[11]);
-          const __m128i s3_10_2 = _mm_madd_epi16(s3_10_0, k__cospi_p16_m16);
-          const __m128i s3_10_3 = _mm_madd_epi16(s3_10_1, k__cospi_p16_m16);
-          const __m128i s3_11_2 = _mm_madd_epi16(s3_11_0, k__cospi_p16_m16);
-          const __m128i s3_11_3 = _mm_madd_epi16(s3_11_1, k__cospi_p16_m16);
-          const __m128i s3_12_2 = _mm_madd_epi16(s3_11_0, k__cospi_p16_p16);
-          const __m128i s3_12_3 = _mm_madd_epi16(s3_11_1, k__cospi_p16_p16);
-          const __m128i s3_13_2 = _mm_madd_epi16(s3_10_0, k__cospi_p16_p16);
-          const __m128i s3_13_3 = _mm_madd_epi16(s3_10_1, k__cospi_p16_p16);
-          // dct_const_round_shift
-          const __m128i s3_10_4 = _mm_add_epi32(s3_10_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_10_5 = _mm_add_epi32(s3_10_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_11_4 = _mm_add_epi32(s3_11_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_11_5 = _mm_add_epi32(s3_11_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_12_4 = _mm_add_epi32(s3_12_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_12_5 = _mm_add_epi32(s3_12_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_13_4 = _mm_add_epi32(s3_13_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_13_5 = _mm_add_epi32(s3_13_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_10_6 = _mm_srai_epi32(s3_10_4, DCT_CONST_BITS);
-          const __m128i s3_10_7 = _mm_srai_epi32(s3_10_5, DCT_CONST_BITS);
-          const __m128i s3_11_6 = _mm_srai_epi32(s3_11_4, DCT_CONST_BITS);
-          const __m128i s3_11_7 = _mm_srai_epi32(s3_11_5, DCT_CONST_BITS);
-          const __m128i s3_12_6 = _mm_srai_epi32(s3_12_4, DCT_CONST_BITS);
-          const __m128i s3_12_7 = _mm_srai_epi32(s3_12_5, DCT_CONST_BITS);
-          const __m128i s3_13_6 = _mm_srai_epi32(s3_13_4, DCT_CONST_BITS);
-          const __m128i s3_13_7 = _mm_srai_epi32(s3_13_5, DCT_CONST_BITS);
-          // Combine
-          step3[10] = _mm_packs_epi32(s3_10_6, s3_10_7);
-          step3[11] = _mm_packs_epi32(s3_11_6, s3_11_7);
-          step3[12] = _mm_packs_epi32(s3_12_6, s3_12_7);
-          step3[13] = _mm_packs_epi32(s3_13_6, s3_13_7);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x4(&step3[10], &step3[11], &step3[12],
-                                             &step3[13]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          step3[16] = ADD_EPI16(step2[23], step1[16]);
-          step3[17] = ADD_EPI16(step2[22], step1[17]);
-          step3[18] = ADD_EPI16(step2[21], step1[18]);
-          step3[19] = ADD_EPI16(step2[20], step1[19]);
-          step3[20] = SUB_EPI16(step1[19], step2[20]);
-          step3[21] = SUB_EPI16(step1[18], step2[21]);
-          step3[22] = SUB_EPI16(step1[17], step2[22]);
-          step3[23] = SUB_EPI16(step1[16], step2[23]);
-          step3[24] = SUB_EPI16(step1[31], step2[24]);
-          step3[25] = SUB_EPI16(step1[30], step2[25]);
-          step3[26] = SUB_EPI16(step1[29], step2[26]);
-          step3[27] = SUB_EPI16(step1[28], step2[27]);
-          step3[28] = ADD_EPI16(step2[27], step1[28]);
-          step3[29] = ADD_EPI16(step2[26], step1[29]);
-          step3[30] = ADD_EPI16(step2[25], step1[30]);
-          step3[31] = ADD_EPI16(step2[24], step1[31]);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x16(
-              &step3[16], &step3[17], &step3[18], &step3[19], &step3[20],
-              &step3[21], &step3[22], &step3[23], &step3[24], &step3[25],
-              &step3[26], &step3[27], &step3[28], &step3[29], &step3[30],
-              &step3[31]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-
-        // Stage 4
-        {
-          step1[0] = ADD_EPI16(step3[3], step3[0]);
-          step1[1] = ADD_EPI16(step3[2], step3[1]);
-          step1[2] = SUB_EPI16(step3[1], step3[2]);
-          step1[3] = SUB_EPI16(step3[0], step3[3]);
-          step1[8] = ADD_EPI16(step3[11], step2[8]);
-          step1[9] = ADD_EPI16(step3[10], step2[9]);
-          step1[10] = SUB_EPI16(step2[9], step3[10]);
-          step1[11] = SUB_EPI16(step2[8], step3[11]);
-          step1[12] = SUB_EPI16(step2[15], step3[12]);
-          step1[13] = SUB_EPI16(step2[14], step3[13]);
-          step1[14] = ADD_EPI16(step3[13], step2[14]);
-          step1[15] = ADD_EPI16(step3[12], step2[15]);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x16(
-              &step1[0], &step1[1], &step1[2], &step1[3], &step1[4], &step1[5],
-              &step1[6], &step1[7], &step1[8], &step1[9], &step1[10],
-              &step1[11], &step1[12], &step1[13], &step1[14], &step1[15]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          const __m128i s1_05_0 = _mm_unpacklo_epi16(step3[6], step3[5]);
-          const __m128i s1_05_1 = _mm_unpackhi_epi16(step3[6], step3[5]);
-          const __m128i s1_05_2 = _mm_madd_epi16(s1_05_0, k__cospi_p16_m16);
-          const __m128i s1_05_3 = _mm_madd_epi16(s1_05_1, k__cospi_p16_m16);
-          const __m128i s1_06_2 = _mm_madd_epi16(s1_05_0, k__cospi_p16_p16);
-          const __m128i s1_06_3 = _mm_madd_epi16(s1_05_1, k__cospi_p16_p16);
-          // dct_const_round_shift
-          const __m128i s1_05_4 = _mm_add_epi32(s1_05_2, k__DCT_CONST_ROUNDING);
-          const __m128i s1_05_5 = _mm_add_epi32(s1_05_3, k__DCT_CONST_ROUNDING);
-          const __m128i s1_06_4 = _mm_add_epi32(s1_06_2, k__DCT_CONST_ROUNDING);
-          const __m128i s1_06_5 = _mm_add_epi32(s1_06_3, k__DCT_CONST_ROUNDING);
-          const __m128i s1_05_6 = _mm_srai_epi32(s1_05_4, DCT_CONST_BITS);
-          const __m128i s1_05_7 = _mm_srai_epi32(s1_05_5, DCT_CONST_BITS);
-          const __m128i s1_06_6 = _mm_srai_epi32(s1_06_4, DCT_CONST_BITS);
-          const __m128i s1_06_7 = _mm_srai_epi32(s1_06_5, DCT_CONST_BITS);
-          // Combine
-          step1[5] = _mm_packs_epi32(s1_05_6, s1_05_7);
-          step1[6] = _mm_packs_epi32(s1_06_6, s1_06_7);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x2(&step1[5], &step1[6]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          const __m128i s1_18_0 = _mm_unpacklo_epi16(step3[18], step3[29]);
-          const __m128i s1_18_1 = _mm_unpackhi_epi16(step3[18], step3[29]);
-          const __m128i s1_19_0 = _mm_unpacklo_epi16(step3[19], step3[28]);
-          const __m128i s1_19_1 = _mm_unpackhi_epi16(step3[19], step3[28]);
-          const __m128i s1_20_0 = _mm_unpacklo_epi16(step3[20], step3[27]);
-          const __m128i s1_20_1 = _mm_unpackhi_epi16(step3[20], step3[27]);
-          const __m128i s1_21_0 = _mm_unpacklo_epi16(step3[21], step3[26]);
-          const __m128i s1_21_1 = _mm_unpackhi_epi16(step3[21], step3[26]);
-          const __m128i s1_18_2 = _mm_madd_epi16(s1_18_0, k__cospi_m08_p24);
-          const __m128i s1_18_3 = _mm_madd_epi16(s1_18_1, k__cospi_m08_p24);
-          const __m128i s1_19_2 = _mm_madd_epi16(s1_19_0, k__cospi_m08_p24);
-          const __m128i s1_19_3 = _mm_madd_epi16(s1_19_1, k__cospi_m08_p24);
-          const __m128i s1_20_2 = _mm_madd_epi16(s1_20_0, k__cospi_m24_m08);
-          const __m128i s1_20_3 = _mm_madd_epi16(s1_20_1, k__cospi_m24_m08);
-          const __m128i s1_21_2 = _mm_madd_epi16(s1_21_0, k__cospi_m24_m08);
-          const __m128i s1_21_3 = _mm_madd_epi16(s1_21_1, k__cospi_m24_m08);
-          const __m128i s1_26_2 = _mm_madd_epi16(s1_21_0, k__cospi_m08_p24);
-          const __m128i s1_26_3 = _mm_madd_epi16(s1_21_1, k__cospi_m08_p24);
-          const __m128i s1_27_2 = _mm_madd_epi16(s1_20_0, k__cospi_m08_p24);
-          const __m128i s1_27_3 = _mm_madd_epi16(s1_20_1, k__cospi_m08_p24);
-          const __m128i s1_28_2 = _mm_madd_epi16(s1_19_0, k__cospi_p24_p08);
-          const __m128i s1_28_3 = _mm_madd_epi16(s1_19_1, k__cospi_p24_p08);
-          const __m128i s1_29_2 = _mm_madd_epi16(s1_18_0, k__cospi_p24_p08);
-          const __m128i s1_29_3 = _mm_madd_epi16(s1_18_1, k__cospi_p24_p08);
-          // dct_const_round_shift
-          const __m128i s1_18_4 = _mm_add_epi32(s1_18_2, k__DCT_CONST_ROUNDING);
-          const __m128i s1_18_5 = _mm_add_epi32(s1_18_3, k__DCT_CONST_ROUNDING);
-          const __m128i s1_19_4 = _mm_add_epi32(s1_19_2, k__DCT_CONST_ROUNDING);
-          const __m128i s1_19_5 = _mm_add_epi32(s1_19_3, k__DCT_CONST_ROUNDING);
-          const __m128i s1_20_4 = _mm_add_epi32(s1_20_2, k__DCT_CONST_ROUNDING);
-          const __m128i s1_20_5 = _mm_add_epi32(s1_20_3, k__DCT_CONST_ROUNDING);
-          const __m128i s1_21_4 = _mm_add_epi32(s1_21_2, k__DCT_CONST_ROUNDING);
-          const __m128i s1_21_5 = _mm_add_epi32(s1_21_3, k__DCT_CONST_ROUNDING);
-          const __m128i s1_26_4 = _mm_add_epi32(s1_26_2, k__DCT_CONST_ROUNDING);
-          const __m128i s1_26_5 = _mm_add_epi32(s1_26_3, k__DCT_CONST_ROUNDING);
-          const __m128i s1_27_4 = _mm_add_epi32(s1_27_2, k__DCT_CONST_ROUNDING);
-          const __m128i s1_27_5 = _mm_add_epi32(s1_27_3, k__DCT_CONST_ROUNDING);
-          const __m128i s1_28_4 = _mm_add_epi32(s1_28_2, k__DCT_CONST_ROUNDING);
-          const __m128i s1_28_5 = _mm_add_epi32(s1_28_3, k__DCT_CONST_ROUNDING);
-          const __m128i s1_29_4 = _mm_add_epi32(s1_29_2, k__DCT_CONST_ROUNDING);
-          const __m128i s1_29_5 = _mm_add_epi32(s1_29_3, k__DCT_CONST_ROUNDING);
-          const __m128i s1_18_6 = _mm_srai_epi32(s1_18_4, DCT_CONST_BITS);
-          const __m128i s1_18_7 = _mm_srai_epi32(s1_18_5, DCT_CONST_BITS);
-          const __m128i s1_19_6 = _mm_srai_epi32(s1_19_4, DCT_CONST_BITS);
-          const __m128i s1_19_7 = _mm_srai_epi32(s1_19_5, DCT_CONST_BITS);
-          const __m128i s1_20_6 = _mm_srai_epi32(s1_20_4, DCT_CONST_BITS);
-          const __m128i s1_20_7 = _mm_srai_epi32(s1_20_5, DCT_CONST_BITS);
-          const __m128i s1_21_6 = _mm_srai_epi32(s1_21_4, DCT_CONST_BITS);
-          const __m128i s1_21_7 = _mm_srai_epi32(s1_21_5, DCT_CONST_BITS);
-          const __m128i s1_26_6 = _mm_srai_epi32(s1_26_4, DCT_CONST_BITS);
-          const __m128i s1_26_7 = _mm_srai_epi32(s1_26_5, DCT_CONST_BITS);
-          const __m128i s1_27_6 = _mm_srai_epi32(s1_27_4, DCT_CONST_BITS);
-          const __m128i s1_27_7 = _mm_srai_epi32(s1_27_5, DCT_CONST_BITS);
-          const __m128i s1_28_6 = _mm_srai_epi32(s1_28_4, DCT_CONST_BITS);
-          const __m128i s1_28_7 = _mm_srai_epi32(s1_28_5, DCT_CONST_BITS);
-          const __m128i s1_29_6 = _mm_srai_epi32(s1_29_4, DCT_CONST_BITS);
-          const __m128i s1_29_7 = _mm_srai_epi32(s1_29_5, DCT_CONST_BITS);
-          // Combine
-          step1[18] = _mm_packs_epi32(s1_18_6, s1_18_7);
-          step1[19] = _mm_packs_epi32(s1_19_6, s1_19_7);
-          step1[20] = _mm_packs_epi32(s1_20_6, s1_20_7);
-          step1[21] = _mm_packs_epi32(s1_21_6, s1_21_7);
-          step1[26] = _mm_packs_epi32(s1_26_6, s1_26_7);
-          step1[27] = _mm_packs_epi32(s1_27_6, s1_27_7);
-          step1[28] = _mm_packs_epi32(s1_28_6, s1_28_7);
-          step1[29] = _mm_packs_epi32(s1_29_6, s1_29_7);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x8(&step1[18], &step1[19], &step1[20],
-                                             &step1[21], &step1[26], &step1[27],
-                                             &step1[28], &step1[29]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        // Stage 5
-        {
-          step2[4] = ADD_EPI16(step1[5], step3[4]);
-          step2[5] = SUB_EPI16(step3[4], step1[5]);
-          step2[6] = SUB_EPI16(step3[7], step1[6]);
-          step2[7] = ADD_EPI16(step1[6], step3[7]);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x4(&step2[4], &step2[5], &step2[6],
-                                             &step2[7]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          const __m128i out_00_0 = _mm_unpacklo_epi16(step1[0], step1[1]);
-          const __m128i out_00_1 = _mm_unpackhi_epi16(step1[0], step1[1]);
-          const __m128i out_08_0 = _mm_unpacklo_epi16(step1[2], step1[3]);
-          const __m128i out_08_1 = _mm_unpackhi_epi16(step1[2], step1[3]);
-          const __m128i out_00_2 = _mm_madd_epi16(out_00_0, k__cospi_p16_p16);
-          const __m128i out_00_3 = _mm_madd_epi16(out_00_1, k__cospi_p16_p16);
-          const __m128i out_16_2 = _mm_madd_epi16(out_00_0, k__cospi_p16_m16);
-          const __m128i out_16_3 = _mm_madd_epi16(out_00_1, k__cospi_p16_m16);
-          const __m128i out_08_2 = _mm_madd_epi16(out_08_0, k__cospi_p24_p08);
-          const __m128i out_08_3 = _mm_madd_epi16(out_08_1, k__cospi_p24_p08);
-          const __m128i out_24_2 = _mm_madd_epi16(out_08_0, k__cospi_m08_p24);
-          const __m128i out_24_3 = _mm_madd_epi16(out_08_1, k__cospi_m08_p24);
-          // dct_const_round_shift
-          const __m128i out_00_4 =
-              _mm_add_epi32(out_00_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_00_5 =
-              _mm_add_epi32(out_00_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_16_4 =
-              _mm_add_epi32(out_16_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_16_5 =
-              _mm_add_epi32(out_16_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_08_4 =
-              _mm_add_epi32(out_08_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_08_5 =
-              _mm_add_epi32(out_08_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_24_4 =
-              _mm_add_epi32(out_24_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_24_5 =
-              _mm_add_epi32(out_24_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_00_6 = _mm_srai_epi32(out_00_4, DCT_CONST_BITS);
-          const __m128i out_00_7 = _mm_srai_epi32(out_00_5, DCT_CONST_BITS);
-          const __m128i out_16_6 = _mm_srai_epi32(out_16_4, DCT_CONST_BITS);
-          const __m128i out_16_7 = _mm_srai_epi32(out_16_5, DCT_CONST_BITS);
-          const __m128i out_08_6 = _mm_srai_epi32(out_08_4, DCT_CONST_BITS);
-          const __m128i out_08_7 = _mm_srai_epi32(out_08_5, DCT_CONST_BITS);
-          const __m128i out_24_6 = _mm_srai_epi32(out_24_4, DCT_CONST_BITS);
-          const __m128i out_24_7 = _mm_srai_epi32(out_24_5, DCT_CONST_BITS);
-          // Combine
-          out[0] = _mm_packs_epi32(out_00_6, out_00_7);
-          out[16] = _mm_packs_epi32(out_16_6, out_16_7);
-          out[8] = _mm_packs_epi32(out_08_6, out_08_7);
-          out[24] = _mm_packs_epi32(out_24_6, out_24_7);
-#if DCT_HIGH_BIT_DEPTH
-          overflow =
-              check_epi16_overflow_x4(&out[0], &out[16], &out[8], &out[24]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          const __m128i s2_09_0 = _mm_unpacklo_epi16(step1[9], step1[14]);
-          const __m128i s2_09_1 = _mm_unpackhi_epi16(step1[9], step1[14]);
-          const __m128i s2_10_0 = _mm_unpacklo_epi16(step1[10], step1[13]);
-          const __m128i s2_10_1 = _mm_unpackhi_epi16(step1[10], step1[13]);
-          const __m128i s2_09_2 = _mm_madd_epi16(s2_09_0, k__cospi_m08_p24);
-          const __m128i s2_09_3 = _mm_madd_epi16(s2_09_1, k__cospi_m08_p24);
-          const __m128i s2_10_2 = _mm_madd_epi16(s2_10_0, k__cospi_m24_m08);
-          const __m128i s2_10_3 = _mm_madd_epi16(s2_10_1, k__cospi_m24_m08);
-          const __m128i s2_13_2 = _mm_madd_epi16(s2_10_0, k__cospi_m08_p24);
-          const __m128i s2_13_3 = _mm_madd_epi16(s2_10_1, k__cospi_m08_p24);
-          const __m128i s2_14_2 = _mm_madd_epi16(s2_09_0, k__cospi_p24_p08);
-          const __m128i s2_14_3 = _mm_madd_epi16(s2_09_1, k__cospi_p24_p08);
-          // dct_const_round_shift
-          const __m128i s2_09_4 = _mm_add_epi32(s2_09_2, k__DCT_CONST_ROUNDING);
-          const __m128i s2_09_5 = _mm_add_epi32(s2_09_3, k__DCT_CONST_ROUNDING);
-          const __m128i s2_10_4 = _mm_add_epi32(s2_10_2, k__DCT_CONST_ROUNDING);
-          const __m128i s2_10_5 = _mm_add_epi32(s2_10_3, k__DCT_CONST_ROUNDING);
-          const __m128i s2_13_4 = _mm_add_epi32(s2_13_2, k__DCT_CONST_ROUNDING);
-          const __m128i s2_13_5 = _mm_add_epi32(s2_13_3, k__DCT_CONST_ROUNDING);
-          const __m128i s2_14_4 = _mm_add_epi32(s2_14_2, k__DCT_CONST_ROUNDING);
-          const __m128i s2_14_5 = _mm_add_epi32(s2_14_3, k__DCT_CONST_ROUNDING);
-          const __m128i s2_09_6 = _mm_srai_epi32(s2_09_4, DCT_CONST_BITS);
-          const __m128i s2_09_7 = _mm_srai_epi32(s2_09_5, DCT_CONST_BITS);
-          const __m128i s2_10_6 = _mm_srai_epi32(s2_10_4, DCT_CONST_BITS);
-          const __m128i s2_10_7 = _mm_srai_epi32(s2_10_5, DCT_CONST_BITS);
-          const __m128i s2_13_6 = _mm_srai_epi32(s2_13_4, DCT_CONST_BITS);
-          const __m128i s2_13_7 = _mm_srai_epi32(s2_13_5, DCT_CONST_BITS);
-          const __m128i s2_14_6 = _mm_srai_epi32(s2_14_4, DCT_CONST_BITS);
-          const __m128i s2_14_7 = _mm_srai_epi32(s2_14_5, DCT_CONST_BITS);
-          // Combine
-          step2[9] = _mm_packs_epi32(s2_09_6, s2_09_7);
-          step2[10] = _mm_packs_epi32(s2_10_6, s2_10_7);
-          step2[13] = _mm_packs_epi32(s2_13_6, s2_13_7);
-          step2[14] = _mm_packs_epi32(s2_14_6, s2_14_7);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x4(&step2[9], &step2[10], &step2[13],
-                                             &step2[14]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          step2[16] = ADD_EPI16(step1[19], step3[16]);
-          step2[17] = ADD_EPI16(step1[18], step3[17]);
-          step2[18] = SUB_EPI16(step3[17], step1[18]);
-          step2[19] = SUB_EPI16(step3[16], step1[19]);
-          step2[20] = SUB_EPI16(step3[23], step1[20]);
-          step2[21] = SUB_EPI16(step3[22], step1[21]);
-          step2[22] = ADD_EPI16(step1[21], step3[22]);
-          step2[23] = ADD_EPI16(step1[20], step3[23]);
-          step2[24] = ADD_EPI16(step1[27], step3[24]);
-          step2[25] = ADD_EPI16(step1[26], step3[25]);
-          step2[26] = SUB_EPI16(step3[25], step1[26]);
-          step2[27] = SUB_EPI16(step3[24], step1[27]);
-          step2[28] = SUB_EPI16(step3[31], step1[28]);
-          step2[29] = SUB_EPI16(step3[30], step1[29]);
-          step2[30] = ADD_EPI16(step1[29], step3[30]);
-          step2[31] = ADD_EPI16(step1[28], step3[31]);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x16(
-              &step2[16], &step2[17], &step2[18], &step2[19], &step2[20],
-              &step2[21], &step2[22], &step2[23], &step2[24], &step2[25],
-              &step2[26], &step2[27], &step2[28], &step2[29], &step2[30],
-              &step2[31]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        // Stage 6
-        {
-          const __m128i out_04_0 = _mm_unpacklo_epi16(step2[4], step2[7]);
-          const __m128i out_04_1 = _mm_unpackhi_epi16(step2[4], step2[7]);
-          const __m128i out_20_0 = _mm_unpacklo_epi16(step2[5], step2[6]);
-          const __m128i out_20_1 = _mm_unpackhi_epi16(step2[5], step2[6]);
-          const __m128i out_12_0 = _mm_unpacklo_epi16(step2[5], step2[6]);
-          const __m128i out_12_1 = _mm_unpackhi_epi16(step2[5], step2[6]);
-          const __m128i out_28_0 = _mm_unpacklo_epi16(step2[4], step2[7]);
-          const __m128i out_28_1 = _mm_unpackhi_epi16(step2[4], step2[7]);
-          const __m128i out_04_2 = _mm_madd_epi16(out_04_0, k__cospi_p28_p04);
-          const __m128i out_04_3 = _mm_madd_epi16(out_04_1, k__cospi_p28_p04);
-          const __m128i out_20_2 = _mm_madd_epi16(out_20_0, k__cospi_p12_p20);
-          const __m128i out_20_3 = _mm_madd_epi16(out_20_1, k__cospi_p12_p20);
-          const __m128i out_12_2 = _mm_madd_epi16(out_12_0, k__cospi_m20_p12);
-          const __m128i out_12_3 = _mm_madd_epi16(out_12_1, k__cospi_m20_p12);
-          const __m128i out_28_2 = _mm_madd_epi16(out_28_0, k__cospi_m04_p28);
-          const __m128i out_28_3 = _mm_madd_epi16(out_28_1, k__cospi_m04_p28);
-          // dct_const_round_shift
-          const __m128i out_04_4 =
-              _mm_add_epi32(out_04_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_04_5 =
-              _mm_add_epi32(out_04_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_20_4 =
-              _mm_add_epi32(out_20_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_20_5 =
-              _mm_add_epi32(out_20_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_12_4 =
-              _mm_add_epi32(out_12_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_12_5 =
-              _mm_add_epi32(out_12_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_28_4 =
-              _mm_add_epi32(out_28_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_28_5 =
-              _mm_add_epi32(out_28_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_04_6 = _mm_srai_epi32(out_04_4, DCT_CONST_BITS);
-          const __m128i out_04_7 = _mm_srai_epi32(out_04_5, DCT_CONST_BITS);
-          const __m128i out_20_6 = _mm_srai_epi32(out_20_4, DCT_CONST_BITS);
-          const __m128i out_20_7 = _mm_srai_epi32(out_20_5, DCT_CONST_BITS);
-          const __m128i out_12_6 = _mm_srai_epi32(out_12_4, DCT_CONST_BITS);
-          const __m128i out_12_7 = _mm_srai_epi32(out_12_5, DCT_CONST_BITS);
-          const __m128i out_28_6 = _mm_srai_epi32(out_28_4, DCT_CONST_BITS);
-          const __m128i out_28_7 = _mm_srai_epi32(out_28_5, DCT_CONST_BITS);
-          // Combine
-          out[4] = _mm_packs_epi32(out_04_6, out_04_7);
-          out[20] = _mm_packs_epi32(out_20_6, out_20_7);
-          out[12] = _mm_packs_epi32(out_12_6, out_12_7);
-          out[28] = _mm_packs_epi32(out_28_6, out_28_7);
-#if DCT_HIGH_BIT_DEPTH
-          overflow =
-              check_epi16_overflow_x4(&out[4], &out[20], &out[12], &out[28]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          step3[8] = ADD_EPI16(step2[9], step1[8]);
-          step3[9] = SUB_EPI16(step1[8], step2[9]);
-          step3[10] = SUB_EPI16(step1[11], step2[10]);
-          step3[11] = ADD_EPI16(step2[10], step1[11]);
-          step3[12] = ADD_EPI16(step2[13], step1[12]);
-          step3[13] = SUB_EPI16(step1[12], step2[13]);
-          step3[14] = SUB_EPI16(step1[15], step2[14]);
-          step3[15] = ADD_EPI16(step2[14], step1[15]);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x8(&step3[8], &step3[9], &step3[10],
-                                             &step3[11], &step3[12], &step3[13],
-                                             &step3[14], &step3[15]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          const __m128i s3_17_0 = _mm_unpacklo_epi16(step2[17], step2[30]);
-          const __m128i s3_17_1 = _mm_unpackhi_epi16(step2[17], step2[30]);
-          const __m128i s3_18_0 = _mm_unpacklo_epi16(step2[18], step2[29]);
-          const __m128i s3_18_1 = _mm_unpackhi_epi16(step2[18], step2[29]);
-          const __m128i s3_21_0 = _mm_unpacklo_epi16(step2[21], step2[26]);
-          const __m128i s3_21_1 = _mm_unpackhi_epi16(step2[21], step2[26]);
-          const __m128i s3_22_0 = _mm_unpacklo_epi16(step2[22], step2[25]);
-          const __m128i s3_22_1 = _mm_unpackhi_epi16(step2[22], step2[25]);
-          const __m128i s3_17_2 = _mm_madd_epi16(s3_17_0, k__cospi_m04_p28);
-          const __m128i s3_17_3 = _mm_madd_epi16(s3_17_1, k__cospi_m04_p28);
-          const __m128i s3_18_2 = _mm_madd_epi16(s3_18_0, k__cospi_m28_m04);
-          const __m128i s3_18_3 = _mm_madd_epi16(s3_18_1, k__cospi_m28_m04);
-          const __m128i s3_21_2 = _mm_madd_epi16(s3_21_0, k__cospi_m20_p12);
-          const __m128i s3_21_3 = _mm_madd_epi16(s3_21_1, k__cospi_m20_p12);
-          const __m128i s3_22_2 = _mm_madd_epi16(s3_22_0, k__cospi_m12_m20);
-          const __m128i s3_22_3 = _mm_madd_epi16(s3_22_1, k__cospi_m12_m20);
-          const __m128i s3_25_2 = _mm_madd_epi16(s3_22_0, k__cospi_m20_p12);
-          const __m128i s3_25_3 = _mm_madd_epi16(s3_22_1, k__cospi_m20_p12);
-          const __m128i s3_26_2 = _mm_madd_epi16(s3_21_0, k__cospi_p12_p20);
-          const __m128i s3_26_3 = _mm_madd_epi16(s3_21_1, k__cospi_p12_p20);
-          const __m128i s3_29_2 = _mm_madd_epi16(s3_18_0, k__cospi_m04_p28);
-          const __m128i s3_29_3 = _mm_madd_epi16(s3_18_1, k__cospi_m04_p28);
-          const __m128i s3_30_2 = _mm_madd_epi16(s3_17_0, k__cospi_p28_p04);
-          const __m128i s3_30_3 = _mm_madd_epi16(s3_17_1, k__cospi_p28_p04);
-          // dct_const_round_shift
-          const __m128i s3_17_4 = _mm_add_epi32(s3_17_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_17_5 = _mm_add_epi32(s3_17_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_18_4 = _mm_add_epi32(s3_18_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_18_5 = _mm_add_epi32(s3_18_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_21_4 = _mm_add_epi32(s3_21_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_21_5 = _mm_add_epi32(s3_21_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_22_4 = _mm_add_epi32(s3_22_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_22_5 = _mm_add_epi32(s3_22_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_17_6 = _mm_srai_epi32(s3_17_4, DCT_CONST_BITS);
-          const __m128i s3_17_7 = _mm_srai_epi32(s3_17_5, DCT_CONST_BITS);
-          const __m128i s3_18_6 = _mm_srai_epi32(s3_18_4, DCT_CONST_BITS);
-          const __m128i s3_18_7 = _mm_srai_epi32(s3_18_5, DCT_CONST_BITS);
-          const __m128i s3_21_6 = _mm_srai_epi32(s3_21_4, DCT_CONST_BITS);
-          const __m128i s3_21_7 = _mm_srai_epi32(s3_21_5, DCT_CONST_BITS);
-          const __m128i s3_22_6 = _mm_srai_epi32(s3_22_4, DCT_CONST_BITS);
-          const __m128i s3_22_7 = _mm_srai_epi32(s3_22_5, DCT_CONST_BITS);
-          const __m128i s3_25_4 = _mm_add_epi32(s3_25_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_25_5 = _mm_add_epi32(s3_25_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_26_4 = _mm_add_epi32(s3_26_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_26_5 = _mm_add_epi32(s3_26_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_29_4 = _mm_add_epi32(s3_29_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_29_5 = _mm_add_epi32(s3_29_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_30_4 = _mm_add_epi32(s3_30_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_30_5 = _mm_add_epi32(s3_30_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_25_6 = _mm_srai_epi32(s3_25_4, DCT_CONST_BITS);
-          const __m128i s3_25_7 = _mm_srai_epi32(s3_25_5, DCT_CONST_BITS);
-          const __m128i s3_26_6 = _mm_srai_epi32(s3_26_4, DCT_CONST_BITS);
-          const __m128i s3_26_7 = _mm_srai_epi32(s3_26_5, DCT_CONST_BITS);
-          const __m128i s3_29_6 = _mm_srai_epi32(s3_29_4, DCT_CONST_BITS);
-          const __m128i s3_29_7 = _mm_srai_epi32(s3_29_5, DCT_CONST_BITS);
-          const __m128i s3_30_6 = _mm_srai_epi32(s3_30_4, DCT_CONST_BITS);
-          const __m128i s3_30_7 = _mm_srai_epi32(s3_30_5, DCT_CONST_BITS);
-          // Combine
-          step3[17] = _mm_packs_epi32(s3_17_6, s3_17_7);
-          step3[18] = _mm_packs_epi32(s3_18_6, s3_18_7);
-          step3[21] = _mm_packs_epi32(s3_21_6, s3_21_7);
-          step3[22] = _mm_packs_epi32(s3_22_6, s3_22_7);
-          // Combine
-          step3[25] = _mm_packs_epi32(s3_25_6, s3_25_7);
-          step3[26] = _mm_packs_epi32(s3_26_6, s3_26_7);
-          step3[29] = _mm_packs_epi32(s3_29_6, s3_29_7);
-          step3[30] = _mm_packs_epi32(s3_30_6, s3_30_7);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x8(&step3[17], &step3[18], &step3[21],
-                                             &step3[22], &step3[25], &step3[26],
-                                             &step3[29], &step3[30]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        // Stage 7
-        {
-          const __m128i out_02_0 = _mm_unpacklo_epi16(step3[8], step3[15]);
-          const __m128i out_02_1 = _mm_unpackhi_epi16(step3[8], step3[15]);
-          const __m128i out_18_0 = _mm_unpacklo_epi16(step3[9], step3[14]);
-          const __m128i out_18_1 = _mm_unpackhi_epi16(step3[9], step3[14]);
-          const __m128i out_10_0 = _mm_unpacklo_epi16(step3[10], step3[13]);
-          const __m128i out_10_1 = _mm_unpackhi_epi16(step3[10], step3[13]);
-          const __m128i out_26_0 = _mm_unpacklo_epi16(step3[11], step3[12]);
-          const __m128i out_26_1 = _mm_unpackhi_epi16(step3[11], step3[12]);
-          const __m128i out_02_2 = _mm_madd_epi16(out_02_0, k__cospi_p30_p02);
-          const __m128i out_02_3 = _mm_madd_epi16(out_02_1, k__cospi_p30_p02);
-          const __m128i out_18_2 = _mm_madd_epi16(out_18_0, k__cospi_p14_p18);
-          const __m128i out_18_3 = _mm_madd_epi16(out_18_1, k__cospi_p14_p18);
-          const __m128i out_10_2 = _mm_madd_epi16(out_10_0, k__cospi_p22_p10);
-          const __m128i out_10_3 = _mm_madd_epi16(out_10_1, k__cospi_p22_p10);
-          const __m128i out_26_2 = _mm_madd_epi16(out_26_0, k__cospi_p06_p26);
-          const __m128i out_26_3 = _mm_madd_epi16(out_26_1, k__cospi_p06_p26);
-          const __m128i out_06_2 = _mm_madd_epi16(out_26_0, k__cospi_m26_p06);
-          const __m128i out_06_3 = _mm_madd_epi16(out_26_1, k__cospi_m26_p06);
-          const __m128i out_22_2 = _mm_madd_epi16(out_10_0, k__cospi_m10_p22);
-          const __m128i out_22_3 = _mm_madd_epi16(out_10_1, k__cospi_m10_p22);
-          const __m128i out_14_2 = _mm_madd_epi16(out_18_0, k__cospi_m18_p14);
-          const __m128i out_14_3 = _mm_madd_epi16(out_18_1, k__cospi_m18_p14);
-          const __m128i out_30_2 = _mm_madd_epi16(out_02_0, k__cospi_m02_p30);
-          const __m128i out_30_3 = _mm_madd_epi16(out_02_1, k__cospi_m02_p30);
-          // dct_const_round_shift
-          const __m128i out_02_4 =
-              _mm_add_epi32(out_02_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_02_5 =
-              _mm_add_epi32(out_02_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_18_4 =
-              _mm_add_epi32(out_18_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_18_5 =
-              _mm_add_epi32(out_18_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_10_4 =
-              _mm_add_epi32(out_10_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_10_5 =
-              _mm_add_epi32(out_10_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_26_4 =
-              _mm_add_epi32(out_26_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_26_5 =
-              _mm_add_epi32(out_26_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_06_4 =
-              _mm_add_epi32(out_06_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_06_5 =
-              _mm_add_epi32(out_06_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_22_4 =
-              _mm_add_epi32(out_22_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_22_5 =
-              _mm_add_epi32(out_22_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_14_4 =
-              _mm_add_epi32(out_14_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_14_5 =
-              _mm_add_epi32(out_14_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_30_4 =
-              _mm_add_epi32(out_30_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_30_5 =
-              _mm_add_epi32(out_30_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_02_6 = _mm_srai_epi32(out_02_4, DCT_CONST_BITS);
-          const __m128i out_02_7 = _mm_srai_epi32(out_02_5, DCT_CONST_BITS);
-          const __m128i out_18_6 = _mm_srai_epi32(out_18_4, DCT_CONST_BITS);
-          const __m128i out_18_7 = _mm_srai_epi32(out_18_5, DCT_CONST_BITS);
-          const __m128i out_10_6 = _mm_srai_epi32(out_10_4, DCT_CONST_BITS);
-          const __m128i out_10_7 = _mm_srai_epi32(out_10_5, DCT_CONST_BITS);
-          const __m128i out_26_6 = _mm_srai_epi32(out_26_4, DCT_CONST_BITS);
-          const __m128i out_26_7 = _mm_srai_epi32(out_26_5, DCT_CONST_BITS);
-          const __m128i out_06_6 = _mm_srai_epi32(out_06_4, DCT_CONST_BITS);
-          const __m128i out_06_7 = _mm_srai_epi32(out_06_5, DCT_CONST_BITS);
-          const __m128i out_22_6 = _mm_srai_epi32(out_22_4, DCT_CONST_BITS);
-          const __m128i out_22_7 = _mm_srai_epi32(out_22_5, DCT_CONST_BITS);
-          const __m128i out_14_6 = _mm_srai_epi32(out_14_4, DCT_CONST_BITS);
-          const __m128i out_14_7 = _mm_srai_epi32(out_14_5, DCT_CONST_BITS);
-          const __m128i out_30_6 = _mm_srai_epi32(out_30_4, DCT_CONST_BITS);
-          const __m128i out_30_7 = _mm_srai_epi32(out_30_5, DCT_CONST_BITS);
-          // Combine
-          out[2] = _mm_packs_epi32(out_02_6, out_02_7);
-          out[18] = _mm_packs_epi32(out_18_6, out_18_7);
-          out[10] = _mm_packs_epi32(out_10_6, out_10_7);
-          out[26] = _mm_packs_epi32(out_26_6, out_26_7);
-          out[6] = _mm_packs_epi32(out_06_6, out_06_7);
-          out[22] = _mm_packs_epi32(out_22_6, out_22_7);
-          out[14] = _mm_packs_epi32(out_14_6, out_14_7);
-          out[30] = _mm_packs_epi32(out_30_6, out_30_7);
-#if DCT_HIGH_BIT_DEPTH
-          overflow =
-              check_epi16_overflow_x8(&out[2], &out[18], &out[10], &out[26],
-                                      &out[6], &out[22], &out[14], &out[30]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          step1[16] = ADD_EPI16(step3[17], step2[16]);
-          step1[17] = SUB_EPI16(step2[16], step3[17]);
-          step1[18] = SUB_EPI16(step2[19], step3[18]);
-          step1[19] = ADD_EPI16(step3[18], step2[19]);
-          step1[20] = ADD_EPI16(step3[21], step2[20]);
-          step1[21] = SUB_EPI16(step2[20], step3[21]);
-          step1[22] = SUB_EPI16(step2[23], step3[22]);
-          step1[23] = ADD_EPI16(step3[22], step2[23]);
-          step1[24] = ADD_EPI16(step3[25], step2[24]);
-          step1[25] = SUB_EPI16(step2[24], step3[25]);
-          step1[26] = SUB_EPI16(step2[27], step3[26]);
-          step1[27] = ADD_EPI16(step3[26], step2[27]);
-          step1[28] = ADD_EPI16(step3[29], step2[28]);
-          step1[29] = SUB_EPI16(step2[28], step3[29]);
-          step1[30] = SUB_EPI16(step2[31], step3[30]);
-          step1[31] = ADD_EPI16(step3[30], step2[31]);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = check_epi16_overflow_x16(
-              &step1[16], &step1[17], &step1[18], &step1[19], &step1[20],
-              &step1[21], &step1[22], &step1[23], &step1[24], &step1[25],
-              &step1[26], &step1[27], &step1[28], &step1[29], &step1[30],
-              &step1[31]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        // Final stage --- outputs indices are bit-reversed.
-        {
-          const __m128i out_01_0 = _mm_unpacklo_epi16(step1[16], step1[31]);
-          const __m128i out_01_1 = _mm_unpackhi_epi16(step1[16], step1[31]);
-          const __m128i out_17_0 = _mm_unpacklo_epi16(step1[17], step1[30]);
-          const __m128i out_17_1 = _mm_unpackhi_epi16(step1[17], step1[30]);
-          const __m128i out_09_0 = _mm_unpacklo_epi16(step1[18], step1[29]);
-          const __m128i out_09_1 = _mm_unpackhi_epi16(step1[18], step1[29]);
-          const __m128i out_25_0 = _mm_unpacklo_epi16(step1[19], step1[28]);
-          const __m128i out_25_1 = _mm_unpackhi_epi16(step1[19], step1[28]);
-          const __m128i out_01_2 = _mm_madd_epi16(out_01_0, k__cospi_p31_p01);
-          const __m128i out_01_3 = _mm_madd_epi16(out_01_1, k__cospi_p31_p01);
-          const __m128i out_17_2 = _mm_madd_epi16(out_17_0, k__cospi_p15_p17);
-          const __m128i out_17_3 = _mm_madd_epi16(out_17_1, k__cospi_p15_p17);
-          const __m128i out_09_2 = _mm_madd_epi16(out_09_0, k__cospi_p23_p09);
-          const __m128i out_09_3 = _mm_madd_epi16(out_09_1, k__cospi_p23_p09);
-          const __m128i out_25_2 = _mm_madd_epi16(out_25_0, k__cospi_p07_p25);
-          const __m128i out_25_3 = _mm_madd_epi16(out_25_1, k__cospi_p07_p25);
-          const __m128i out_07_2 = _mm_madd_epi16(out_25_0, k__cospi_m25_p07);
-          const __m128i out_07_3 = _mm_madd_epi16(out_25_1, k__cospi_m25_p07);
-          const __m128i out_23_2 = _mm_madd_epi16(out_09_0, k__cospi_m09_p23);
-          const __m128i out_23_3 = _mm_madd_epi16(out_09_1, k__cospi_m09_p23);
-          const __m128i out_15_2 = _mm_madd_epi16(out_17_0, k__cospi_m17_p15);
-          const __m128i out_15_3 = _mm_madd_epi16(out_17_1, k__cospi_m17_p15);
-          const __m128i out_31_2 = _mm_madd_epi16(out_01_0, k__cospi_m01_p31);
-          const __m128i out_31_3 = _mm_madd_epi16(out_01_1, k__cospi_m01_p31);
-          // dct_const_round_shift
-          const __m128i out_01_4 =
-              _mm_add_epi32(out_01_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_01_5 =
-              _mm_add_epi32(out_01_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_17_4 =
-              _mm_add_epi32(out_17_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_17_5 =
-              _mm_add_epi32(out_17_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_09_4 =
-              _mm_add_epi32(out_09_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_09_5 =
-              _mm_add_epi32(out_09_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_25_4 =
-              _mm_add_epi32(out_25_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_25_5 =
-              _mm_add_epi32(out_25_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_07_4 =
-              _mm_add_epi32(out_07_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_07_5 =
-              _mm_add_epi32(out_07_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_23_4 =
-              _mm_add_epi32(out_23_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_23_5 =
-              _mm_add_epi32(out_23_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_15_4 =
-              _mm_add_epi32(out_15_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_15_5 =
-              _mm_add_epi32(out_15_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_31_4 =
-              _mm_add_epi32(out_31_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_31_5 =
-              _mm_add_epi32(out_31_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_01_6 = _mm_srai_epi32(out_01_4, DCT_CONST_BITS);
-          const __m128i out_01_7 = _mm_srai_epi32(out_01_5, DCT_CONST_BITS);
-          const __m128i out_17_6 = _mm_srai_epi32(out_17_4, DCT_CONST_BITS);
-          const __m128i out_17_7 = _mm_srai_epi32(out_17_5, DCT_CONST_BITS);
-          const __m128i out_09_6 = _mm_srai_epi32(out_09_4, DCT_CONST_BITS);
-          const __m128i out_09_7 = _mm_srai_epi32(out_09_5, DCT_CONST_BITS);
-          const __m128i out_25_6 = _mm_srai_epi32(out_25_4, DCT_CONST_BITS);
-          const __m128i out_25_7 = _mm_srai_epi32(out_25_5, DCT_CONST_BITS);
-          const __m128i out_07_6 = _mm_srai_epi32(out_07_4, DCT_CONST_BITS);
-          const __m128i out_07_7 = _mm_srai_epi32(out_07_5, DCT_CONST_BITS);
-          const __m128i out_23_6 = _mm_srai_epi32(out_23_4, DCT_CONST_BITS);
-          const __m128i out_23_7 = _mm_srai_epi32(out_23_5, DCT_CONST_BITS);
-          const __m128i out_15_6 = _mm_srai_epi32(out_15_4, DCT_CONST_BITS);
-          const __m128i out_15_7 = _mm_srai_epi32(out_15_5, DCT_CONST_BITS);
-          const __m128i out_31_6 = _mm_srai_epi32(out_31_4, DCT_CONST_BITS);
-          const __m128i out_31_7 = _mm_srai_epi32(out_31_5, DCT_CONST_BITS);
-          // Combine
-          out[1] = _mm_packs_epi32(out_01_6, out_01_7);
-          out[17] = _mm_packs_epi32(out_17_6, out_17_7);
-          out[9] = _mm_packs_epi32(out_09_6, out_09_7);
-          out[25] = _mm_packs_epi32(out_25_6, out_25_7);
-          out[7] = _mm_packs_epi32(out_07_6, out_07_7);
-          out[23] = _mm_packs_epi32(out_23_6, out_23_7);
-          out[15] = _mm_packs_epi32(out_15_6, out_15_7);
-          out[31] = _mm_packs_epi32(out_31_6, out_31_7);
-#if DCT_HIGH_BIT_DEPTH
-          overflow =
-              check_epi16_overflow_x8(&out[1], &out[17], &out[9], &out[25],
-                                      &out[7], &out[23], &out[15], &out[31]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          const __m128i out_05_0 = _mm_unpacklo_epi16(step1[20], step1[27]);
-          const __m128i out_05_1 = _mm_unpackhi_epi16(step1[20], step1[27]);
-          const __m128i out_21_0 = _mm_unpacklo_epi16(step1[21], step1[26]);
-          const __m128i out_21_1 = _mm_unpackhi_epi16(step1[21], step1[26]);
-          const __m128i out_13_0 = _mm_unpacklo_epi16(step1[22], step1[25]);
-          const __m128i out_13_1 = _mm_unpackhi_epi16(step1[22], step1[25]);
-          const __m128i out_29_0 = _mm_unpacklo_epi16(step1[23], step1[24]);
-          const __m128i out_29_1 = _mm_unpackhi_epi16(step1[23], step1[24]);
-          const __m128i out_05_2 = _mm_madd_epi16(out_05_0, k__cospi_p27_p05);
-          const __m128i out_05_3 = _mm_madd_epi16(out_05_1, k__cospi_p27_p05);
-          const __m128i out_21_2 = _mm_madd_epi16(out_21_0, k__cospi_p11_p21);
-          const __m128i out_21_3 = _mm_madd_epi16(out_21_1, k__cospi_p11_p21);
-          const __m128i out_13_2 = _mm_madd_epi16(out_13_0, k__cospi_p19_p13);
-          const __m128i out_13_3 = _mm_madd_epi16(out_13_1, k__cospi_p19_p13);
-          const __m128i out_29_2 = _mm_madd_epi16(out_29_0, k__cospi_p03_p29);
-          const __m128i out_29_3 = _mm_madd_epi16(out_29_1, k__cospi_p03_p29);
-          const __m128i out_03_2 = _mm_madd_epi16(out_29_0, k__cospi_m29_p03);
-          const __m128i out_03_3 = _mm_madd_epi16(out_29_1, k__cospi_m29_p03);
-          const __m128i out_19_2 = _mm_madd_epi16(out_13_0, k__cospi_m13_p19);
-          const __m128i out_19_3 = _mm_madd_epi16(out_13_1, k__cospi_m13_p19);
-          const __m128i out_11_2 = _mm_madd_epi16(out_21_0, k__cospi_m21_p11);
-          const __m128i out_11_3 = _mm_madd_epi16(out_21_1, k__cospi_m21_p11);
-          const __m128i out_27_2 = _mm_madd_epi16(out_05_0, k__cospi_m05_p27);
-          const __m128i out_27_3 = _mm_madd_epi16(out_05_1, k__cospi_m05_p27);
-          // dct_const_round_shift
-          const __m128i out_05_4 =
-              _mm_add_epi32(out_05_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_05_5 =
-              _mm_add_epi32(out_05_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_21_4 =
-              _mm_add_epi32(out_21_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_21_5 =
-              _mm_add_epi32(out_21_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_13_4 =
-              _mm_add_epi32(out_13_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_13_5 =
-              _mm_add_epi32(out_13_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_29_4 =
-              _mm_add_epi32(out_29_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_29_5 =
-              _mm_add_epi32(out_29_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_03_4 =
-              _mm_add_epi32(out_03_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_03_5 =
-              _mm_add_epi32(out_03_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_19_4 =
-              _mm_add_epi32(out_19_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_19_5 =
-              _mm_add_epi32(out_19_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_11_4 =
-              _mm_add_epi32(out_11_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_11_5 =
-              _mm_add_epi32(out_11_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_27_4 =
-              _mm_add_epi32(out_27_2, k__DCT_CONST_ROUNDING);
-          const __m128i out_27_5 =
-              _mm_add_epi32(out_27_3, k__DCT_CONST_ROUNDING);
-          const __m128i out_05_6 = _mm_srai_epi32(out_05_4, DCT_CONST_BITS);
-          const __m128i out_05_7 = _mm_srai_epi32(out_05_5, DCT_CONST_BITS);
-          const __m128i out_21_6 = _mm_srai_epi32(out_21_4, DCT_CONST_BITS);
-          const __m128i out_21_7 = _mm_srai_epi32(out_21_5, DCT_CONST_BITS);
-          const __m128i out_13_6 = _mm_srai_epi32(out_13_4, DCT_CONST_BITS);
-          const __m128i out_13_7 = _mm_srai_epi32(out_13_5, DCT_CONST_BITS);
-          const __m128i out_29_6 = _mm_srai_epi32(out_29_4, DCT_CONST_BITS);
-          const __m128i out_29_7 = _mm_srai_epi32(out_29_5, DCT_CONST_BITS);
-          const __m128i out_03_6 = _mm_srai_epi32(out_03_4, DCT_CONST_BITS);
-          const __m128i out_03_7 = _mm_srai_epi32(out_03_5, DCT_CONST_BITS);
-          const __m128i out_19_6 = _mm_srai_epi32(out_19_4, DCT_CONST_BITS);
-          const __m128i out_19_7 = _mm_srai_epi32(out_19_5, DCT_CONST_BITS);
-          const __m128i out_11_6 = _mm_srai_epi32(out_11_4, DCT_CONST_BITS);
-          const __m128i out_11_7 = _mm_srai_epi32(out_11_5, DCT_CONST_BITS);
-          const __m128i out_27_6 = _mm_srai_epi32(out_27_4, DCT_CONST_BITS);
-          const __m128i out_27_7 = _mm_srai_epi32(out_27_5, DCT_CONST_BITS);
-          // Combine
-          out[5] = _mm_packs_epi32(out_05_6, out_05_7);
-          out[21] = _mm_packs_epi32(out_21_6, out_21_7);
-          out[13] = _mm_packs_epi32(out_13_6, out_13_7);
-          out[29] = _mm_packs_epi32(out_29_6, out_29_7);
-          out[3] = _mm_packs_epi32(out_03_6, out_03_7);
-          out[19] = _mm_packs_epi32(out_19_6, out_19_7);
-          out[11] = _mm_packs_epi32(out_11_6, out_11_7);
-          out[27] = _mm_packs_epi32(out_27_6, out_27_7);
-#if DCT_HIGH_BIT_DEPTH
-          overflow =
-              check_epi16_overflow_x8(&out[5], &out[21], &out[13], &out[29],
-                                      &out[3], &out[19], &out[11], &out[27]);
-          if (overflow) {
-            if (pass == 0)
-              HIGH_FDCT32x32_2D_C(input, output_org, stride);
-            else
-              HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-#if FDCT32x32_HIGH_PRECISION
-      } else {
-        __m128i lstep1[64], lstep2[64], lstep3[64];
-        __m128i u[32], v[32], sign[16];
-        const __m128i K32One = _mm_set_epi32(1, 1, 1, 1);
-        // start using 32-bit operations
-        // stage 3
-        {
-          // expanding to 32-bit length priori to addition operations
-          lstep2[0] = _mm_unpacklo_epi16(step2[0], kZero);
-          lstep2[1] = _mm_unpackhi_epi16(step2[0], kZero);
-          lstep2[2] = _mm_unpacklo_epi16(step2[1], kZero);
-          lstep2[3] = _mm_unpackhi_epi16(step2[1], kZero);
-          lstep2[4] = _mm_unpacklo_epi16(step2[2], kZero);
-          lstep2[5] = _mm_unpackhi_epi16(step2[2], kZero);
-          lstep2[6] = _mm_unpacklo_epi16(step2[3], kZero);
-          lstep2[7] = _mm_unpackhi_epi16(step2[3], kZero);
-          lstep2[8] = _mm_unpacklo_epi16(step2[4], kZero);
-          lstep2[9] = _mm_unpackhi_epi16(step2[4], kZero);
-          lstep2[10] = _mm_unpacklo_epi16(step2[5], kZero);
-          lstep2[11] = _mm_unpackhi_epi16(step2[5], kZero);
-          lstep2[12] = _mm_unpacklo_epi16(step2[6], kZero);
-          lstep2[13] = _mm_unpackhi_epi16(step2[6], kZero);
-          lstep2[14] = _mm_unpacklo_epi16(step2[7], kZero);
-          lstep2[15] = _mm_unpackhi_epi16(step2[7], kZero);
-          lstep2[0] = _mm_madd_epi16(lstep2[0], kOne);
-          lstep2[1] = _mm_madd_epi16(lstep2[1], kOne);
-          lstep2[2] = _mm_madd_epi16(lstep2[2], kOne);
-          lstep2[3] = _mm_madd_epi16(lstep2[3], kOne);
-          lstep2[4] = _mm_madd_epi16(lstep2[4], kOne);
-          lstep2[5] = _mm_madd_epi16(lstep2[5], kOne);
-          lstep2[6] = _mm_madd_epi16(lstep2[6], kOne);
-          lstep2[7] = _mm_madd_epi16(lstep2[7], kOne);
-          lstep2[8] = _mm_madd_epi16(lstep2[8], kOne);
-          lstep2[9] = _mm_madd_epi16(lstep2[9], kOne);
-          lstep2[10] = _mm_madd_epi16(lstep2[10], kOne);
-          lstep2[11] = _mm_madd_epi16(lstep2[11], kOne);
-          lstep2[12] = _mm_madd_epi16(lstep2[12], kOne);
-          lstep2[13] = _mm_madd_epi16(lstep2[13], kOne);
-          lstep2[14] = _mm_madd_epi16(lstep2[14], kOne);
-          lstep2[15] = _mm_madd_epi16(lstep2[15], kOne);
-
-          lstep3[0] = _mm_add_epi32(lstep2[14], lstep2[0]);
-          lstep3[1] = _mm_add_epi32(lstep2[15], lstep2[1]);
-          lstep3[2] = _mm_add_epi32(lstep2[12], lstep2[2]);
-          lstep3[3] = _mm_add_epi32(lstep2[13], lstep2[3]);
-          lstep3[4] = _mm_add_epi32(lstep2[10], lstep2[4]);
-          lstep3[5] = _mm_add_epi32(lstep2[11], lstep2[5]);
-          lstep3[6] = _mm_add_epi32(lstep2[8], lstep2[6]);
-          lstep3[7] = _mm_add_epi32(lstep2[9], lstep2[7]);
-          lstep3[8] = _mm_sub_epi32(lstep2[6], lstep2[8]);
-          lstep3[9] = _mm_sub_epi32(lstep2[7], lstep2[9]);
-          lstep3[10] = _mm_sub_epi32(lstep2[4], lstep2[10]);
-          lstep3[11] = _mm_sub_epi32(lstep2[5], lstep2[11]);
-          lstep3[12] = _mm_sub_epi32(lstep2[2], lstep2[12]);
-          lstep3[13] = _mm_sub_epi32(lstep2[3], lstep2[13]);
-          lstep3[14] = _mm_sub_epi32(lstep2[0], lstep2[14]);
-          lstep3[15] = _mm_sub_epi32(lstep2[1], lstep2[15]);
-        }
-        {
-          const __m128i s3_10_0 = _mm_unpacklo_epi16(step2[13], step2[10]);
-          const __m128i s3_10_1 = _mm_unpackhi_epi16(step2[13], step2[10]);
-          const __m128i s3_11_0 = _mm_unpacklo_epi16(step2[12], step2[11]);
-          const __m128i s3_11_1 = _mm_unpackhi_epi16(step2[12], step2[11]);
-          const __m128i s3_10_2 = _mm_madd_epi16(s3_10_0, k__cospi_p16_m16);
-          const __m128i s3_10_3 = _mm_madd_epi16(s3_10_1, k__cospi_p16_m16);
-          const __m128i s3_11_2 = _mm_madd_epi16(s3_11_0, k__cospi_p16_m16);
-          const __m128i s3_11_3 = _mm_madd_epi16(s3_11_1, k__cospi_p16_m16);
-          const __m128i s3_12_2 = _mm_madd_epi16(s3_11_0, k__cospi_p16_p16);
-          const __m128i s3_12_3 = _mm_madd_epi16(s3_11_1, k__cospi_p16_p16);
-          const __m128i s3_13_2 = _mm_madd_epi16(s3_10_0, k__cospi_p16_p16);
-          const __m128i s3_13_3 = _mm_madd_epi16(s3_10_1, k__cospi_p16_p16);
-          // dct_const_round_shift
-          const __m128i s3_10_4 = _mm_add_epi32(s3_10_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_10_5 = _mm_add_epi32(s3_10_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_11_4 = _mm_add_epi32(s3_11_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_11_5 = _mm_add_epi32(s3_11_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_12_4 = _mm_add_epi32(s3_12_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_12_5 = _mm_add_epi32(s3_12_3, k__DCT_CONST_ROUNDING);
-          const __m128i s3_13_4 = _mm_add_epi32(s3_13_2, k__DCT_CONST_ROUNDING);
-          const __m128i s3_13_5 = _mm_add_epi32(s3_13_3, k__DCT_CONST_ROUNDING);
-          lstep3[20] = _mm_srai_epi32(s3_10_4, DCT_CONST_BITS);
-          lstep3[21] = _mm_srai_epi32(s3_10_5, DCT_CONST_BITS);
-          lstep3[22] = _mm_srai_epi32(s3_11_4, DCT_CONST_BITS);
-          lstep3[23] = _mm_srai_epi32(s3_11_5, DCT_CONST_BITS);
-          lstep3[24] = _mm_srai_epi32(s3_12_4, DCT_CONST_BITS);
-          lstep3[25] = _mm_srai_epi32(s3_12_5, DCT_CONST_BITS);
-          lstep3[26] = _mm_srai_epi32(s3_13_4, DCT_CONST_BITS);
-          lstep3[27] = _mm_srai_epi32(s3_13_5, DCT_CONST_BITS);
-        }
-        {
-          lstep2[40] = _mm_unpacklo_epi16(step2[20], kZero);
-          lstep2[41] = _mm_unpackhi_epi16(step2[20], kZero);
-          lstep2[42] = _mm_unpacklo_epi16(step2[21], kZero);
-          lstep2[43] = _mm_unpackhi_epi16(step2[21], kZero);
-          lstep2[44] = _mm_unpacklo_epi16(step2[22], kZero);
-          lstep2[45] = _mm_unpackhi_epi16(step2[22], kZero);
-          lstep2[46] = _mm_unpacklo_epi16(step2[23], kZero);
-          lstep2[47] = _mm_unpackhi_epi16(step2[23], kZero);
-          lstep2[48] = _mm_unpacklo_epi16(step2[24], kZero);
-          lstep2[49] = _mm_unpackhi_epi16(step2[24], kZero);
-          lstep2[50] = _mm_unpacklo_epi16(step2[25], kZero);
-          lstep2[51] = _mm_unpackhi_epi16(step2[25], kZero);
-          lstep2[52] = _mm_unpacklo_epi16(step2[26], kZero);
-          lstep2[53] = _mm_unpackhi_epi16(step2[26], kZero);
-          lstep2[54] = _mm_unpacklo_epi16(step2[27], kZero);
-          lstep2[55] = _mm_unpackhi_epi16(step2[27], kZero);
-          lstep2[40] = _mm_madd_epi16(lstep2[40], kOne);
-          lstep2[41] = _mm_madd_epi16(lstep2[41], kOne);
-          lstep2[42] = _mm_madd_epi16(lstep2[42], kOne);
-          lstep2[43] = _mm_madd_epi16(lstep2[43], kOne);
-          lstep2[44] = _mm_madd_epi16(lstep2[44], kOne);
-          lstep2[45] = _mm_madd_epi16(lstep2[45], kOne);
-          lstep2[46] = _mm_madd_epi16(lstep2[46], kOne);
-          lstep2[47] = _mm_madd_epi16(lstep2[47], kOne);
-          lstep2[48] = _mm_madd_epi16(lstep2[48], kOne);
-          lstep2[49] = _mm_madd_epi16(lstep2[49], kOne);
-          lstep2[50] = _mm_madd_epi16(lstep2[50], kOne);
-          lstep2[51] = _mm_madd_epi16(lstep2[51], kOne);
-          lstep2[52] = _mm_madd_epi16(lstep2[52], kOne);
-          lstep2[53] = _mm_madd_epi16(lstep2[53], kOne);
-          lstep2[54] = _mm_madd_epi16(lstep2[54], kOne);
-          lstep2[55] = _mm_madd_epi16(lstep2[55], kOne);
-
-          lstep1[32] = _mm_unpacklo_epi16(step1[16], kZero);
-          lstep1[33] = _mm_unpackhi_epi16(step1[16], kZero);
-          lstep1[34] = _mm_unpacklo_epi16(step1[17], kZero);
-          lstep1[35] = _mm_unpackhi_epi16(step1[17], kZero);
-          lstep1[36] = _mm_unpacklo_epi16(step1[18], kZero);
-          lstep1[37] = _mm_unpackhi_epi16(step1[18], kZero);
-          lstep1[38] = _mm_unpacklo_epi16(step1[19], kZero);
-          lstep1[39] = _mm_unpackhi_epi16(step1[19], kZero);
-          lstep1[56] = _mm_unpacklo_epi16(step1[28], kZero);
-          lstep1[57] = _mm_unpackhi_epi16(step1[28], kZero);
-          lstep1[58] = _mm_unpacklo_epi16(step1[29], kZero);
-          lstep1[59] = _mm_unpackhi_epi16(step1[29], kZero);
-          lstep1[60] = _mm_unpacklo_epi16(step1[30], kZero);
-          lstep1[61] = _mm_unpackhi_epi16(step1[30], kZero);
-          lstep1[62] = _mm_unpacklo_epi16(step1[31], kZero);
-          lstep1[63] = _mm_unpackhi_epi16(step1[31], kZero);
-          lstep1[32] = _mm_madd_epi16(lstep1[32], kOne);
-          lstep1[33] = _mm_madd_epi16(lstep1[33], kOne);
-          lstep1[34] = _mm_madd_epi16(lstep1[34], kOne);
-          lstep1[35] = _mm_madd_epi16(lstep1[35], kOne);
-          lstep1[36] = _mm_madd_epi16(lstep1[36], kOne);
-          lstep1[37] = _mm_madd_epi16(lstep1[37], kOne);
-          lstep1[38] = _mm_madd_epi16(lstep1[38], kOne);
-          lstep1[39] = _mm_madd_epi16(lstep1[39], kOne);
-          lstep1[56] = _mm_madd_epi16(lstep1[56], kOne);
-          lstep1[57] = _mm_madd_epi16(lstep1[57], kOne);
-          lstep1[58] = _mm_madd_epi16(lstep1[58], kOne);
-          lstep1[59] = _mm_madd_epi16(lstep1[59], kOne);
-          lstep1[60] = _mm_madd_epi16(lstep1[60], kOne);
-          lstep1[61] = _mm_madd_epi16(lstep1[61], kOne);
-          lstep1[62] = _mm_madd_epi16(lstep1[62], kOne);
-          lstep1[63] = _mm_madd_epi16(lstep1[63], kOne);
-
-          lstep3[32] = _mm_add_epi32(lstep2[46], lstep1[32]);
-          lstep3[33] = _mm_add_epi32(lstep2[47], lstep1[33]);
-
-          lstep3[34] = _mm_add_epi32(lstep2[44], lstep1[34]);
-          lstep3[35] = _mm_add_epi32(lstep2[45], lstep1[35]);
-          lstep3[36] = _mm_add_epi32(lstep2[42], lstep1[36]);
-          lstep3[37] = _mm_add_epi32(lstep2[43], lstep1[37]);
-          lstep3[38] = _mm_add_epi32(lstep2[40], lstep1[38]);
-          lstep3[39] = _mm_add_epi32(lstep2[41], lstep1[39]);
-          lstep3[40] = _mm_sub_epi32(lstep1[38], lstep2[40]);
-          lstep3[41] = _mm_sub_epi32(lstep1[39], lstep2[41]);
-          lstep3[42] = _mm_sub_epi32(lstep1[36], lstep2[42]);
-          lstep3[43] = _mm_sub_epi32(lstep1[37], lstep2[43]);
-          lstep3[44] = _mm_sub_epi32(lstep1[34], lstep2[44]);
-          lstep3[45] = _mm_sub_epi32(lstep1[35], lstep2[45]);
-          lstep3[46] = _mm_sub_epi32(lstep1[32], lstep2[46]);
-          lstep3[47] = _mm_sub_epi32(lstep1[33], lstep2[47]);
-          lstep3[48] = _mm_sub_epi32(lstep1[62], lstep2[48]);
-          lstep3[49] = _mm_sub_epi32(lstep1[63], lstep2[49]);
-          lstep3[50] = _mm_sub_epi32(lstep1[60], lstep2[50]);
-          lstep3[51] = _mm_sub_epi32(lstep1[61], lstep2[51]);
-          lstep3[52] = _mm_sub_epi32(lstep1[58], lstep2[52]);
-          lstep3[53] = _mm_sub_epi32(lstep1[59], lstep2[53]);
-          lstep3[54] = _mm_sub_epi32(lstep1[56], lstep2[54]);
-          lstep3[55] = _mm_sub_epi32(lstep1[57], lstep2[55]);
-          lstep3[56] = _mm_add_epi32(lstep2[54], lstep1[56]);
-          lstep3[57] = _mm_add_epi32(lstep2[55], lstep1[57]);
-          lstep3[58] = _mm_add_epi32(lstep2[52], lstep1[58]);
-          lstep3[59] = _mm_add_epi32(lstep2[53], lstep1[59]);
-          lstep3[60] = _mm_add_epi32(lstep2[50], lstep1[60]);
-          lstep3[61] = _mm_add_epi32(lstep2[51], lstep1[61]);
-          lstep3[62] = _mm_add_epi32(lstep2[48], lstep1[62]);
-          lstep3[63] = _mm_add_epi32(lstep2[49], lstep1[63]);
-        }
-
-        // stage 4
-        {
-          // expanding to 32-bit length priori to addition operations
-          lstep2[16] = _mm_unpacklo_epi16(step2[8], kZero);
-          lstep2[17] = _mm_unpackhi_epi16(step2[8], kZero);
-          lstep2[18] = _mm_unpacklo_epi16(step2[9], kZero);
-          lstep2[19] = _mm_unpackhi_epi16(step2[9], kZero);
-          lstep2[28] = _mm_unpacklo_epi16(step2[14], kZero);
-          lstep2[29] = _mm_unpackhi_epi16(step2[14], kZero);
-          lstep2[30] = _mm_unpacklo_epi16(step2[15], kZero);
-          lstep2[31] = _mm_unpackhi_epi16(step2[15], kZero);
-          lstep2[16] = _mm_madd_epi16(lstep2[16], kOne);
-          lstep2[17] = _mm_madd_epi16(lstep2[17], kOne);
-          lstep2[18] = _mm_madd_epi16(lstep2[18], kOne);
-          lstep2[19] = _mm_madd_epi16(lstep2[19], kOne);
-          lstep2[28] = _mm_madd_epi16(lstep2[28], kOne);
-          lstep2[29] = _mm_madd_epi16(lstep2[29], kOne);
-          lstep2[30] = _mm_madd_epi16(lstep2[30], kOne);
-          lstep2[31] = _mm_madd_epi16(lstep2[31], kOne);
-
-          lstep1[0] = _mm_add_epi32(lstep3[6], lstep3[0]);
-          lstep1[1] = _mm_add_epi32(lstep3[7], lstep3[1]);
-          lstep1[2] = _mm_add_epi32(lstep3[4], lstep3[2]);
-          lstep1[3] = _mm_add_epi32(lstep3[5], lstep3[3]);
-          lstep1[4] = _mm_sub_epi32(lstep3[2], lstep3[4]);
-          lstep1[5] = _mm_sub_epi32(lstep3[3], lstep3[5]);
-          lstep1[6] = _mm_sub_epi32(lstep3[0], lstep3[6]);
-          lstep1[7] = _mm_sub_epi32(lstep3[1], lstep3[7]);
-          lstep1[16] = _mm_add_epi32(lstep3[22], lstep2[16]);
-          lstep1[17] = _mm_add_epi32(lstep3[23], lstep2[17]);
-          lstep1[18] = _mm_add_epi32(lstep3[20], lstep2[18]);
-          lstep1[19] = _mm_add_epi32(lstep3[21], lstep2[19]);
-          lstep1[20] = _mm_sub_epi32(lstep2[18], lstep3[20]);
-          lstep1[21] = _mm_sub_epi32(lstep2[19], lstep3[21]);
-          lstep1[22] = _mm_sub_epi32(lstep2[16], lstep3[22]);
-          lstep1[23] = _mm_sub_epi32(lstep2[17], lstep3[23]);
-          lstep1[24] = _mm_sub_epi32(lstep2[30], lstep3[24]);
-          lstep1[25] = _mm_sub_epi32(lstep2[31], lstep3[25]);
-          lstep1[26] = _mm_sub_epi32(lstep2[28], lstep3[26]);
-          lstep1[27] = _mm_sub_epi32(lstep2[29], lstep3[27]);
-          lstep1[28] = _mm_add_epi32(lstep3[26], lstep2[28]);
-          lstep1[29] = _mm_add_epi32(lstep3[27], lstep2[29]);
-          lstep1[30] = _mm_add_epi32(lstep3[24], lstep2[30]);
-          lstep1[31] = _mm_add_epi32(lstep3[25], lstep2[31]);
-        }
-        {
-          // to be continued...
-          //
-          const __m128i k32_p16_p16 = pair_set_epi32(cospi_16_64, cospi_16_64);
-          const __m128i k32_p16_m16 = pair_set_epi32(cospi_16_64, -cospi_16_64);
-
-          u[0] = _mm_unpacklo_epi32(lstep3[12], lstep3[10]);
-          u[1] = _mm_unpackhi_epi32(lstep3[12], lstep3[10]);
-          u[2] = _mm_unpacklo_epi32(lstep3[13], lstep3[11]);
-          u[3] = _mm_unpackhi_epi32(lstep3[13], lstep3[11]);
-
-          // TODO(jingning): manually inline k_madd_epi32_ to further hide
-          // instruction latency.
-          v[0] = k_madd_epi32(u[0], k32_p16_m16);
-          v[1] = k_madd_epi32(u[1], k32_p16_m16);
-          v[2] = k_madd_epi32(u[2], k32_p16_m16);
-          v[3] = k_madd_epi32(u[3], k32_p16_m16);
-          v[4] = k_madd_epi32(u[0], k32_p16_p16);
-          v[5] = k_madd_epi32(u[1], k32_p16_p16);
-          v[6] = k_madd_epi32(u[2], k32_p16_p16);
-          v[7] = k_madd_epi32(u[3], k32_p16_p16);
-#if DCT_HIGH_BIT_DEPTH
-          overflow = k_check_epi32_overflow_8(&v[0], &v[1], &v[2], &v[3], &v[4],
-                                              &v[5], &v[6], &v[7], &kZero);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-          u[0] = k_packs_epi64(v[0], v[1]);
-          u[1] = k_packs_epi64(v[2], v[3]);
-          u[2] = k_packs_epi64(v[4], v[5]);
-          u[3] = k_packs_epi64(v[6], v[7]);
-
-          v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
-          v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
-          v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
-          v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
-
-          lstep1[10] = _mm_srai_epi32(v[0], DCT_CONST_BITS);
-          lstep1[11] = _mm_srai_epi32(v[1], DCT_CONST_BITS);
-          lstep1[12] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
-          lstep1[13] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
-        }
-        {
-          const __m128i k32_m08_p24 = pair_set_epi32(-cospi_8_64, cospi_24_64);
-          const __m128i k32_m24_m08 = pair_set_epi32(-cospi_24_64, -cospi_8_64);
-          const __m128i k32_p24_p08 = pair_set_epi32(cospi_24_64, cospi_8_64);
-
-          u[0] = _mm_unpacklo_epi32(lstep3[36], lstep3[58]);
-          u[1] = _mm_unpackhi_epi32(lstep3[36], lstep3[58]);
-          u[2] = _mm_unpacklo_epi32(lstep3[37], lstep3[59]);
-          u[3] = _mm_unpackhi_epi32(lstep3[37], lstep3[59]);
-          u[4] = _mm_unpacklo_epi32(lstep3[38], lstep3[56]);
-          u[5] = _mm_unpackhi_epi32(lstep3[38], lstep3[56]);
-          u[6] = _mm_unpacklo_epi32(lstep3[39], lstep3[57]);
-          u[7] = _mm_unpackhi_epi32(lstep3[39], lstep3[57]);
-          u[8] = _mm_unpacklo_epi32(lstep3[40], lstep3[54]);
-          u[9] = _mm_unpackhi_epi32(lstep3[40], lstep3[54]);
-          u[10] = _mm_unpacklo_epi32(lstep3[41], lstep3[55]);
-          u[11] = _mm_unpackhi_epi32(lstep3[41], lstep3[55]);
-          u[12] = _mm_unpacklo_epi32(lstep3[42], lstep3[52]);
-          u[13] = _mm_unpackhi_epi32(lstep3[42], lstep3[52]);
-          u[14] = _mm_unpacklo_epi32(lstep3[43], lstep3[53]);
-          u[15] = _mm_unpackhi_epi32(lstep3[43], lstep3[53]);
-
-          v[0] = k_madd_epi32(u[0], k32_m08_p24);
-          v[1] = k_madd_epi32(u[1], k32_m08_p24);
-          v[2] = k_madd_epi32(u[2], k32_m08_p24);
-          v[3] = k_madd_epi32(u[3], k32_m08_p24);
-          v[4] = k_madd_epi32(u[4], k32_m08_p24);
-          v[5] = k_madd_epi32(u[5], k32_m08_p24);
-          v[6] = k_madd_epi32(u[6], k32_m08_p24);
-          v[7] = k_madd_epi32(u[7], k32_m08_p24);
-          v[8] = k_madd_epi32(u[8], k32_m24_m08);
-          v[9] = k_madd_epi32(u[9], k32_m24_m08);
-          v[10] = k_madd_epi32(u[10], k32_m24_m08);
-          v[11] = k_madd_epi32(u[11], k32_m24_m08);
-          v[12] = k_madd_epi32(u[12], k32_m24_m08);
-          v[13] = k_madd_epi32(u[13], k32_m24_m08);
-          v[14] = k_madd_epi32(u[14], k32_m24_m08);
-          v[15] = k_madd_epi32(u[15], k32_m24_m08);
-          v[16] = k_madd_epi32(u[12], k32_m08_p24);
-          v[17] = k_madd_epi32(u[13], k32_m08_p24);
-          v[18] = k_madd_epi32(u[14], k32_m08_p24);
-          v[19] = k_madd_epi32(u[15], k32_m08_p24);
-          v[20] = k_madd_epi32(u[8], k32_m08_p24);
-          v[21] = k_madd_epi32(u[9], k32_m08_p24);
-          v[22] = k_madd_epi32(u[10], k32_m08_p24);
-          v[23] = k_madd_epi32(u[11], k32_m08_p24);
-          v[24] = k_madd_epi32(u[4], k32_p24_p08);
-          v[25] = k_madd_epi32(u[5], k32_p24_p08);
-          v[26] = k_madd_epi32(u[6], k32_p24_p08);
-          v[27] = k_madd_epi32(u[7], k32_p24_p08);
-          v[28] = k_madd_epi32(u[0], k32_p24_p08);
-          v[29] = k_madd_epi32(u[1], k32_p24_p08);
-          v[30] = k_madd_epi32(u[2], k32_p24_p08);
-          v[31] = k_madd_epi32(u[3], k32_p24_p08);
-
-#if DCT_HIGH_BIT_DEPTH
-          overflow = k_check_epi32_overflow_32(
-              &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], &v[8],
-              &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], &v[16],
-              &v[17], &v[18], &v[19], &v[20], &v[21], &v[22], &v[23], &v[24],
-              &v[25], &v[26], &v[27], &v[28], &v[29], &v[30], &v[31], &kZero);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-          u[0] = k_packs_epi64(v[0], v[1]);
-          u[1] = k_packs_epi64(v[2], v[3]);
-          u[2] = k_packs_epi64(v[4], v[5]);
-          u[3] = k_packs_epi64(v[6], v[7]);
-          u[4] = k_packs_epi64(v[8], v[9]);
-          u[5] = k_packs_epi64(v[10], v[11]);
-          u[6] = k_packs_epi64(v[12], v[13]);
-          u[7] = k_packs_epi64(v[14], v[15]);
-          u[8] = k_packs_epi64(v[16], v[17]);
-          u[9] = k_packs_epi64(v[18], v[19]);
-          u[10] = k_packs_epi64(v[20], v[21]);
-          u[11] = k_packs_epi64(v[22], v[23]);
-          u[12] = k_packs_epi64(v[24], v[25]);
-          u[13] = k_packs_epi64(v[26], v[27]);
-          u[14] = k_packs_epi64(v[28], v[29]);
-          u[15] = k_packs_epi64(v[30], v[31]);
-
-          v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
-          v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
-          v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
-          v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
-          v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING);
-          v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING);
-          v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING);
-          v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING);
-          v[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING);
-          v[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING);
-          v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING);
-          v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING);
-          v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING);
-          v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING);
-          v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING);
-          v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING);
-
-          lstep1[36] = _mm_srai_epi32(v[0], DCT_CONST_BITS);
-          lstep1[37] = _mm_srai_epi32(v[1], DCT_CONST_BITS);
-          lstep1[38] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
-          lstep1[39] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
-          lstep1[40] = _mm_srai_epi32(v[4], DCT_CONST_BITS);
-          lstep1[41] = _mm_srai_epi32(v[5], DCT_CONST_BITS);
-          lstep1[42] = _mm_srai_epi32(v[6], DCT_CONST_BITS);
-          lstep1[43] = _mm_srai_epi32(v[7], DCT_CONST_BITS);
-          lstep1[52] = _mm_srai_epi32(v[8], DCT_CONST_BITS);
-          lstep1[53] = _mm_srai_epi32(v[9], DCT_CONST_BITS);
-          lstep1[54] = _mm_srai_epi32(v[10], DCT_CONST_BITS);
-          lstep1[55] = _mm_srai_epi32(v[11], DCT_CONST_BITS);
-          lstep1[56] = _mm_srai_epi32(v[12], DCT_CONST_BITS);
-          lstep1[57] = _mm_srai_epi32(v[13], DCT_CONST_BITS);
-          lstep1[58] = _mm_srai_epi32(v[14], DCT_CONST_BITS);
-          lstep1[59] = _mm_srai_epi32(v[15], DCT_CONST_BITS);
-        }
-        // stage 5
-        {
-          lstep2[8] = _mm_add_epi32(lstep1[10], lstep3[8]);
-          lstep2[9] = _mm_add_epi32(lstep1[11], lstep3[9]);
-          lstep2[10] = _mm_sub_epi32(lstep3[8], lstep1[10]);
-          lstep2[11] = _mm_sub_epi32(lstep3[9], lstep1[11]);
-          lstep2[12] = _mm_sub_epi32(lstep3[14], lstep1[12]);
-          lstep2[13] = _mm_sub_epi32(lstep3[15], lstep1[13]);
-          lstep2[14] = _mm_add_epi32(lstep1[12], lstep3[14]);
-          lstep2[15] = _mm_add_epi32(lstep1[13], lstep3[15]);
-        }
-        {
-          const __m128i k32_p16_p16 = pair_set_epi32(cospi_16_64, cospi_16_64);
-          const __m128i k32_p16_m16 = pair_set_epi32(cospi_16_64, -cospi_16_64);
-          const __m128i k32_p24_p08 = pair_set_epi32(cospi_24_64, cospi_8_64);
-          const __m128i k32_m08_p24 = pair_set_epi32(-cospi_8_64, cospi_24_64);
-
-          u[0] = _mm_unpacklo_epi32(lstep1[0], lstep1[2]);
-          u[1] = _mm_unpackhi_epi32(lstep1[0], lstep1[2]);
-          u[2] = _mm_unpacklo_epi32(lstep1[1], lstep1[3]);
-          u[3] = _mm_unpackhi_epi32(lstep1[1], lstep1[3]);
-          u[4] = _mm_unpacklo_epi32(lstep1[4], lstep1[6]);
-          u[5] = _mm_unpackhi_epi32(lstep1[4], lstep1[6]);
-          u[6] = _mm_unpacklo_epi32(lstep1[5], lstep1[7]);
-          u[7] = _mm_unpackhi_epi32(lstep1[5], lstep1[7]);
-
-          // TODO(jingning): manually inline k_madd_epi32_ to further hide
-          // instruction latency.
-          v[0] = k_madd_epi32(u[0], k32_p16_p16);
-          v[1] = k_madd_epi32(u[1], k32_p16_p16);
-          v[2] = k_madd_epi32(u[2], k32_p16_p16);
-          v[3] = k_madd_epi32(u[3], k32_p16_p16);
-          v[4] = k_madd_epi32(u[0], k32_p16_m16);
-          v[5] = k_madd_epi32(u[1], k32_p16_m16);
-          v[6] = k_madd_epi32(u[2], k32_p16_m16);
-          v[7] = k_madd_epi32(u[3], k32_p16_m16);
-          v[8] = k_madd_epi32(u[4], k32_p24_p08);
-          v[9] = k_madd_epi32(u[5], k32_p24_p08);
-          v[10] = k_madd_epi32(u[6], k32_p24_p08);
-          v[11] = k_madd_epi32(u[7], k32_p24_p08);
-          v[12] = k_madd_epi32(u[4], k32_m08_p24);
-          v[13] = k_madd_epi32(u[5], k32_m08_p24);
-          v[14] = k_madd_epi32(u[6], k32_m08_p24);
-          v[15] = k_madd_epi32(u[7], k32_m08_p24);
-
-#if DCT_HIGH_BIT_DEPTH
-          overflow = k_check_epi32_overflow_16(
-              &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], &v[8],
-              &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], &kZero);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-          u[0] = k_packs_epi64(v[0], v[1]);
-          u[1] = k_packs_epi64(v[2], v[3]);
-          u[2] = k_packs_epi64(v[4], v[5]);
-          u[3] = k_packs_epi64(v[6], v[7]);
-          u[4] = k_packs_epi64(v[8], v[9]);
-          u[5] = k_packs_epi64(v[10], v[11]);
-          u[6] = k_packs_epi64(v[12], v[13]);
-          u[7] = k_packs_epi64(v[14], v[15]);
-
-          v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
-          v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
-          v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
-          v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
-          v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING);
-          v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING);
-          v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING);
-          v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING);
-
-          u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS);
-          u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS);
-          u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
-          u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
-          u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS);
-          u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS);
-          u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS);
-          u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS);
-
-          sign[0] = _mm_cmplt_epi32(u[0], kZero);
-          sign[1] = _mm_cmplt_epi32(u[1], kZero);
-          sign[2] = _mm_cmplt_epi32(u[2], kZero);
-          sign[3] = _mm_cmplt_epi32(u[3], kZero);
-          sign[4] = _mm_cmplt_epi32(u[4], kZero);
-          sign[5] = _mm_cmplt_epi32(u[5], kZero);
-          sign[6] = _mm_cmplt_epi32(u[6], kZero);
-          sign[7] = _mm_cmplt_epi32(u[7], kZero);
-
-          u[0] = _mm_sub_epi32(u[0], sign[0]);
-          u[1] = _mm_sub_epi32(u[1], sign[1]);
-          u[2] = _mm_sub_epi32(u[2], sign[2]);
-          u[3] = _mm_sub_epi32(u[3], sign[3]);
-          u[4] = _mm_sub_epi32(u[4], sign[4]);
-          u[5] = _mm_sub_epi32(u[5], sign[5]);
-          u[6] = _mm_sub_epi32(u[6], sign[6]);
-          u[7] = _mm_sub_epi32(u[7], sign[7]);
-
-          u[0] = _mm_add_epi32(u[0], K32One);
-          u[1] = _mm_add_epi32(u[1], K32One);
-          u[2] = _mm_add_epi32(u[2], K32One);
-          u[3] = _mm_add_epi32(u[3], K32One);
-          u[4] = _mm_add_epi32(u[4], K32One);
-          u[5] = _mm_add_epi32(u[5], K32One);
-          u[6] = _mm_add_epi32(u[6], K32One);
-          u[7] = _mm_add_epi32(u[7], K32One);
-
-          u[0] = _mm_srai_epi32(u[0], 2);
-          u[1] = _mm_srai_epi32(u[1], 2);
-          u[2] = _mm_srai_epi32(u[2], 2);
-          u[3] = _mm_srai_epi32(u[3], 2);
-          u[4] = _mm_srai_epi32(u[4], 2);
-          u[5] = _mm_srai_epi32(u[5], 2);
-          u[6] = _mm_srai_epi32(u[6], 2);
-          u[7] = _mm_srai_epi32(u[7], 2);
-
-          // Combine
-          out[0] = _mm_packs_epi32(u[0], u[1]);
-          out[16] = _mm_packs_epi32(u[2], u[3]);
-          out[8] = _mm_packs_epi32(u[4], u[5]);
-          out[24] = _mm_packs_epi32(u[6], u[7]);
-#if DCT_HIGH_BIT_DEPTH
-          overflow =
-              check_epi16_overflow_x4(&out[0], &out[16], &out[8], &out[24]);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          const __m128i k32_m08_p24 = pair_set_epi32(-cospi_8_64, cospi_24_64);
-          const __m128i k32_m24_m08 = pair_set_epi32(-cospi_24_64, -cospi_8_64);
-          const __m128i k32_p24_p08 = pair_set_epi32(cospi_24_64, cospi_8_64);
-
-          u[0] = _mm_unpacklo_epi32(lstep1[18], lstep1[28]);
-          u[1] = _mm_unpackhi_epi32(lstep1[18], lstep1[28]);
-          u[2] = _mm_unpacklo_epi32(lstep1[19], lstep1[29]);
-          u[3] = _mm_unpackhi_epi32(lstep1[19], lstep1[29]);
-          u[4] = _mm_unpacklo_epi32(lstep1[20], lstep1[26]);
-          u[5] = _mm_unpackhi_epi32(lstep1[20], lstep1[26]);
-          u[6] = _mm_unpacklo_epi32(lstep1[21], lstep1[27]);
-          u[7] = _mm_unpackhi_epi32(lstep1[21], lstep1[27]);
-
-          v[0] = k_madd_epi32(u[0], k32_m08_p24);
-          v[1] = k_madd_epi32(u[1], k32_m08_p24);
-          v[2] = k_madd_epi32(u[2], k32_m08_p24);
-          v[3] = k_madd_epi32(u[3], k32_m08_p24);
-          v[4] = k_madd_epi32(u[4], k32_m24_m08);
-          v[5] = k_madd_epi32(u[5], k32_m24_m08);
-          v[6] = k_madd_epi32(u[6], k32_m24_m08);
-          v[7] = k_madd_epi32(u[7], k32_m24_m08);
-          v[8] = k_madd_epi32(u[4], k32_m08_p24);
-          v[9] = k_madd_epi32(u[5], k32_m08_p24);
-          v[10] = k_madd_epi32(u[6], k32_m08_p24);
-          v[11] = k_madd_epi32(u[7], k32_m08_p24);
-          v[12] = k_madd_epi32(u[0], k32_p24_p08);
-          v[13] = k_madd_epi32(u[1], k32_p24_p08);
-          v[14] = k_madd_epi32(u[2], k32_p24_p08);
-          v[15] = k_madd_epi32(u[3], k32_p24_p08);
-
-#if DCT_HIGH_BIT_DEPTH
-          overflow = k_check_epi32_overflow_16(
-              &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], &v[8],
-              &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], &kZero);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-          u[0] = k_packs_epi64(v[0], v[1]);
-          u[1] = k_packs_epi64(v[2], v[3]);
-          u[2] = k_packs_epi64(v[4], v[5]);
-          u[3] = k_packs_epi64(v[6], v[7]);
-          u[4] = k_packs_epi64(v[8], v[9]);
-          u[5] = k_packs_epi64(v[10], v[11]);
-          u[6] = k_packs_epi64(v[12], v[13]);
-          u[7] = k_packs_epi64(v[14], v[15]);
-
-          u[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
-          u[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
-          u[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
-          u[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
-          u[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING);
-          u[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING);
-          u[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING);
-          u[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING);
-
-          lstep2[18] = _mm_srai_epi32(u[0], DCT_CONST_BITS);
-          lstep2[19] = _mm_srai_epi32(u[1], DCT_CONST_BITS);
-          lstep2[20] = _mm_srai_epi32(u[2], DCT_CONST_BITS);
-          lstep2[21] = _mm_srai_epi32(u[3], DCT_CONST_BITS);
-          lstep2[26] = _mm_srai_epi32(u[4], DCT_CONST_BITS);
-          lstep2[27] = _mm_srai_epi32(u[5], DCT_CONST_BITS);
-          lstep2[28] = _mm_srai_epi32(u[6], DCT_CONST_BITS);
-          lstep2[29] = _mm_srai_epi32(u[7], DCT_CONST_BITS);
-        }
-        {
-          lstep2[32] = _mm_add_epi32(lstep1[38], lstep3[32]);
-          lstep2[33] = _mm_add_epi32(lstep1[39], lstep3[33]);
-          lstep2[34] = _mm_add_epi32(lstep1[36], lstep3[34]);
-          lstep2[35] = _mm_add_epi32(lstep1[37], lstep3[35]);
-          lstep2[36] = _mm_sub_epi32(lstep3[34], lstep1[36]);
-          lstep2[37] = _mm_sub_epi32(lstep3[35], lstep1[37]);
-          lstep2[38] = _mm_sub_epi32(lstep3[32], lstep1[38]);
-          lstep2[39] = _mm_sub_epi32(lstep3[33], lstep1[39]);
-          lstep2[40] = _mm_sub_epi32(lstep3[46], lstep1[40]);
-          lstep2[41] = _mm_sub_epi32(lstep3[47], lstep1[41]);
-          lstep2[42] = _mm_sub_epi32(lstep3[44], lstep1[42]);
-          lstep2[43] = _mm_sub_epi32(lstep3[45], lstep1[43]);
-          lstep2[44] = _mm_add_epi32(lstep1[42], lstep3[44]);
-          lstep2[45] = _mm_add_epi32(lstep1[43], lstep3[45]);
-          lstep2[46] = _mm_add_epi32(lstep1[40], lstep3[46]);
-          lstep2[47] = _mm_add_epi32(lstep1[41], lstep3[47]);
-          lstep2[48] = _mm_add_epi32(lstep1[54], lstep3[48]);
-          lstep2[49] = _mm_add_epi32(lstep1[55], lstep3[49]);
-          lstep2[50] = _mm_add_epi32(lstep1[52], lstep3[50]);
-          lstep2[51] = _mm_add_epi32(lstep1[53], lstep3[51]);
-          lstep2[52] = _mm_sub_epi32(lstep3[50], lstep1[52]);
-          lstep2[53] = _mm_sub_epi32(lstep3[51], lstep1[53]);
-          lstep2[54] = _mm_sub_epi32(lstep3[48], lstep1[54]);
-          lstep2[55] = _mm_sub_epi32(lstep3[49], lstep1[55]);
-          lstep2[56] = _mm_sub_epi32(lstep3[62], lstep1[56]);
-          lstep2[57] = _mm_sub_epi32(lstep3[63], lstep1[57]);
-          lstep2[58] = _mm_sub_epi32(lstep3[60], lstep1[58]);
-          lstep2[59] = _mm_sub_epi32(lstep3[61], lstep1[59]);
-          lstep2[60] = _mm_add_epi32(lstep1[58], lstep3[60]);
-          lstep2[61] = _mm_add_epi32(lstep1[59], lstep3[61]);
-          lstep2[62] = _mm_add_epi32(lstep1[56], lstep3[62]);
-          lstep2[63] = _mm_add_epi32(lstep1[57], lstep3[63]);
-        }
-        // stage 6
-        {
-          const __m128i k32_p28_p04 = pair_set_epi32(cospi_28_64, cospi_4_64);
-          const __m128i k32_p12_p20 = pair_set_epi32(cospi_12_64, cospi_20_64);
-          const __m128i k32_m20_p12 = pair_set_epi32(-cospi_20_64, cospi_12_64);
-          const __m128i k32_m04_p28 = pair_set_epi32(-cospi_4_64, cospi_28_64);
-
-          u[0] = _mm_unpacklo_epi32(lstep2[8], lstep2[14]);
-          u[1] = _mm_unpackhi_epi32(lstep2[8], lstep2[14]);
-          u[2] = _mm_unpacklo_epi32(lstep2[9], lstep2[15]);
-          u[3] = _mm_unpackhi_epi32(lstep2[9], lstep2[15]);
-          u[4] = _mm_unpacklo_epi32(lstep2[10], lstep2[12]);
-          u[5] = _mm_unpackhi_epi32(lstep2[10], lstep2[12]);
-          u[6] = _mm_unpacklo_epi32(lstep2[11], lstep2[13]);
-          u[7] = _mm_unpackhi_epi32(lstep2[11], lstep2[13]);
-          u[8] = _mm_unpacklo_epi32(lstep2[10], lstep2[12]);
-          u[9] = _mm_unpackhi_epi32(lstep2[10], lstep2[12]);
-          u[10] = _mm_unpacklo_epi32(lstep2[11], lstep2[13]);
-          u[11] = _mm_unpackhi_epi32(lstep2[11], lstep2[13]);
-          u[12] = _mm_unpacklo_epi32(lstep2[8], lstep2[14]);
-          u[13] = _mm_unpackhi_epi32(lstep2[8], lstep2[14]);
-          u[14] = _mm_unpacklo_epi32(lstep2[9], lstep2[15]);
-          u[15] = _mm_unpackhi_epi32(lstep2[9], lstep2[15]);
-
-          v[0] = k_madd_epi32(u[0], k32_p28_p04);
-          v[1] = k_madd_epi32(u[1], k32_p28_p04);
-          v[2] = k_madd_epi32(u[2], k32_p28_p04);
-          v[3] = k_madd_epi32(u[3], k32_p28_p04);
-          v[4] = k_madd_epi32(u[4], k32_p12_p20);
-          v[5] = k_madd_epi32(u[5], k32_p12_p20);
-          v[6] = k_madd_epi32(u[6], k32_p12_p20);
-          v[7] = k_madd_epi32(u[7], k32_p12_p20);
-          v[8] = k_madd_epi32(u[8], k32_m20_p12);
-          v[9] = k_madd_epi32(u[9], k32_m20_p12);
-          v[10] = k_madd_epi32(u[10], k32_m20_p12);
-          v[11] = k_madd_epi32(u[11], k32_m20_p12);
-          v[12] = k_madd_epi32(u[12], k32_m04_p28);
-          v[13] = k_madd_epi32(u[13], k32_m04_p28);
-          v[14] = k_madd_epi32(u[14], k32_m04_p28);
-          v[15] = k_madd_epi32(u[15], k32_m04_p28);
-
-#if DCT_HIGH_BIT_DEPTH
-          overflow = k_check_epi32_overflow_16(
-              &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], &v[8],
-              &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], &kZero);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-          u[0] = k_packs_epi64(v[0], v[1]);
-          u[1] = k_packs_epi64(v[2], v[3]);
-          u[2] = k_packs_epi64(v[4], v[5]);
-          u[3] = k_packs_epi64(v[6], v[7]);
-          u[4] = k_packs_epi64(v[8], v[9]);
-          u[5] = k_packs_epi64(v[10], v[11]);
-          u[6] = k_packs_epi64(v[12], v[13]);
-          u[7] = k_packs_epi64(v[14], v[15]);
-
-          v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
-          v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
-          v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
-          v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
-          v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING);
-          v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING);
-          v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING);
-          v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING);
-
-          u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS);
-          u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS);
-          u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
-          u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
-          u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS);
-          u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS);
-          u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS);
-          u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS);
-
-          sign[0] = _mm_cmplt_epi32(u[0], kZero);
-          sign[1] = _mm_cmplt_epi32(u[1], kZero);
-          sign[2] = _mm_cmplt_epi32(u[2], kZero);
-          sign[3] = _mm_cmplt_epi32(u[3], kZero);
-          sign[4] = _mm_cmplt_epi32(u[4], kZero);
-          sign[5] = _mm_cmplt_epi32(u[5], kZero);
-          sign[6] = _mm_cmplt_epi32(u[6], kZero);
-          sign[7] = _mm_cmplt_epi32(u[7], kZero);
-
-          u[0] = _mm_sub_epi32(u[0], sign[0]);
-          u[1] = _mm_sub_epi32(u[1], sign[1]);
-          u[2] = _mm_sub_epi32(u[2], sign[2]);
-          u[3] = _mm_sub_epi32(u[3], sign[3]);
-          u[4] = _mm_sub_epi32(u[4], sign[4]);
-          u[5] = _mm_sub_epi32(u[5], sign[5]);
-          u[6] = _mm_sub_epi32(u[6], sign[6]);
-          u[7] = _mm_sub_epi32(u[7], sign[7]);
-
-          u[0] = _mm_add_epi32(u[0], K32One);
-          u[1] = _mm_add_epi32(u[1], K32One);
-          u[2] = _mm_add_epi32(u[2], K32One);
-          u[3] = _mm_add_epi32(u[3], K32One);
-          u[4] = _mm_add_epi32(u[4], K32One);
-          u[5] = _mm_add_epi32(u[5], K32One);
-          u[6] = _mm_add_epi32(u[6], K32One);
-          u[7] = _mm_add_epi32(u[7], K32One);
-
-          u[0] = _mm_srai_epi32(u[0], 2);
-          u[1] = _mm_srai_epi32(u[1], 2);
-          u[2] = _mm_srai_epi32(u[2], 2);
-          u[3] = _mm_srai_epi32(u[3], 2);
-          u[4] = _mm_srai_epi32(u[4], 2);
-          u[5] = _mm_srai_epi32(u[5], 2);
-          u[6] = _mm_srai_epi32(u[6], 2);
-          u[7] = _mm_srai_epi32(u[7], 2);
-
-          out[4] = _mm_packs_epi32(u[0], u[1]);
-          out[20] = _mm_packs_epi32(u[2], u[3]);
-          out[12] = _mm_packs_epi32(u[4], u[5]);
-          out[28] = _mm_packs_epi32(u[6], u[7]);
-#if DCT_HIGH_BIT_DEPTH
-          overflow =
-              check_epi16_overflow_x4(&out[4], &out[20], &out[12], &out[28]);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          lstep3[16] = _mm_add_epi32(lstep2[18], lstep1[16]);
-          lstep3[17] = _mm_add_epi32(lstep2[19], lstep1[17]);
-          lstep3[18] = _mm_sub_epi32(lstep1[16], lstep2[18]);
-          lstep3[19] = _mm_sub_epi32(lstep1[17], lstep2[19]);
-          lstep3[20] = _mm_sub_epi32(lstep1[22], lstep2[20]);
-          lstep3[21] = _mm_sub_epi32(lstep1[23], lstep2[21]);
-          lstep3[22] = _mm_add_epi32(lstep2[20], lstep1[22]);
-          lstep3[23] = _mm_add_epi32(lstep2[21], lstep1[23]);
-          lstep3[24] = _mm_add_epi32(lstep2[26], lstep1[24]);
-          lstep3[25] = _mm_add_epi32(lstep2[27], lstep1[25]);
-          lstep3[26] = _mm_sub_epi32(lstep1[24], lstep2[26]);
-          lstep3[27] = _mm_sub_epi32(lstep1[25], lstep2[27]);
-          lstep3[28] = _mm_sub_epi32(lstep1[30], lstep2[28]);
-          lstep3[29] = _mm_sub_epi32(lstep1[31], lstep2[29]);
-          lstep3[30] = _mm_add_epi32(lstep2[28], lstep1[30]);
-          lstep3[31] = _mm_add_epi32(lstep2[29], lstep1[31]);
-        }
-        {
-          const __m128i k32_m04_p28 = pair_set_epi32(-cospi_4_64, cospi_28_64);
-          const __m128i k32_m28_m04 = pair_set_epi32(-cospi_28_64, -cospi_4_64);
-          const __m128i k32_m20_p12 = pair_set_epi32(-cospi_20_64, cospi_12_64);
-          const __m128i k32_m12_m20 =
-              pair_set_epi32(-cospi_12_64, -cospi_20_64);
-          const __m128i k32_p12_p20 = pair_set_epi32(cospi_12_64, cospi_20_64);
-          const __m128i k32_p28_p04 = pair_set_epi32(cospi_28_64, cospi_4_64);
-
-          u[0] = _mm_unpacklo_epi32(lstep2[34], lstep2[60]);
-          u[1] = _mm_unpackhi_epi32(lstep2[34], lstep2[60]);
-          u[2] = _mm_unpacklo_epi32(lstep2[35], lstep2[61]);
-          u[3] = _mm_unpackhi_epi32(lstep2[35], lstep2[61]);
-          u[4] = _mm_unpacklo_epi32(lstep2[36], lstep2[58]);
-          u[5] = _mm_unpackhi_epi32(lstep2[36], lstep2[58]);
-          u[6] = _mm_unpacklo_epi32(lstep2[37], lstep2[59]);
-          u[7] = _mm_unpackhi_epi32(lstep2[37], lstep2[59]);
-          u[8] = _mm_unpacklo_epi32(lstep2[42], lstep2[52]);
-          u[9] = _mm_unpackhi_epi32(lstep2[42], lstep2[52]);
-          u[10] = _mm_unpacklo_epi32(lstep2[43], lstep2[53]);
-          u[11] = _mm_unpackhi_epi32(lstep2[43], lstep2[53]);
-          u[12] = _mm_unpacklo_epi32(lstep2[44], lstep2[50]);
-          u[13] = _mm_unpackhi_epi32(lstep2[44], lstep2[50]);
-          u[14] = _mm_unpacklo_epi32(lstep2[45], lstep2[51]);
-          u[15] = _mm_unpackhi_epi32(lstep2[45], lstep2[51]);
-
-          v[0] = k_madd_epi32(u[0], k32_m04_p28);
-          v[1] = k_madd_epi32(u[1], k32_m04_p28);
-          v[2] = k_madd_epi32(u[2], k32_m04_p28);
-          v[3] = k_madd_epi32(u[3], k32_m04_p28);
-          v[4] = k_madd_epi32(u[4], k32_m28_m04);
-          v[5] = k_madd_epi32(u[5], k32_m28_m04);
-          v[6] = k_madd_epi32(u[6], k32_m28_m04);
-          v[7] = k_madd_epi32(u[7], k32_m28_m04);
-          v[8] = k_madd_epi32(u[8], k32_m20_p12);
-          v[9] = k_madd_epi32(u[9], k32_m20_p12);
-          v[10] = k_madd_epi32(u[10], k32_m20_p12);
-          v[11] = k_madd_epi32(u[11], k32_m20_p12);
-          v[12] = k_madd_epi32(u[12], k32_m12_m20);
-          v[13] = k_madd_epi32(u[13], k32_m12_m20);
-          v[14] = k_madd_epi32(u[14], k32_m12_m20);
-          v[15] = k_madd_epi32(u[15], k32_m12_m20);
-          v[16] = k_madd_epi32(u[12], k32_m20_p12);
-          v[17] = k_madd_epi32(u[13], k32_m20_p12);
-          v[18] = k_madd_epi32(u[14], k32_m20_p12);
-          v[19] = k_madd_epi32(u[15], k32_m20_p12);
-          v[20] = k_madd_epi32(u[8], k32_p12_p20);
-          v[21] = k_madd_epi32(u[9], k32_p12_p20);
-          v[22] = k_madd_epi32(u[10], k32_p12_p20);
-          v[23] = k_madd_epi32(u[11], k32_p12_p20);
-          v[24] = k_madd_epi32(u[4], k32_m04_p28);
-          v[25] = k_madd_epi32(u[5], k32_m04_p28);
-          v[26] = k_madd_epi32(u[6], k32_m04_p28);
-          v[27] = k_madd_epi32(u[7], k32_m04_p28);
-          v[28] = k_madd_epi32(u[0], k32_p28_p04);
-          v[29] = k_madd_epi32(u[1], k32_p28_p04);
-          v[30] = k_madd_epi32(u[2], k32_p28_p04);
-          v[31] = k_madd_epi32(u[3], k32_p28_p04);
-
-#if DCT_HIGH_BIT_DEPTH
-          overflow = k_check_epi32_overflow_32(
-              &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], &v[8],
-              &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], &v[16],
-              &v[17], &v[18], &v[19], &v[20], &v[21], &v[22], &v[23], &v[24],
-              &v[25], &v[26], &v[27], &v[28], &v[29], &v[30], &v[31], &kZero);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-          u[0] = k_packs_epi64(v[0], v[1]);
-          u[1] = k_packs_epi64(v[2], v[3]);
-          u[2] = k_packs_epi64(v[4], v[5]);
-          u[3] = k_packs_epi64(v[6], v[7]);
-          u[4] = k_packs_epi64(v[8], v[9]);
-          u[5] = k_packs_epi64(v[10], v[11]);
-          u[6] = k_packs_epi64(v[12], v[13]);
-          u[7] = k_packs_epi64(v[14], v[15]);
-          u[8] = k_packs_epi64(v[16], v[17]);
-          u[9] = k_packs_epi64(v[18], v[19]);
-          u[10] = k_packs_epi64(v[20], v[21]);
-          u[11] = k_packs_epi64(v[22], v[23]);
-          u[12] = k_packs_epi64(v[24], v[25]);
-          u[13] = k_packs_epi64(v[26], v[27]);
-          u[14] = k_packs_epi64(v[28], v[29]);
-          u[15] = k_packs_epi64(v[30], v[31]);
-
-          v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
-          v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
-          v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
-          v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
-          v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING);
-          v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING);
-          v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING);
-          v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING);
-          v[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING);
-          v[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING);
-          v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING);
-          v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING);
-          v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING);
-          v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING);
-          v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING);
-          v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING);
-
-          lstep3[34] = _mm_srai_epi32(v[0], DCT_CONST_BITS);
-          lstep3[35] = _mm_srai_epi32(v[1], DCT_CONST_BITS);
-          lstep3[36] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
-          lstep3[37] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
-          lstep3[42] = _mm_srai_epi32(v[4], DCT_CONST_BITS);
-          lstep3[43] = _mm_srai_epi32(v[5], DCT_CONST_BITS);
-          lstep3[44] = _mm_srai_epi32(v[6], DCT_CONST_BITS);
-          lstep3[45] = _mm_srai_epi32(v[7], DCT_CONST_BITS);
-          lstep3[50] = _mm_srai_epi32(v[8], DCT_CONST_BITS);
-          lstep3[51] = _mm_srai_epi32(v[9], DCT_CONST_BITS);
-          lstep3[52] = _mm_srai_epi32(v[10], DCT_CONST_BITS);
-          lstep3[53] = _mm_srai_epi32(v[11], DCT_CONST_BITS);
-          lstep3[58] = _mm_srai_epi32(v[12], DCT_CONST_BITS);
-          lstep3[59] = _mm_srai_epi32(v[13], DCT_CONST_BITS);
-          lstep3[60] = _mm_srai_epi32(v[14], DCT_CONST_BITS);
-          lstep3[61] = _mm_srai_epi32(v[15], DCT_CONST_BITS);
-        }
-        // stage 7
-        {
-          const __m128i k32_p30_p02 = pair_set_epi32(cospi_30_64, cospi_2_64);
-          const __m128i k32_p14_p18 = pair_set_epi32(cospi_14_64, cospi_18_64);
-          const __m128i k32_p22_p10 = pair_set_epi32(cospi_22_64, cospi_10_64);
-          const __m128i k32_p06_p26 = pair_set_epi32(cospi_6_64, cospi_26_64);
-          const __m128i k32_m26_p06 = pair_set_epi32(-cospi_26_64, cospi_6_64);
-          const __m128i k32_m10_p22 = pair_set_epi32(-cospi_10_64, cospi_22_64);
-          const __m128i k32_m18_p14 = pair_set_epi32(-cospi_18_64, cospi_14_64);
-          const __m128i k32_m02_p30 = pair_set_epi32(-cospi_2_64, cospi_30_64);
-
-          u[0] = _mm_unpacklo_epi32(lstep3[16], lstep3[30]);
-          u[1] = _mm_unpackhi_epi32(lstep3[16], lstep3[30]);
-          u[2] = _mm_unpacklo_epi32(lstep3[17], lstep3[31]);
-          u[3] = _mm_unpackhi_epi32(lstep3[17], lstep3[31]);
-          u[4] = _mm_unpacklo_epi32(lstep3[18], lstep3[28]);
-          u[5] = _mm_unpackhi_epi32(lstep3[18], lstep3[28]);
-          u[6] = _mm_unpacklo_epi32(lstep3[19], lstep3[29]);
-          u[7] = _mm_unpackhi_epi32(lstep3[19], lstep3[29]);
-          u[8] = _mm_unpacklo_epi32(lstep3[20], lstep3[26]);
-          u[9] = _mm_unpackhi_epi32(lstep3[20], lstep3[26]);
-          u[10] = _mm_unpacklo_epi32(lstep3[21], lstep3[27]);
-          u[11] = _mm_unpackhi_epi32(lstep3[21], lstep3[27]);
-          u[12] = _mm_unpacklo_epi32(lstep3[22], lstep3[24]);
-          u[13] = _mm_unpackhi_epi32(lstep3[22], lstep3[24]);
-          u[14] = _mm_unpacklo_epi32(lstep3[23], lstep3[25]);
-          u[15] = _mm_unpackhi_epi32(lstep3[23], lstep3[25]);
-
-          v[0] = k_madd_epi32(u[0], k32_p30_p02);
-          v[1] = k_madd_epi32(u[1], k32_p30_p02);
-          v[2] = k_madd_epi32(u[2], k32_p30_p02);
-          v[3] = k_madd_epi32(u[3], k32_p30_p02);
-          v[4] = k_madd_epi32(u[4], k32_p14_p18);
-          v[5] = k_madd_epi32(u[5], k32_p14_p18);
-          v[6] = k_madd_epi32(u[6], k32_p14_p18);
-          v[7] = k_madd_epi32(u[7], k32_p14_p18);
-          v[8] = k_madd_epi32(u[8], k32_p22_p10);
-          v[9] = k_madd_epi32(u[9], k32_p22_p10);
-          v[10] = k_madd_epi32(u[10], k32_p22_p10);
-          v[11] = k_madd_epi32(u[11], k32_p22_p10);
-          v[12] = k_madd_epi32(u[12], k32_p06_p26);
-          v[13] = k_madd_epi32(u[13], k32_p06_p26);
-          v[14] = k_madd_epi32(u[14], k32_p06_p26);
-          v[15] = k_madd_epi32(u[15], k32_p06_p26);
-          v[16] = k_madd_epi32(u[12], k32_m26_p06);
-          v[17] = k_madd_epi32(u[13], k32_m26_p06);
-          v[18] = k_madd_epi32(u[14], k32_m26_p06);
-          v[19] = k_madd_epi32(u[15], k32_m26_p06);
-          v[20] = k_madd_epi32(u[8], k32_m10_p22);
-          v[21] = k_madd_epi32(u[9], k32_m10_p22);
-          v[22] = k_madd_epi32(u[10], k32_m10_p22);
-          v[23] = k_madd_epi32(u[11], k32_m10_p22);
-          v[24] = k_madd_epi32(u[4], k32_m18_p14);
-          v[25] = k_madd_epi32(u[5], k32_m18_p14);
-          v[26] = k_madd_epi32(u[6], k32_m18_p14);
-          v[27] = k_madd_epi32(u[7], k32_m18_p14);
-          v[28] = k_madd_epi32(u[0], k32_m02_p30);
-          v[29] = k_madd_epi32(u[1], k32_m02_p30);
-          v[30] = k_madd_epi32(u[2], k32_m02_p30);
-          v[31] = k_madd_epi32(u[3], k32_m02_p30);
-
-#if DCT_HIGH_BIT_DEPTH
-          overflow = k_check_epi32_overflow_32(
-              &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], &v[8],
-              &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], &v[16],
-              &v[17], &v[18], &v[19], &v[20], &v[21], &v[22], &v[23], &v[24],
-              &v[25], &v[26], &v[27], &v[28], &v[29], &v[30], &v[31], &kZero);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-          u[0] = k_packs_epi64(v[0], v[1]);
-          u[1] = k_packs_epi64(v[2], v[3]);
-          u[2] = k_packs_epi64(v[4], v[5]);
-          u[3] = k_packs_epi64(v[6], v[7]);
-          u[4] = k_packs_epi64(v[8], v[9]);
-          u[5] = k_packs_epi64(v[10], v[11]);
-          u[6] = k_packs_epi64(v[12], v[13]);
-          u[7] = k_packs_epi64(v[14], v[15]);
-          u[8] = k_packs_epi64(v[16], v[17]);
-          u[9] = k_packs_epi64(v[18], v[19]);
-          u[10] = k_packs_epi64(v[20], v[21]);
-          u[11] = k_packs_epi64(v[22], v[23]);
-          u[12] = k_packs_epi64(v[24], v[25]);
-          u[13] = k_packs_epi64(v[26], v[27]);
-          u[14] = k_packs_epi64(v[28], v[29]);
-          u[15] = k_packs_epi64(v[30], v[31]);
-
-          v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
-          v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
-          v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
-          v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
-          v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING);
-          v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING);
-          v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING);
-          v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING);
-          v[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING);
-          v[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING);
-          v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING);
-          v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING);
-          v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING);
-          v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING);
-          v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING);
-          v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING);
-
-          u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS);
-          u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS);
-          u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
-          u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
-          u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS);
-          u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS);
-          u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS);
-          u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS);
-          u[8] = _mm_srai_epi32(v[8], DCT_CONST_BITS);
-          u[9] = _mm_srai_epi32(v[9], DCT_CONST_BITS);
-          u[10] = _mm_srai_epi32(v[10], DCT_CONST_BITS);
-          u[11] = _mm_srai_epi32(v[11], DCT_CONST_BITS);
-          u[12] = _mm_srai_epi32(v[12], DCT_CONST_BITS);
-          u[13] = _mm_srai_epi32(v[13], DCT_CONST_BITS);
-          u[14] = _mm_srai_epi32(v[14], DCT_CONST_BITS);
-          u[15] = _mm_srai_epi32(v[15], DCT_CONST_BITS);
-
-          v[0] = _mm_cmplt_epi32(u[0], kZero);
-          v[1] = _mm_cmplt_epi32(u[1], kZero);
-          v[2] = _mm_cmplt_epi32(u[2], kZero);
-          v[3] = _mm_cmplt_epi32(u[3], kZero);
-          v[4] = _mm_cmplt_epi32(u[4], kZero);
-          v[5] = _mm_cmplt_epi32(u[5], kZero);
-          v[6] = _mm_cmplt_epi32(u[6], kZero);
-          v[7] = _mm_cmplt_epi32(u[7], kZero);
-          v[8] = _mm_cmplt_epi32(u[8], kZero);
-          v[9] = _mm_cmplt_epi32(u[9], kZero);
-          v[10] = _mm_cmplt_epi32(u[10], kZero);
-          v[11] = _mm_cmplt_epi32(u[11], kZero);
-          v[12] = _mm_cmplt_epi32(u[12], kZero);
-          v[13] = _mm_cmplt_epi32(u[13], kZero);
-          v[14] = _mm_cmplt_epi32(u[14], kZero);
-          v[15] = _mm_cmplt_epi32(u[15], kZero);
-
-          u[0] = _mm_sub_epi32(u[0], v[0]);
-          u[1] = _mm_sub_epi32(u[1], v[1]);
-          u[2] = _mm_sub_epi32(u[2], v[2]);
-          u[3] = _mm_sub_epi32(u[3], v[3]);
-          u[4] = _mm_sub_epi32(u[4], v[4]);
-          u[5] = _mm_sub_epi32(u[5], v[5]);
-          u[6] = _mm_sub_epi32(u[6], v[6]);
-          u[7] = _mm_sub_epi32(u[7], v[7]);
-          u[8] = _mm_sub_epi32(u[8], v[8]);
-          u[9] = _mm_sub_epi32(u[9], v[9]);
-          u[10] = _mm_sub_epi32(u[10], v[10]);
-          u[11] = _mm_sub_epi32(u[11], v[11]);
-          u[12] = _mm_sub_epi32(u[12], v[12]);
-          u[13] = _mm_sub_epi32(u[13], v[13]);
-          u[14] = _mm_sub_epi32(u[14], v[14]);
-          u[15] = _mm_sub_epi32(u[15], v[15]);
-
-          v[0] = _mm_add_epi32(u[0], K32One);
-          v[1] = _mm_add_epi32(u[1], K32One);
-          v[2] = _mm_add_epi32(u[2], K32One);
-          v[3] = _mm_add_epi32(u[3], K32One);
-          v[4] = _mm_add_epi32(u[4], K32One);
-          v[5] = _mm_add_epi32(u[5], K32One);
-          v[6] = _mm_add_epi32(u[6], K32One);
-          v[7] = _mm_add_epi32(u[7], K32One);
-          v[8] = _mm_add_epi32(u[8], K32One);
-          v[9] = _mm_add_epi32(u[9], K32One);
-          v[10] = _mm_add_epi32(u[10], K32One);
-          v[11] = _mm_add_epi32(u[11], K32One);
-          v[12] = _mm_add_epi32(u[12], K32One);
-          v[13] = _mm_add_epi32(u[13], K32One);
-          v[14] = _mm_add_epi32(u[14], K32One);
-          v[15] = _mm_add_epi32(u[15], K32One);
-
-          u[0] = _mm_srai_epi32(v[0], 2);
-          u[1] = _mm_srai_epi32(v[1], 2);
-          u[2] = _mm_srai_epi32(v[2], 2);
-          u[3] = _mm_srai_epi32(v[3], 2);
-          u[4] = _mm_srai_epi32(v[4], 2);
-          u[5] = _mm_srai_epi32(v[5], 2);
-          u[6] = _mm_srai_epi32(v[6], 2);
-          u[7] = _mm_srai_epi32(v[7], 2);
-          u[8] = _mm_srai_epi32(v[8], 2);
-          u[9] = _mm_srai_epi32(v[9], 2);
-          u[10] = _mm_srai_epi32(v[10], 2);
-          u[11] = _mm_srai_epi32(v[11], 2);
-          u[12] = _mm_srai_epi32(v[12], 2);
-          u[13] = _mm_srai_epi32(v[13], 2);
-          u[14] = _mm_srai_epi32(v[14], 2);
-          u[15] = _mm_srai_epi32(v[15], 2);
-
-          out[2] = _mm_packs_epi32(u[0], u[1]);
-          out[18] = _mm_packs_epi32(u[2], u[3]);
-          out[10] = _mm_packs_epi32(u[4], u[5]);
-          out[26] = _mm_packs_epi32(u[6], u[7]);
-          out[6] = _mm_packs_epi32(u[8], u[9]);
-          out[22] = _mm_packs_epi32(u[10], u[11]);
-          out[14] = _mm_packs_epi32(u[12], u[13]);
-          out[30] = _mm_packs_epi32(u[14], u[15]);
-#if DCT_HIGH_BIT_DEPTH
-          overflow =
-              check_epi16_overflow_x8(&out[2], &out[18], &out[10], &out[26],
-                                      &out[6], &out[22], &out[14], &out[30]);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          lstep1[32] = _mm_add_epi32(lstep3[34], lstep2[32]);
-          lstep1[33] = _mm_add_epi32(lstep3[35], lstep2[33]);
-          lstep1[34] = _mm_sub_epi32(lstep2[32], lstep3[34]);
-          lstep1[35] = _mm_sub_epi32(lstep2[33], lstep3[35]);
-          lstep1[36] = _mm_sub_epi32(lstep2[38], lstep3[36]);
-          lstep1[37] = _mm_sub_epi32(lstep2[39], lstep3[37]);
-          lstep1[38] = _mm_add_epi32(lstep3[36], lstep2[38]);
-          lstep1[39] = _mm_add_epi32(lstep3[37], lstep2[39]);
-          lstep1[40] = _mm_add_epi32(lstep3[42], lstep2[40]);
-          lstep1[41] = _mm_add_epi32(lstep3[43], lstep2[41]);
-          lstep1[42] = _mm_sub_epi32(lstep2[40], lstep3[42]);
-          lstep1[43] = _mm_sub_epi32(lstep2[41], lstep3[43]);
-          lstep1[44] = _mm_sub_epi32(lstep2[46], lstep3[44]);
-          lstep1[45] = _mm_sub_epi32(lstep2[47], lstep3[45]);
-          lstep1[46] = _mm_add_epi32(lstep3[44], lstep2[46]);
-          lstep1[47] = _mm_add_epi32(lstep3[45], lstep2[47]);
-          lstep1[48] = _mm_add_epi32(lstep3[50], lstep2[48]);
-          lstep1[49] = _mm_add_epi32(lstep3[51], lstep2[49]);
-          lstep1[50] = _mm_sub_epi32(lstep2[48], lstep3[50]);
-          lstep1[51] = _mm_sub_epi32(lstep2[49], lstep3[51]);
-          lstep1[52] = _mm_sub_epi32(lstep2[54], lstep3[52]);
-          lstep1[53] = _mm_sub_epi32(lstep2[55], lstep3[53]);
-          lstep1[54] = _mm_add_epi32(lstep3[52], lstep2[54]);
-          lstep1[55] = _mm_add_epi32(lstep3[53], lstep2[55]);
-          lstep1[56] = _mm_add_epi32(lstep3[58], lstep2[56]);
-          lstep1[57] = _mm_add_epi32(lstep3[59], lstep2[57]);
-          lstep1[58] = _mm_sub_epi32(lstep2[56], lstep3[58]);
-          lstep1[59] = _mm_sub_epi32(lstep2[57], lstep3[59]);
-          lstep1[60] = _mm_sub_epi32(lstep2[62], lstep3[60]);
-          lstep1[61] = _mm_sub_epi32(lstep2[63], lstep3[61]);
-          lstep1[62] = _mm_add_epi32(lstep3[60], lstep2[62]);
-          lstep1[63] = _mm_add_epi32(lstep3[61], lstep2[63]);
-        }
-        // stage 8
-        {
-          const __m128i k32_p31_p01 = pair_set_epi32(cospi_31_64, cospi_1_64);
-          const __m128i k32_p15_p17 = pair_set_epi32(cospi_15_64, cospi_17_64);
-          const __m128i k32_p23_p09 = pair_set_epi32(cospi_23_64, cospi_9_64);
-          const __m128i k32_p07_p25 = pair_set_epi32(cospi_7_64, cospi_25_64);
-          const __m128i k32_m25_p07 = pair_set_epi32(-cospi_25_64, cospi_7_64);
-          const __m128i k32_m09_p23 = pair_set_epi32(-cospi_9_64, cospi_23_64);
-          const __m128i k32_m17_p15 = pair_set_epi32(-cospi_17_64, cospi_15_64);
-          const __m128i k32_m01_p31 = pair_set_epi32(-cospi_1_64, cospi_31_64);
-
-          u[0] = _mm_unpacklo_epi32(lstep1[32], lstep1[62]);
-          u[1] = _mm_unpackhi_epi32(lstep1[32], lstep1[62]);
-          u[2] = _mm_unpacklo_epi32(lstep1[33], lstep1[63]);
-          u[3] = _mm_unpackhi_epi32(lstep1[33], lstep1[63]);
-          u[4] = _mm_unpacklo_epi32(lstep1[34], lstep1[60]);
-          u[5] = _mm_unpackhi_epi32(lstep1[34], lstep1[60]);
-          u[6] = _mm_unpacklo_epi32(lstep1[35], lstep1[61]);
-          u[7] = _mm_unpackhi_epi32(lstep1[35], lstep1[61]);
-          u[8] = _mm_unpacklo_epi32(lstep1[36], lstep1[58]);
-          u[9] = _mm_unpackhi_epi32(lstep1[36], lstep1[58]);
-          u[10] = _mm_unpacklo_epi32(lstep1[37], lstep1[59]);
-          u[11] = _mm_unpackhi_epi32(lstep1[37], lstep1[59]);
-          u[12] = _mm_unpacklo_epi32(lstep1[38], lstep1[56]);
-          u[13] = _mm_unpackhi_epi32(lstep1[38], lstep1[56]);
-          u[14] = _mm_unpacklo_epi32(lstep1[39], lstep1[57]);
-          u[15] = _mm_unpackhi_epi32(lstep1[39], lstep1[57]);
-
-          v[0] = k_madd_epi32(u[0], k32_p31_p01);
-          v[1] = k_madd_epi32(u[1], k32_p31_p01);
-          v[2] = k_madd_epi32(u[2], k32_p31_p01);
-          v[3] = k_madd_epi32(u[3], k32_p31_p01);
-          v[4] = k_madd_epi32(u[4], k32_p15_p17);
-          v[5] = k_madd_epi32(u[5], k32_p15_p17);
-          v[6] = k_madd_epi32(u[6], k32_p15_p17);
-          v[7] = k_madd_epi32(u[7], k32_p15_p17);
-          v[8] = k_madd_epi32(u[8], k32_p23_p09);
-          v[9] = k_madd_epi32(u[9], k32_p23_p09);
-          v[10] = k_madd_epi32(u[10], k32_p23_p09);
-          v[11] = k_madd_epi32(u[11], k32_p23_p09);
-          v[12] = k_madd_epi32(u[12], k32_p07_p25);
-          v[13] = k_madd_epi32(u[13], k32_p07_p25);
-          v[14] = k_madd_epi32(u[14], k32_p07_p25);
-          v[15] = k_madd_epi32(u[15], k32_p07_p25);
-          v[16] = k_madd_epi32(u[12], k32_m25_p07);
-          v[17] = k_madd_epi32(u[13], k32_m25_p07);
-          v[18] = k_madd_epi32(u[14], k32_m25_p07);
-          v[19] = k_madd_epi32(u[15], k32_m25_p07);
-          v[20] = k_madd_epi32(u[8], k32_m09_p23);
-          v[21] = k_madd_epi32(u[9], k32_m09_p23);
-          v[22] = k_madd_epi32(u[10], k32_m09_p23);
-          v[23] = k_madd_epi32(u[11], k32_m09_p23);
-          v[24] = k_madd_epi32(u[4], k32_m17_p15);
-          v[25] = k_madd_epi32(u[5], k32_m17_p15);
-          v[26] = k_madd_epi32(u[6], k32_m17_p15);
-          v[27] = k_madd_epi32(u[7], k32_m17_p15);
-          v[28] = k_madd_epi32(u[0], k32_m01_p31);
-          v[29] = k_madd_epi32(u[1], k32_m01_p31);
-          v[30] = k_madd_epi32(u[2], k32_m01_p31);
-          v[31] = k_madd_epi32(u[3], k32_m01_p31);
-
-#if DCT_HIGH_BIT_DEPTH
-          overflow = k_check_epi32_overflow_32(
-              &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], &v[8],
-              &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], &v[16],
-              &v[17], &v[18], &v[19], &v[20], &v[21], &v[22], &v[23], &v[24],
-              &v[25], &v[26], &v[27], &v[28], &v[29], &v[30], &v[31], &kZero);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-          u[0] = k_packs_epi64(v[0], v[1]);
-          u[1] = k_packs_epi64(v[2], v[3]);
-          u[2] = k_packs_epi64(v[4], v[5]);
-          u[3] = k_packs_epi64(v[6], v[7]);
-          u[4] = k_packs_epi64(v[8], v[9]);
-          u[5] = k_packs_epi64(v[10], v[11]);
-          u[6] = k_packs_epi64(v[12], v[13]);
-          u[7] = k_packs_epi64(v[14], v[15]);
-          u[8] = k_packs_epi64(v[16], v[17]);
-          u[9] = k_packs_epi64(v[18], v[19]);
-          u[10] = k_packs_epi64(v[20], v[21]);
-          u[11] = k_packs_epi64(v[22], v[23]);
-          u[12] = k_packs_epi64(v[24], v[25]);
-          u[13] = k_packs_epi64(v[26], v[27]);
-          u[14] = k_packs_epi64(v[28], v[29]);
-          u[15] = k_packs_epi64(v[30], v[31]);
-
-          v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
-          v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
-          v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
-          v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
-          v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING);
-          v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING);
-          v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING);
-          v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING);
-          v[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING);
-          v[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING);
-          v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING);
-          v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING);
-          v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING);
-          v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING);
-          v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING);
-          v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING);
-
-          u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS);
-          u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS);
-          u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
-          u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
-          u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS);
-          u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS);
-          u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS);
-          u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS);
-          u[8] = _mm_srai_epi32(v[8], DCT_CONST_BITS);
-          u[9] = _mm_srai_epi32(v[9], DCT_CONST_BITS);
-          u[10] = _mm_srai_epi32(v[10], DCT_CONST_BITS);
-          u[11] = _mm_srai_epi32(v[11], DCT_CONST_BITS);
-          u[12] = _mm_srai_epi32(v[12], DCT_CONST_BITS);
-          u[13] = _mm_srai_epi32(v[13], DCT_CONST_BITS);
-          u[14] = _mm_srai_epi32(v[14], DCT_CONST_BITS);
-          u[15] = _mm_srai_epi32(v[15], DCT_CONST_BITS);
-
-          v[0] = _mm_cmplt_epi32(u[0], kZero);
-          v[1] = _mm_cmplt_epi32(u[1], kZero);
-          v[2] = _mm_cmplt_epi32(u[2], kZero);
-          v[3] = _mm_cmplt_epi32(u[3], kZero);
-          v[4] = _mm_cmplt_epi32(u[4], kZero);
-          v[5] = _mm_cmplt_epi32(u[5], kZero);
-          v[6] = _mm_cmplt_epi32(u[6], kZero);
-          v[7] = _mm_cmplt_epi32(u[7], kZero);
-          v[8] = _mm_cmplt_epi32(u[8], kZero);
-          v[9] = _mm_cmplt_epi32(u[9], kZero);
-          v[10] = _mm_cmplt_epi32(u[10], kZero);
-          v[11] = _mm_cmplt_epi32(u[11], kZero);
-          v[12] = _mm_cmplt_epi32(u[12], kZero);
-          v[13] = _mm_cmplt_epi32(u[13], kZero);
-          v[14] = _mm_cmplt_epi32(u[14], kZero);
-          v[15] = _mm_cmplt_epi32(u[15], kZero);
-
-          u[0] = _mm_sub_epi32(u[0], v[0]);
-          u[1] = _mm_sub_epi32(u[1], v[1]);
-          u[2] = _mm_sub_epi32(u[2], v[2]);
-          u[3] = _mm_sub_epi32(u[3], v[3]);
-          u[4] = _mm_sub_epi32(u[4], v[4]);
-          u[5] = _mm_sub_epi32(u[5], v[5]);
-          u[6] = _mm_sub_epi32(u[6], v[6]);
-          u[7] = _mm_sub_epi32(u[7], v[7]);
-          u[8] = _mm_sub_epi32(u[8], v[8]);
-          u[9] = _mm_sub_epi32(u[9], v[9]);
-          u[10] = _mm_sub_epi32(u[10], v[10]);
-          u[11] = _mm_sub_epi32(u[11], v[11]);
-          u[12] = _mm_sub_epi32(u[12], v[12]);
-          u[13] = _mm_sub_epi32(u[13], v[13]);
-          u[14] = _mm_sub_epi32(u[14], v[14]);
-          u[15] = _mm_sub_epi32(u[15], v[15]);
-
-          v[0] = _mm_add_epi32(u[0], K32One);
-          v[1] = _mm_add_epi32(u[1], K32One);
-          v[2] = _mm_add_epi32(u[2], K32One);
-          v[3] = _mm_add_epi32(u[3], K32One);
-          v[4] = _mm_add_epi32(u[4], K32One);
-          v[5] = _mm_add_epi32(u[5], K32One);
-          v[6] = _mm_add_epi32(u[6], K32One);
-          v[7] = _mm_add_epi32(u[7], K32One);
-          v[8] = _mm_add_epi32(u[8], K32One);
-          v[9] = _mm_add_epi32(u[9], K32One);
-          v[10] = _mm_add_epi32(u[10], K32One);
-          v[11] = _mm_add_epi32(u[11], K32One);
-          v[12] = _mm_add_epi32(u[12], K32One);
-          v[13] = _mm_add_epi32(u[13], K32One);
-          v[14] = _mm_add_epi32(u[14], K32One);
-          v[15] = _mm_add_epi32(u[15], K32One);
-
-          u[0] = _mm_srai_epi32(v[0], 2);
-          u[1] = _mm_srai_epi32(v[1], 2);
-          u[2] = _mm_srai_epi32(v[2], 2);
-          u[3] = _mm_srai_epi32(v[3], 2);
-          u[4] = _mm_srai_epi32(v[4], 2);
-          u[5] = _mm_srai_epi32(v[5], 2);
-          u[6] = _mm_srai_epi32(v[6], 2);
-          u[7] = _mm_srai_epi32(v[7], 2);
-          u[8] = _mm_srai_epi32(v[8], 2);
-          u[9] = _mm_srai_epi32(v[9], 2);
-          u[10] = _mm_srai_epi32(v[10], 2);
-          u[11] = _mm_srai_epi32(v[11], 2);
-          u[12] = _mm_srai_epi32(v[12], 2);
-          u[13] = _mm_srai_epi32(v[13], 2);
-          u[14] = _mm_srai_epi32(v[14], 2);
-          u[15] = _mm_srai_epi32(v[15], 2);
-
-          out[1] = _mm_packs_epi32(u[0], u[1]);
-          out[17] = _mm_packs_epi32(u[2], u[3]);
-          out[9] = _mm_packs_epi32(u[4], u[5]);
-          out[25] = _mm_packs_epi32(u[6], u[7]);
-          out[7] = _mm_packs_epi32(u[8], u[9]);
-          out[23] = _mm_packs_epi32(u[10], u[11]);
-          out[15] = _mm_packs_epi32(u[12], u[13]);
-          out[31] = _mm_packs_epi32(u[14], u[15]);
-#if DCT_HIGH_BIT_DEPTH
-          overflow =
-              check_epi16_overflow_x8(&out[1], &out[17], &out[9], &out[25],
-                                      &out[7], &out[23], &out[15], &out[31]);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-        {
-          const __m128i k32_p27_p05 = pair_set_epi32(cospi_27_64, cospi_5_64);
-          const __m128i k32_p11_p21 = pair_set_epi32(cospi_11_64, cospi_21_64);
-          const __m128i k32_p19_p13 = pair_set_epi32(cospi_19_64, cospi_13_64);
-          const __m128i k32_p03_p29 = pair_set_epi32(cospi_3_64, cospi_29_64);
-          const __m128i k32_m29_p03 = pair_set_epi32(-cospi_29_64, cospi_3_64);
-          const __m128i k32_m13_p19 = pair_set_epi32(-cospi_13_64, cospi_19_64);
-          const __m128i k32_m21_p11 = pair_set_epi32(-cospi_21_64, cospi_11_64);
-          const __m128i k32_m05_p27 = pair_set_epi32(-cospi_5_64, cospi_27_64);
-
-          u[0] = _mm_unpacklo_epi32(lstep1[40], lstep1[54]);
-          u[1] = _mm_unpackhi_epi32(lstep1[40], lstep1[54]);
-          u[2] = _mm_unpacklo_epi32(lstep1[41], lstep1[55]);
-          u[3] = _mm_unpackhi_epi32(lstep1[41], lstep1[55]);
-          u[4] = _mm_unpacklo_epi32(lstep1[42], lstep1[52]);
-          u[5] = _mm_unpackhi_epi32(lstep1[42], lstep1[52]);
-          u[6] = _mm_unpacklo_epi32(lstep1[43], lstep1[53]);
-          u[7] = _mm_unpackhi_epi32(lstep1[43], lstep1[53]);
-          u[8] = _mm_unpacklo_epi32(lstep1[44], lstep1[50]);
-          u[9] = _mm_unpackhi_epi32(lstep1[44], lstep1[50]);
-          u[10] = _mm_unpacklo_epi32(lstep1[45], lstep1[51]);
-          u[11] = _mm_unpackhi_epi32(lstep1[45], lstep1[51]);
-          u[12] = _mm_unpacklo_epi32(lstep1[46], lstep1[48]);
-          u[13] = _mm_unpackhi_epi32(lstep1[46], lstep1[48]);
-          u[14] = _mm_unpacklo_epi32(lstep1[47], lstep1[49]);
-          u[15] = _mm_unpackhi_epi32(lstep1[47], lstep1[49]);
-
-          v[0] = k_madd_epi32(u[0], k32_p27_p05);
-          v[1] = k_madd_epi32(u[1], k32_p27_p05);
-          v[2] = k_madd_epi32(u[2], k32_p27_p05);
-          v[3] = k_madd_epi32(u[3], k32_p27_p05);
-          v[4] = k_madd_epi32(u[4], k32_p11_p21);
-          v[5] = k_madd_epi32(u[5], k32_p11_p21);
-          v[6] = k_madd_epi32(u[6], k32_p11_p21);
-          v[7] = k_madd_epi32(u[7], k32_p11_p21);
-          v[8] = k_madd_epi32(u[8], k32_p19_p13);
-          v[9] = k_madd_epi32(u[9], k32_p19_p13);
-          v[10] = k_madd_epi32(u[10], k32_p19_p13);
-          v[11] = k_madd_epi32(u[11], k32_p19_p13);
-          v[12] = k_madd_epi32(u[12], k32_p03_p29);
-          v[13] = k_madd_epi32(u[13], k32_p03_p29);
-          v[14] = k_madd_epi32(u[14], k32_p03_p29);
-          v[15] = k_madd_epi32(u[15], k32_p03_p29);
-          v[16] = k_madd_epi32(u[12], k32_m29_p03);
-          v[17] = k_madd_epi32(u[13], k32_m29_p03);
-          v[18] = k_madd_epi32(u[14], k32_m29_p03);
-          v[19] = k_madd_epi32(u[15], k32_m29_p03);
-          v[20] = k_madd_epi32(u[8], k32_m13_p19);
-          v[21] = k_madd_epi32(u[9], k32_m13_p19);
-          v[22] = k_madd_epi32(u[10], k32_m13_p19);
-          v[23] = k_madd_epi32(u[11], k32_m13_p19);
-          v[24] = k_madd_epi32(u[4], k32_m21_p11);
-          v[25] = k_madd_epi32(u[5], k32_m21_p11);
-          v[26] = k_madd_epi32(u[6], k32_m21_p11);
-          v[27] = k_madd_epi32(u[7], k32_m21_p11);
-          v[28] = k_madd_epi32(u[0], k32_m05_p27);
-          v[29] = k_madd_epi32(u[1], k32_m05_p27);
-          v[30] = k_madd_epi32(u[2], k32_m05_p27);
-          v[31] = k_madd_epi32(u[3], k32_m05_p27);
-
-#if DCT_HIGH_BIT_DEPTH
-          overflow = k_check_epi32_overflow_32(
-              &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], &v[8],
-              &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15], &v[16],
-              &v[17], &v[18], &v[19], &v[20], &v[21], &v[22], &v[23], &v[24],
-              &v[25], &v[26], &v[27], &v[28], &v[29], &v[30], &v[31], &kZero);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-          u[0] = k_packs_epi64(v[0], v[1]);
-          u[1] = k_packs_epi64(v[2], v[3]);
-          u[2] = k_packs_epi64(v[4], v[5]);
-          u[3] = k_packs_epi64(v[6], v[7]);
-          u[4] = k_packs_epi64(v[8], v[9]);
-          u[5] = k_packs_epi64(v[10], v[11]);
-          u[6] = k_packs_epi64(v[12], v[13]);
-          u[7] = k_packs_epi64(v[14], v[15]);
-          u[8] = k_packs_epi64(v[16], v[17]);
-          u[9] = k_packs_epi64(v[18], v[19]);
-          u[10] = k_packs_epi64(v[20], v[21]);
-          u[11] = k_packs_epi64(v[22], v[23]);
-          u[12] = k_packs_epi64(v[24], v[25]);
-          u[13] = k_packs_epi64(v[26], v[27]);
-          u[14] = k_packs_epi64(v[28], v[29]);
-          u[15] = k_packs_epi64(v[30], v[31]);
-
-          v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
-          v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
-          v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
-          v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
-          v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING);
-          v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING);
-          v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING);
-          v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING);
-          v[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING);
-          v[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING);
-          v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING);
-          v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING);
-          v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING);
-          v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING);
-          v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING);
-          v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING);
-
-          u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS);
-          u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS);
-          u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
-          u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
-          u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS);
-          u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS);
-          u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS);
-          u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS);
-          u[8] = _mm_srai_epi32(v[8], DCT_CONST_BITS);
-          u[9] = _mm_srai_epi32(v[9], DCT_CONST_BITS);
-          u[10] = _mm_srai_epi32(v[10], DCT_CONST_BITS);
-          u[11] = _mm_srai_epi32(v[11], DCT_CONST_BITS);
-          u[12] = _mm_srai_epi32(v[12], DCT_CONST_BITS);
-          u[13] = _mm_srai_epi32(v[13], DCT_CONST_BITS);
-          u[14] = _mm_srai_epi32(v[14], DCT_CONST_BITS);
-          u[15] = _mm_srai_epi32(v[15], DCT_CONST_BITS);
-
-          v[0] = _mm_cmplt_epi32(u[0], kZero);
-          v[1] = _mm_cmplt_epi32(u[1], kZero);
-          v[2] = _mm_cmplt_epi32(u[2], kZero);
-          v[3] = _mm_cmplt_epi32(u[3], kZero);
-          v[4] = _mm_cmplt_epi32(u[4], kZero);
-          v[5] = _mm_cmplt_epi32(u[5], kZero);
-          v[6] = _mm_cmplt_epi32(u[6], kZero);
-          v[7] = _mm_cmplt_epi32(u[7], kZero);
-          v[8] = _mm_cmplt_epi32(u[8], kZero);
-          v[9] = _mm_cmplt_epi32(u[9], kZero);
-          v[10] = _mm_cmplt_epi32(u[10], kZero);
-          v[11] = _mm_cmplt_epi32(u[11], kZero);
-          v[12] = _mm_cmplt_epi32(u[12], kZero);
-          v[13] = _mm_cmplt_epi32(u[13], kZero);
-          v[14] = _mm_cmplt_epi32(u[14], kZero);
-          v[15] = _mm_cmplt_epi32(u[15], kZero);
-
-          u[0] = _mm_sub_epi32(u[0], v[0]);
-          u[1] = _mm_sub_epi32(u[1], v[1]);
-          u[2] = _mm_sub_epi32(u[2], v[2]);
-          u[3] = _mm_sub_epi32(u[3], v[3]);
-          u[4] = _mm_sub_epi32(u[4], v[4]);
-          u[5] = _mm_sub_epi32(u[5], v[5]);
-          u[6] = _mm_sub_epi32(u[6], v[6]);
-          u[7] = _mm_sub_epi32(u[7], v[7]);
-          u[8] = _mm_sub_epi32(u[8], v[8]);
-          u[9] = _mm_sub_epi32(u[9], v[9]);
-          u[10] = _mm_sub_epi32(u[10], v[10]);
-          u[11] = _mm_sub_epi32(u[11], v[11]);
-          u[12] = _mm_sub_epi32(u[12], v[12]);
-          u[13] = _mm_sub_epi32(u[13], v[13]);
-          u[14] = _mm_sub_epi32(u[14], v[14]);
-          u[15] = _mm_sub_epi32(u[15], v[15]);
-
-          v[0] = _mm_add_epi32(u[0], K32One);
-          v[1] = _mm_add_epi32(u[1], K32One);
-          v[2] = _mm_add_epi32(u[2], K32One);
-          v[3] = _mm_add_epi32(u[3], K32One);
-          v[4] = _mm_add_epi32(u[4], K32One);
-          v[5] = _mm_add_epi32(u[5], K32One);
-          v[6] = _mm_add_epi32(u[6], K32One);
-          v[7] = _mm_add_epi32(u[7], K32One);
-          v[8] = _mm_add_epi32(u[8], K32One);
-          v[9] = _mm_add_epi32(u[9], K32One);
-          v[10] = _mm_add_epi32(u[10], K32One);
-          v[11] = _mm_add_epi32(u[11], K32One);
-          v[12] = _mm_add_epi32(u[12], K32One);
-          v[13] = _mm_add_epi32(u[13], K32One);
-          v[14] = _mm_add_epi32(u[14], K32One);
-          v[15] = _mm_add_epi32(u[15], K32One);
-
-          u[0] = _mm_srai_epi32(v[0], 2);
-          u[1] = _mm_srai_epi32(v[1], 2);
-          u[2] = _mm_srai_epi32(v[2], 2);
-          u[3] = _mm_srai_epi32(v[3], 2);
-          u[4] = _mm_srai_epi32(v[4], 2);
-          u[5] = _mm_srai_epi32(v[5], 2);
-          u[6] = _mm_srai_epi32(v[6], 2);
-          u[7] = _mm_srai_epi32(v[7], 2);
-          u[8] = _mm_srai_epi32(v[8], 2);
-          u[9] = _mm_srai_epi32(v[9], 2);
-          u[10] = _mm_srai_epi32(v[10], 2);
-          u[11] = _mm_srai_epi32(v[11], 2);
-          u[12] = _mm_srai_epi32(v[12], 2);
-          u[13] = _mm_srai_epi32(v[13], 2);
-          u[14] = _mm_srai_epi32(v[14], 2);
-          u[15] = _mm_srai_epi32(v[15], 2);
-
-          out[5] = _mm_packs_epi32(u[0], u[1]);
-          out[21] = _mm_packs_epi32(u[2], u[3]);
-          out[13] = _mm_packs_epi32(u[4], u[5]);
-          out[29] = _mm_packs_epi32(u[6], u[7]);
-          out[3] = _mm_packs_epi32(u[8], u[9]);
-          out[19] = _mm_packs_epi32(u[10], u[11]);
-          out[11] = _mm_packs_epi32(u[12], u[13]);
-          out[27] = _mm_packs_epi32(u[14], u[15]);
-#if DCT_HIGH_BIT_DEPTH
-          overflow =
-              check_epi16_overflow_x8(&out[5], &out[21], &out[13], &out[29],
-                                      &out[3], &out[19], &out[11], &out[27]);
-          if (overflow) {
-            HIGH_FDCT32x32_2D_ROWS_C(intermediate, output_org);
-            return;
-          }
-#endif  // DCT_HIGH_BIT_DEPTH
-        }
-      }
-#endif  // FDCT32x32_HIGH_PRECISION
-      // Transpose the results, do it as four 8x8 transposes.
-      {
-        int transpose_block;
-        int16_t *output0 = &intermediate[column_start * 32];
-        tran_low_t *output1 = &output_org[column_start * 32];
-        for (transpose_block = 0; transpose_block < 4; ++transpose_block) {
-          __m128i *this_out = &out[8 * transpose_block];
-          // 00 01 02 03 04 05 06 07
-          // 10 11 12 13 14 15 16 17
-          // 20 21 22 23 24 25 26 27
-          // 30 31 32 33 34 35 36 37
-          // 40 41 42 43 44 45 46 47
-          // 50 51 52 53 54 55 56 57
-          // 60 61 62 63 64 65 66 67
-          // 70 71 72 73 74 75 76 77
-          const __m128i tr0_0 = _mm_unpacklo_epi16(this_out[0], this_out[1]);
-          const __m128i tr0_1 = _mm_unpacklo_epi16(this_out[2], this_out[3]);
-          const __m128i tr0_2 = _mm_unpackhi_epi16(this_out[0], this_out[1]);
-          const __m128i tr0_3 = _mm_unpackhi_epi16(this_out[2], this_out[3]);
-          const __m128i tr0_4 = _mm_unpacklo_epi16(this_out[4], this_out[5]);
-          const __m128i tr0_5 = _mm_unpacklo_epi16(this_out[6], this_out[7]);
-          const __m128i tr0_6 = _mm_unpackhi_epi16(this_out[4], this_out[5]);
-          const __m128i tr0_7 = _mm_unpackhi_epi16(this_out[6], this_out[7]);
-          // 00 10 01 11 02 12 03 13
-          // 20 30 21 31 22 32 23 33
-          // 04 14 05 15 06 16 07 17
-          // 24 34 25 35 26 36 27 37
-          // 40 50 41 51 42 52 43 53
-          // 60 70 61 71 62 72 63 73
-          // 54 54 55 55 56 56 57 57
-          // 64 74 65 75 66 76 67 77
-          const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1);
-          const __m128i tr1_1 = _mm_unpacklo_epi32(tr0_2, tr0_3);
-          const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1);
-          const __m128i tr1_3 = _mm_unpackhi_epi32(tr0_2, tr0_3);
-          const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5);
-          const __m128i tr1_5 = _mm_unpacklo_epi32(tr0_6, tr0_7);
-          const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5);
-          const __m128i tr1_7 = _mm_unpackhi_epi32(tr0_6, tr0_7);
-          // 00 10 20 30 01 11 21 31
-          // 40 50 60 70 41 51 61 71
-          // 02 12 22 32 03 13 23 33
-          // 42 52 62 72 43 53 63 73
-          // 04 14 24 34 05 15 21 36
-          // 44 54 64 74 45 55 61 76
-          // 06 16 26 36 07 17 27 37
-          // 46 56 66 76 47 57 67 77
-          __m128i tr2_0 = _mm_unpacklo_epi64(tr1_0, tr1_4);
-          __m128i tr2_1 = _mm_unpackhi_epi64(tr1_0, tr1_4);
-          __m128i tr2_2 = _mm_unpacklo_epi64(tr1_2, tr1_6);
-          __m128i tr2_3 = _mm_unpackhi_epi64(tr1_2, tr1_6);
-          __m128i tr2_4 = _mm_unpacklo_epi64(tr1_1, tr1_5);
-          __m128i tr2_5 = _mm_unpackhi_epi64(tr1_1, tr1_5);
-          __m128i tr2_6 = _mm_unpacklo_epi64(tr1_3, tr1_7);
-          __m128i tr2_7 = _mm_unpackhi_epi64(tr1_3, tr1_7);
-          // 00 10 20 30 40 50 60 70
-          // 01 11 21 31 41 51 61 71
-          // 02 12 22 32 42 52 62 72
-          // 03 13 23 33 43 53 63 73
-          // 04 14 24 34 44 54 64 74
-          // 05 15 25 35 45 55 65 75
-          // 06 16 26 36 46 56 66 76
-          // 07 17 27 37 47 57 67 77
-          if (0 == pass) {
-            // output[j] = (output[j] + 1 + (output[j] > 0)) >> 2;
-            // TODO(cd): see quality impact of only doing
-            //           output[j] = (output[j] + 1) >> 2;
-            //           which would remove the code between here ...
-            __m128i tr2_0_0 = _mm_cmpgt_epi16(tr2_0, kZero);
-            __m128i tr2_1_0 = _mm_cmpgt_epi16(tr2_1, kZero);
-            __m128i tr2_2_0 = _mm_cmpgt_epi16(tr2_2, kZero);
-            __m128i tr2_3_0 = _mm_cmpgt_epi16(tr2_3, kZero);
-            __m128i tr2_4_0 = _mm_cmpgt_epi16(tr2_4, kZero);
-            __m128i tr2_5_0 = _mm_cmpgt_epi16(tr2_5, kZero);
-            __m128i tr2_6_0 = _mm_cmpgt_epi16(tr2_6, kZero);
-            __m128i tr2_7_0 = _mm_cmpgt_epi16(tr2_7, kZero);
-            tr2_0 = _mm_sub_epi16(tr2_0, tr2_0_0);
-            tr2_1 = _mm_sub_epi16(tr2_1, tr2_1_0);
-            tr2_2 = _mm_sub_epi16(tr2_2, tr2_2_0);
-            tr2_3 = _mm_sub_epi16(tr2_3, tr2_3_0);
-            tr2_4 = _mm_sub_epi16(tr2_4, tr2_4_0);
-            tr2_5 = _mm_sub_epi16(tr2_5, tr2_5_0);
-            tr2_6 = _mm_sub_epi16(tr2_6, tr2_6_0);
-            tr2_7 = _mm_sub_epi16(tr2_7, tr2_7_0);
-            //           ... and here.
-            //           PS: also change code in vp10/encoder/dct.c
-            tr2_0 = _mm_add_epi16(tr2_0, kOne);
-            tr2_1 = _mm_add_epi16(tr2_1, kOne);
-            tr2_2 = _mm_add_epi16(tr2_2, kOne);
-            tr2_3 = _mm_add_epi16(tr2_3, kOne);
-            tr2_4 = _mm_add_epi16(tr2_4, kOne);
-            tr2_5 = _mm_add_epi16(tr2_5, kOne);
-            tr2_6 = _mm_add_epi16(tr2_6, kOne);
-            tr2_7 = _mm_add_epi16(tr2_7, kOne);
-            tr2_0 = _mm_srai_epi16(tr2_0, 2);
-            tr2_1 = _mm_srai_epi16(tr2_1, 2);
-            tr2_2 = _mm_srai_epi16(tr2_2, 2);
-            tr2_3 = _mm_srai_epi16(tr2_3, 2);
-            tr2_4 = _mm_srai_epi16(tr2_4, 2);
-            tr2_5 = _mm_srai_epi16(tr2_5, 2);
-            tr2_6 = _mm_srai_epi16(tr2_6, 2);
-            tr2_7 = _mm_srai_epi16(tr2_7, 2);
-          }
-          // Note: even though all these stores are aligned, using the aligned
-          //       intrinsic make the code slightly slower.
-          if (pass == 0) {
-            _mm_storeu_si128((__m128i *)(output0 + 0 * 32), tr2_0);
-            _mm_storeu_si128((__m128i *)(output0 + 1 * 32), tr2_1);
-            _mm_storeu_si128((__m128i *)(output0 + 2 * 32), tr2_2);
-            _mm_storeu_si128((__m128i *)(output0 + 3 * 32), tr2_3);
-            _mm_storeu_si128((__m128i *)(output0 + 4 * 32), tr2_4);
-            _mm_storeu_si128((__m128i *)(output0 + 5 * 32), tr2_5);
-            _mm_storeu_si128((__m128i *)(output0 + 6 * 32), tr2_6);
-            _mm_storeu_si128((__m128i *)(output0 + 7 * 32), tr2_7);
-            // Process next 8x8
-            output0 += 8;
-          } else {
-            storeu_output(&tr2_0, (output1 + 0 * 32));
-            storeu_output(&tr2_1, (output1 + 1 * 32));
-            storeu_output(&tr2_2, (output1 + 2 * 32));
-            storeu_output(&tr2_3, (output1 + 3 * 32));
-            storeu_output(&tr2_4, (output1 + 4 * 32));
-            storeu_output(&tr2_5, (output1 + 5 * 32));
-            storeu_output(&tr2_6, (output1 + 6 * 32));
-            storeu_output(&tr2_7, (output1 + 7 * 32));
-            // Process next 8x8
-            output1 += 8;
-          }
-        }
-      }
-    }
-  }
-}  // NOLINT
-
-#undef ADD_EPI16
-#undef SUB_EPI16
-#undef HIGH_FDCT32x32_2D_C
-#undef HIGH_FDCT32x32_2D_ROWS_C
diff --git a/vpxdec.c b/vpxdec.c
index cd6d7ed..5650049 100644
--- a/vpxdec.c
+++ b/vpxdec.c
@@ -24,12 +24,12 @@
 #include "./args.h"
 #include "./ivfdec.h"
 
-#include "vpx/vpx_decoder.h"
-#include "vpx_ports/mem_ops.h"
-#include "vpx_ports/vpx_timer.h"
+#include "aom/vpx_decoder.h"
+#include "aom_ports/mem_ops.h"
+#include "aom_ports/vpx_timer.h"
 
 #if CONFIG_VP10_DECODER
-#include "vpx/vp8dx.h"
+#include "aom/vp8dx.h"
 #endif
 
 #include "./md5_utils.h"
@@ -344,7 +344,7 @@
   struct ExternalFrameBuffer *ext_fb;
 };
 
-// Callback used by libvpx to request an external frame buffer. |cb_priv|
+// Callback used by libaom to request an external frame buffer. |cb_priv|
 // Application private data passed into the set function. |min_size| is the
 // minimum size in bytes needed to decode the next frame. |fb| pointer to the
 // frame buffer.
@@ -379,7 +379,7 @@
   return 0;
 }
 
-// Callback used by libvpx when there are no references to the frame buffer.
+// Callback used by libaom when there are no references to the frame buffer.
 // |cb_priv| user private data passed into the set function. |fb| pointer
 // to the frame buffer.
 static int release_vp9_frame_buffer(void *cb_priv,
diff --git a/vpxenc.c b/vpxenc.c
index c4d4296..32cb12f 100644
--- a/vpxenc.c
+++ b/vpxenc.c
@@ -23,9 +23,9 @@
 #include "third_party/libyuv/include/libyuv/scale.h"
 #endif
 
-#include "vpx/vpx_encoder.h"
+#include "aom/vpx_encoder.h"
 #if CONFIG_DECODERS
-#include "vpx/vpx_decoder.h"
+#include "aom/vpx_decoder.h"
 #endif
 
 #include "./args.h"
@@ -33,15 +33,15 @@
 #include "./tools_common.h"
 
 #if CONFIG_VP10_ENCODER
-#include "vpx/vp8cx.h"
+#include "aom/vp8cx.h"
 #endif
 #if CONFIG_VP10_DECODER
-#include "vpx/vp8dx.h"
+#include "aom/vp8dx.h"
 #endif
 
-#include "vpx/vpx_integer.h"
-#include "vpx_ports/mem_ops.h"
-#include "vpx_ports/vpx_timer.h"
+#include "aom/vpx_integer.h"
+#include "aom_ports/mem_ops.h"
+#include "aom_ports/vpx_timer.h"
 #include "./rate_hist.h"
 #include "./vpxstats.h"
 #include "./warnings.h"
@@ -432,11 +432,6 @@
 
 static const arg_def_t tune_content = ARG_DEF_ENUM(
     NULL, "tune-content", 1, "Tune content type", tune_content_enum);
-
-static const arg_def_t target_level = ARG_DEF(
-    NULL, "target-level", 1,
-    "Target level (255: off (default); 0: only keep level stats; 10: level 1.0;"
-    " 11: level 1.1; ... 62: level 6.2)");
 #endif
 
 #if CONFIG_VP10_ENCODER
diff --git a/vpxenc.h b/vpxenc.h
index d867e9d..eee00d0 100644
--- a/vpxenc.h
+++ b/vpxenc.h
@@ -10,7 +10,7 @@
 #ifndef VPXENC_H_
 #define VPXENC_H_
 
-#include "vpx/vpx_encoder.h"
+#include "aom/vpx_encoder.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/vpxstats.h b/vpxstats.h
index 5c9ea34..0ea7ce4 100644
--- a/vpxstats.h
+++ b/vpxstats.h
@@ -13,7 +13,7 @@
 
 #include <stdio.h>
 
-#include "vpx/vpx_encoder.h"
+#include "aom/vpx_encoder.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/warnings.c b/warnings.c
index a3e4926..eea6abc 100644
--- a/warnings.c
+++ b/warnings.c
@@ -15,7 +15,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "vpx/vpx_encoder.h"
+#include "aom/vpx_encoder.h"
 
 #include "./tools_common.h"
 #include "./vpxenc.h"
diff --git a/webmenc.h b/webmenc.h
index 1ae7786..df46a78 100644
--- a/webmenc.h
+++ b/webmenc.h
@@ -14,7 +14,7 @@
 #include <stdlib.h>
 
 #include "tools_common.h"
-#include "vpx/vpx_encoder.h"
+#include "aom/vpx_encoder.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/y4menc.h b/y4menc.h
index 69d5904..bd92e02 100644
--- a/y4menc.h
+++ b/y4menc.h
@@ -13,7 +13,7 @@
 
 #include "./tools_common.h"
 
-#include "vpx/vpx_decoder.h"
+#include "aom/vpx_decoder.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/y4minput.c b/y4minput.c
index 7de859f..0a923c1 100644
--- a/y4minput.c
+++ b/y4minput.c
@@ -14,7 +14,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "vpx/vpx_integer.h"
+#include "aom/vpx_integer.h"
 #include "y4minput.h"
 
 // Reads 'size' bytes from 'file' into 'buf' with some fault tolerance.
@@ -1101,7 +1101,7 @@
     We don't use vpx_img_wrap() because it forces padding for odd picture
      sizes, which would require a separate fread call for every row.*/
   memset(_img, 0, sizeof(*_img));
-  /*Y4M has the planes in Y'CbCr order, which libvpx calls Y, U, and V.*/
+  /*Y4M has the planes in Y'CbCr order, which libaom calls Y, U, and V.*/
   _img->fmt = _y4m->vpx_fmt;
   _img->w = _img->d_w = _y4m->pic_w;
   _img->h = _img->d_h = _y4m->pic_h;
diff --git a/y4minput.h b/y4minput.h
index 9e69ceb..2037449 100644
--- a/y4minput.h
+++ b/y4minput.h
@@ -15,7 +15,7 @@
 #define Y4MINPUT_H_
 
 #include <stdio.h>
-#include "vpx/vpx_image.h"
+#include "aom/vpx_image.h"
 
 #ifdef __cplusplus
 extern "C" {