Remove the use of macro "CONFIG_HIGHBITDEPTH"

Change-Id: I523d9a89493895eb6a7af1df30a39f36ca9f159f
diff --git a/aom_dsp/aom_convolve.c b/aom_dsp/aom_convolve.c
index 0684685..c99b191 100644
--- a/aom_dsp/aom_convolve.c
+++ b/aom_dsp/aom_convolve.c
@@ -548,7 +548,6 @@
                       filter_y, y_step_q4, w, h);
 }
 
-#if CONFIG_HIGHBITDEPTH || CONFIG_LOOP_RESTORATION
 static INLINE int highbd_vert_scalar_product(const uint16_t *a,
                                              ptrdiff_t a_stride,
                                              const int16_t *b) {
@@ -556,7 +555,6 @@
   for (int k = 0; k < SUBPEL_TAPS; ++k) sum += a[k * a_stride] * b[k];
   return sum;
 }
-#endif
 
 // TODO(afergs): Make sure this works too
 #if CONFIG_LOOP_RESTORATION
@@ -790,9 +788,6 @@
 }
 #endif  // CONFIG_LOOP_RESTORATION
 
-// TODO(afergs): Make sure this works too
-#if CONFIG_HIGHBITDEPTH
-
 static INLINE int highbd_horz_scalar_product(const uint16_t *a,
                                              const int16_t *b) {
   int sum = 0;
@@ -1258,6 +1253,4 @@
                               x0_q4, x_step_q4, filters_y, y0_q4, y_step_q4, w,
                               h, bd);
 }
-
 #endif  // CONFIG_LOOP_RESTORATION
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/aom_convolve.h b/aom_dsp/aom_convolve.h
index c7943dc..c81557e 100644
--- a/aom_dsp/aom_convolve.h
+++ b/aom_dsp/aom_convolve.h
@@ -47,13 +47,11 @@
                               const int16_t *filter_y, int y_step_q4, int w,
                               int h);
 
-#if CONFIG_HIGHBITDEPTH
 typedef void (*highbd_convolve_fn_t)(const uint8_t *src, ptrdiff_t src_stride,
                                      uint8_t *dst, ptrdiff_t dst_stride,
                                      const int16_t *filter_x, int x_step_q4,
                                      const int16_t *filter_y, int y_step_q4,
                                      int w, int h, int bd);
-#endif
 
 #ifdef __cplusplus
 }  // extern "C"
diff --git a/aom_dsp/aom_dsp.cmake b/aom_dsp/aom_dsp.cmake
index 1f0e172..0b9926e 100644
--- a/aom_dsp/aom_dsp.cmake
+++ b/aom_dsp/aom_dsp.cmake
@@ -238,7 +238,6 @@
       "${AOM_ROOT}/aom_dsp/mips/loopfilter_msa.h")
 endif ()
 
-if (CONFIG_HIGHBITDEPTH)
   set(AOM_DSP_COMMON_ASM_SSE2
       ${AOM_DSP_COMMON_ASM_SSE2}
       "${AOM_ROOT}/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm"
@@ -259,15 +258,6 @@
       "${AOM_ROOT}/aom_dsp/x86/highbd_convolve_avx2.c"
       "${AOM_ROOT}/aom_dsp/x86/highbd_intrapred_avx2.c"
       "${AOM_ROOT}/aom_dsp/x86/highbd_loopfilter_avx2.c")
-else ()
-  set(AOM_DSP_COMMON_INTRIN_DSPR2
-      ${AOM_DSP_COMMON_INTRIN_DSPR2}
-      "${AOM_ROOT}/aom_dsp/mips/itrans16_dspr2.c"
-      "${AOM_ROOT}/aom_dsp/mips/itrans32_cols_dspr2.c"
-      "${AOM_ROOT}/aom_dsp/mips/itrans32_dspr2.c"
-      "${AOM_ROOT}/aom_dsp/mips/itrans4_dspr2.c"
-      "${AOM_ROOT}/aom_dsp/mips/itrans8_dspr2.c")
-endif ()
 
 set(AOM_DSP_COMMON_SOURCES
     ${AOM_DSP_COMMON_SOURCES}
@@ -395,14 +385,11 @@
           "${AOM_ROOT}/aom_dsp/x86/masked_sad_intrin_ssse3.c"
           "${AOM_ROOT}/aom_dsp/x86/masked_variance_intrin_ssse3.c")
 
-    if (CONFIG_HIGHBITDEPTH)
       set(AOM_DSP_ENCODER_INTRIN_SSE2
           ${AOM_DSP_ENCODER_INTRIN_SSE2}
           "${AOM_ROOT}/aom_dsp/x86/highbd_subtract_sse2.c")
-    endif ()
   endif ()
 
-  if (CONFIG_HIGHBITDEPTH)
     set(AOM_DSP_ENCODER_ASM_SSE2
         ${AOM_DSP_ENCODER_ASM_SSE2}
         "${AOM_ROOT}/aom_dsp/x86/highbd_sad4d_sse2.asm"
@@ -421,7 +408,6 @@
     set(AOM_DSP_ENCODER_INTRIN_AVX2
         ${AOM_DSP_ENCODER_INTRIN_AVX2}
         "${AOM_ROOT}/aom_dsp/x86/sad_highbd_avx2.c")
-  endif ()
 
   set(AOM_DSP_ENCODER_SOURCES
       ${AOM_DSP_ENCODER_SOURCES}
@@ -445,11 +431,9 @@
       ${AOM_DSP_COMMON_INTRIN_SSE2}
       "${AOM_ROOT}/aom_dsp/x86/aom_convolve_hip_sse2.c")
 
-  if (CONFIG_HIGHBITDEPTH)
     set(AOM_DSP_COMMON_INTRIN_SSSE3
       ${AOM_DSP_COMMON_INTRIN_SSSE3}
         "${AOM_ROOT}/aom_dsp/x86/aom_highbd_convolve_hip_ssse3.c")
-  endif ()
 endif ()
 
 set(AOM_DSP_ENCODER_INTRIN_SSE4_1
diff --git a/aom_dsp/aom_dsp.mk b/aom_dsp/aom_dsp.mk
index a501a3a..09d9a8c 100644
--- a/aom_dsp/aom_dsp.mk
+++ b/aom_dsp/aom_dsp.mk
@@ -67,13 +67,11 @@
 DSP_SRCS-$(HAVE_SSSE3) += x86/intrapred_ssse3.c
 DSP_SRCS-$(HAVE_AVX2) += x86/intrapred_avx2.c
 
-ifeq ($(CONFIG_HIGHBITDEPTH),yes)
 DSP_SRCS-$(HAVE_SSE)  += x86/highbd_intrapred_sse2.asm
 DSP_SRCS-$(HAVE_SSE2) += x86/highbd_intrapred_sse2.asm
 DSP_SRCS-$(HAVE_SSE2) += x86/highbd_intrapred_sse2.c
 DSP_SRCS-$(HAVE_SSSE3) += x86/highbd_intrapred_ssse3.c
 DSP_SRCS-$(HAVE_AVX2) += x86/highbd_intrapred_avx2.c
-endif  # CONFIG_HIGHBITDEPTH
 
 DSP_SRCS-$(HAVE_NEON_ASM) += arm/intrapred_neon_asm$(ASM)
 DSP_SRCS-$(HAVE_NEON) += arm/intrapred_neon.c
@@ -112,11 +110,9 @@
 DSP_SRCS-$(HAVE_SSSE3) += x86/aom_subpixel_bilinear_ssse3.asm
 DSP_SRCS-$(HAVE_AVX2)  += x86/aom_subpixel_8t_intrin_avx2.c
 DSP_SRCS-$(HAVE_SSSE3) += x86/aom_subpixel_8t_intrin_ssse3.c
-ifeq ($(CONFIG_HIGHBITDEPTH),yes)
 DSP_SRCS-$(HAVE_SSE2)  += x86/aom_high_subpixel_8t_sse2.asm
 DSP_SRCS-$(HAVE_SSE2)  += x86/aom_high_subpixel_bilinear_sse2.asm
 DSP_SRCS-$(HAVE_AVX2)  += x86/highbd_convolve_avx2.c
-endif
 DSP_SRCS-$(HAVE_SSE2)  += x86/aom_convolve_copy_sse2.asm
 
 ifneq ($(CONFIG_EXT_PARTITION),yes)
@@ -197,10 +193,8 @@
 DSP_SRCS-$(HAVE_DSPR2)  += mips/loopfilter_mb_vert_dspr2.c
 endif  # !CONFIG_PARALLEL_DEBLOCKING
 
-ifeq ($(CONFIG_HIGHBITDEPTH),yes)
 DSP_SRCS-$(HAVE_SSE2)   += x86/highbd_loopfilter_sse2.c
 DSP_SRCS-$(HAVE_AVX2)   += x86/highbd_loopfilter_avx2.c
-endif  # CONFIG_HIGHBITDEPTH
 
 DSP_SRCS-yes            += txfm_common.h
 DSP_SRCS-yes            += x86/txfm_common_intrin.h
@@ -275,20 +269,16 @@
 DSP_SRCS-$(HAVE_MSA)   += mips/idct16x16_msa.c
 DSP_SRCS-$(HAVE_MSA)   += mips/idct32x32_msa.c
 
-ifneq ($(CONFIG_HIGHBITDEPTH),yes)
 DSP_SRCS-$(HAVE_DSPR2) += mips/inv_txfm_dspr2.h
 DSP_SRCS-$(HAVE_DSPR2) += mips/itrans4_dspr2.c
 DSP_SRCS-$(HAVE_DSPR2) += mips/itrans8_dspr2.c
 DSP_SRCS-$(HAVE_DSPR2) += mips/itrans16_dspr2.c
 DSP_SRCS-$(HAVE_DSPR2) += mips/itrans32_dspr2.c
 DSP_SRCS-$(HAVE_DSPR2) += mips/itrans32_cols_dspr2.c
-endif  # CONFIG_HIGHBITDEPTH
 
 ifeq ($(CONFIG_LOOP_RESTORATION),yes)
 DSP_SRCS-$(HAVE_SSE2)   += x86/aom_convolve_hip_sse2.c
-ifeq ($(CONFIG_HIGHBITDEPTH),yes)
 DSP_SRCS-$(HAVE_SSSE3)  += x86/aom_highbd_convolve_hip_ssse3.c
-endif
 endif  # CONFIG_LOOP_RESTORATION
 endif  # CONFIG_AV1
 
@@ -317,9 +307,7 @@
 endif
 
 # high bit depth subtract
-ifeq ($(CONFIG_HIGHBITDEPTH),yes)
 DSP_SRCS-$(HAVE_SSE2)  += x86/highbd_subtract_sse2.c
-endif
 
 endif  # CONFIG_AV1_ENCODER
 
@@ -346,10 +334,7 @@
 DSP_SRCS-$(HAVE_SSE4_1) += x86/sad_sse4.asm
 DSP_SRCS-$(HAVE_AVX2)   += x86/sad4d_avx2.c
 DSP_SRCS-$(HAVE_AVX2)   += x86/sad_avx2.c
-
-ifeq ($(CONFIG_HIGHBITDEPTH),yes)
 DSP_SRCS-$(HAVE_AVX2)   += x86/sad_highbd_avx2.c
-endif
 
 ifeq ($(CONFIG_AV1_ENCODER),yes)
 DSP_SRCS-$(HAVE_SSSE3)  += x86/masked_sad_intrin_ssse3.c
@@ -366,11 +351,8 @@
 DSP_SRCS-$(HAVE_SSE2)   += x86/sad4d_sse2.asm
 DSP_SRCS-$(HAVE_SSE2)   += x86/sad_sse2.asm
 DSP_SRCS-$(HAVE_SSE2)   += x86/subtract_sse2.asm
-
-ifeq ($(CONFIG_HIGHBITDEPTH),yes)
 DSP_SRCS-$(HAVE_SSE2) += x86/highbd_sad4d_sse2.asm
 DSP_SRCS-$(HAVE_SSE2) += x86/highbd_sad_sse2.asm
-endif  # CONFIG_HIGHBITDEPTH
 
 endif  # CONFIG_AV1_ENCODER
 
@@ -397,13 +379,10 @@
 
 DSP_SRCS-$(HAVE_SSE)    += x86/subpel_variance_sse2.asm
 DSP_SRCS-$(HAVE_SSE2)   += x86/subpel_variance_sse2.asm  # Contains SSE2 and SSSE3
-
-ifeq ($(CONFIG_HIGHBITDEPTH),yes)
 DSP_SRCS-$(HAVE_SSE2)   += x86/highbd_variance_sse2.c
 DSP_SRCS-$(HAVE_SSE4_1) += x86/highbd_variance_sse4.c
 DSP_SRCS-$(HAVE_SSE2)   += x86/highbd_variance_impl_sse2.asm
 DSP_SRCS-$(HAVE_SSE2)   += x86/highbd_subpel_variance_impl_sse2.asm
-endif  # CONFIG_HIGHBITDEPTH
 endif  # CONFIG_AV1_ENCODER
 
 DSP_SRCS-no += $(DSP_SRCS_REMOVE-yes)
diff --git a/aom_dsp/aom_dsp_common.h b/aom_dsp/aom_dsp_common.h
index 3d3bcba..38d62e5 100644
--- a/aom_dsp/aom_dsp_common.h
+++ b/aom_dsp/aom_dsp_common.h
@@ -55,19 +55,11 @@
 typedef uint16_t qm_val_t;
 #define AOM_QM_BITS 5
 
-#if CONFIG_HIGHBITDEPTH
 // Note:
 // tran_low_t  is the datatype used for final transform coefficients.
 // tran_high_t is the datatype used for intermediate transform stages.
 typedef int64_t tran_high_t;
 typedef int32_t tran_low_t;
-#else
-// Note:
-// tran_low_t  is the datatype used for final transform coefficients.
-// tran_high_t is the datatype used for intermediate transform stages.
-typedef int32_t tran_high_t;
-typedef int16_t tran_low_t;
-#endif  // CONFIG_HIGHBITDEPTH
 
 static INLINE uint8_t clip_pixel(int val) {
   return (val > 255) ? 255 : (val < 0) ? 0 : val;
diff --git a/aom_dsp/aom_dsp_rtcd_defs.pl b/aom_dsp/aom_dsp_rtcd_defs.pl
index cf334b8..f6ec89d 100755
--- a/aom_dsp/aom_dsp_rtcd_defs.pl
+++ b/aom_dsp/aom_dsp_rtcd_defs.pl
@@ -89,10 +89,8 @@
   foreach $pred_name (@pred_names) {
     add_proto "void", "aom_${pred_name}_predictor_${w}x${h}",
               "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
-    if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
-      add_proto "void", "aom_highbd_${pred_name}_predictor_${w}x${h}",
-                "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
-    }
+    add_proto "void", "aom_highbd_${pred_name}_predictor_${w}x${h}",
+              "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
   }
 }
 
@@ -221,7 +219,6 @@
 specialize qw/aom_d45e_predictor_32x16 ssse3/;
 specialize qw/aom_d45e_predictor_32x32 ssse3/;
 
-if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
   specialize qw/aom_highbd_v_predictor_4x4 sse2/;
   specialize qw/aom_highbd_v_predictor_4x8 sse2/;
   specialize qw/aom_highbd_v_predictor_8x4 sse2/;
@@ -282,7 +279,7 @@
   specialize qw/aom_highbd_dc_left_predictor_32x32 sse2/;
   specialize qw/aom_highbd_dc_top_predictor_32x32 sse2/;
   specialize qw/aom_highbd_dc_128_predictor_32x32 sse2/;
-  
+
   specialize qw/aom_highbd_d117_predictor_4x4 sse2/;
   specialize qw/aom_highbd_d117_predictor_8x8 ssse3/;
   specialize qw/aom_highbd_d117_predictor_16x16 ssse3/;
@@ -328,7 +325,6 @@
   specialize qw/aom_highbd_d63e_predictor_16x32 avx2/;
   specialize qw/aom_highbd_d63e_predictor_32x16 avx2/;
   specialize qw/aom_highbd_d63e_predictor_32x32 avx2/;
-}  # CONFIG_HIGHBITDEPTH
 
 #
 # Sub Pixel Filters
@@ -391,39 +387,37 @@
   specialize qw/aom_convolve8_avg_vert  neon dspr2 msa/;
 }
 
-if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
-  add_proto qw/void aom_highbd_convolve_copy/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
-  specialize qw/aom_highbd_convolve_copy sse2 avx2/;
+add_proto qw/void aom_highbd_convolve_copy/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
+specialize qw/aom_highbd_convolve_copy sse2 avx2/;
 
-  add_proto qw/void aom_highbd_convolve_avg/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
-  specialize qw/aom_highbd_convolve_avg sse2 avx2/;
+add_proto qw/void aom_highbd_convolve_avg/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
+specialize qw/aom_highbd_convolve_avg sse2 avx2/;
 
-  add_proto qw/void aom_highbd_convolve8/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
-  specialize qw/aom_highbd_convolve8 avx2/, "$sse2_x86_64";
+add_proto qw/void aom_highbd_convolve8/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
+specialize qw/aom_highbd_convolve8 avx2/, "$sse2_x86_64";
 
-  add_proto qw/void aom_highbd_convolve8_horiz/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
-  specialize qw/aom_highbd_convolve8_horiz avx2/, "$sse2_x86_64";
+add_proto qw/void aom_highbd_convolve8_horiz/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
+specialize qw/aom_highbd_convolve8_horiz avx2/, "$sse2_x86_64";
 
-  add_proto qw/void aom_highbd_convolve8_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
-  specialize qw/aom_highbd_convolve8_vert avx2/, "$sse2_x86_64";
+add_proto qw/void aom_highbd_convolve8_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
+specialize qw/aom_highbd_convolve8_vert avx2/, "$sse2_x86_64";
 
-  add_proto qw/void aom_highbd_convolve8_avg/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
-  specialize qw/aom_highbd_convolve8_avg avx2/, "$sse2_x86_64";
+add_proto qw/void aom_highbd_convolve8_avg/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
+specialize qw/aom_highbd_convolve8_avg avx2/, "$sse2_x86_64";
 
-  add_proto qw/void aom_highbd_convolve8_avg_horiz/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
-  specialize qw/aom_highbd_convolve8_avg_horiz avx2/, "$sse2_x86_64";
+add_proto qw/void aom_highbd_convolve8_avg_horiz/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
+specialize qw/aom_highbd_convolve8_avg_horiz avx2/, "$sse2_x86_64";
 
-  add_proto qw/void aom_highbd_convolve8_avg_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
-  specialize qw/aom_highbd_convolve8_avg_vert avx2/, "$sse2_x86_64";
+add_proto qw/void aom_highbd_convolve8_avg_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
+specialize qw/aom_highbd_convolve8_avg_vert avx2/, "$sse2_x86_64";
 
-  if (aom_config("CONFIG_LOOP_RESTORATION") eq "yes") {
-    add_proto qw/void aom_highbd_convolve8_add_src/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
-    add_proto qw/void aom_highbd_convolve8_add_src_hip/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
+if (aom_config("CONFIG_LOOP_RESTORATION") eq "yes") {
+  add_proto qw/void aom_highbd_convolve8_add_src/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
+  add_proto qw/void aom_highbd_convolve8_add_src_hip/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
 
-    specialize qw/aom_highbd_convolve8_add_src/, "$sse2_x86_64";
-    specialize qw/aom_highbd_convolve8_add_src_hip ssse3/;
-  }  # CONFIG_LOOP_RESTORATION
-}  # CONFIG_HIGHBITDEPTH
+  specialize qw/aom_highbd_convolve8_add_src/, "$sse2_x86_64";
+  specialize qw/aom_highbd_convolve8_add_src_hip ssse3/;
+}  # CONFIG_LOOP_RESTORATION
 
 #
 # Loopfilter
@@ -508,7 +502,6 @@
   specialize qw/aom_lpf_horizontal_4_dual sse2 neon dspr2 msa/;
 }
 
-if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
   add_proto qw/void aom_highbd_lpf_vertical_16/, "uint16_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd";
   specialize qw/aom_highbd_lpf_vertical_16 sse2/;
 
@@ -544,7 +537,6 @@
 
   add_proto qw/void aom_highbd_lpf_horizontal_4_dual/, "uint16_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1, int bd";
   specialize qw/aom_highbd_lpf_horizontal_4_dual sse2 avx2/;
-}  # CONFIG_HIGHBITDEPTH
 
 # Helper functions.
 add_proto qw/void av1_round_shift_array/, "int32_t *arr, int size, int bit";
@@ -558,7 +550,6 @@
 # Forward transform
 #
 if (aom_config("CONFIG_AV1_ENCODER") eq "yes"){
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
     add_proto qw/void aom_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride";
     specialize qw/aom_fdct4x4 sse2/;
 
@@ -593,25 +584,6 @@
     add_proto qw/void aom_highbd_fdct32x32_rd/, "const int16_t *input, tran_low_t *output, int stride";
     specialize qw/aom_highbd_fdct32x32_rd sse2/;
 
-  } else {
-    add_proto qw/void aom_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride";
-    specialize qw/aom_fdct4x4 sse2 msa/;
-
-    add_proto qw/void aom_fdct4x4_1/, "const int16_t *input, tran_low_t *output, int stride";
-    specialize qw/aom_fdct4x4_1 sse2/;
-
-    add_proto qw/void aom_fdct8x8/, "const int16_t *input, tran_low_t *output, int stride";
-    specialize qw/aom_fdct8x8 sse2 neon msa/, "$ssse3_x86_64";
-
-    add_proto qw/void aom_fdct16x16/, "const int16_t *input, tran_low_t *output, int stride";
-    specialize qw/aom_fdct16x16 sse2 msa/;
-
-    add_proto qw/void aom_fdct32x32/, "const int16_t *input, tran_low_t *output, int stride";
-    specialize qw/aom_fdct32x32 sse2 avx2 msa/;
-
-    add_proto qw/void aom_fdct32x32_rd/, "const int16_t *input, tran_low_t *output, int stride";
-    specialize qw/aom_fdct32x32_rd sse2 avx2 msa/;
-  }  # CONFIG_HIGHBITDEPTH
 }  # CONFIG_AV1_ENCODER
 
 #
@@ -666,60 +638,6 @@
 
   add_proto qw/void aom_idct32x32_1_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
   specialize qw/aom_idct32x32_1_add sse2 avx2/;
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
-  } else {
-    add_proto qw/void aom_idct4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_idct4x4_1_add sse2 neon dspr2 msa/;
-
-    add_proto qw/void aom_idct4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_idct4x4_16_add sse2 neon dspr2 msa/;
-
-    add_proto qw/void aom_idct8x8_1_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_idct8x8_1_add sse2 neon dspr2 msa/;
-
-    add_proto qw/void aom_idct8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_idct8x8_64_add sse2 ssse3 neon dspr2 msa/;
-
-    add_proto qw/void aom_idct8x8_12_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_idct8x8_12_add sse2 ssse3 neon dspr2 msa/;
-
-    add_proto qw/void aom_idct16x16_1_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_idct16x16_1_add sse2 avx2 neon dspr2 msa/;
-
-    add_proto qw/void aom_idct16x16_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_idct16x16_256_add sse2 avx2 neon dspr2 msa/;
-
-    add_proto qw/void aom_idct16x16_38_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_idct16x16_38_add avx2/;
-
-    add_proto qw/void aom_idct16x16_10_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_idct16x16_10_add sse2 avx2 neon dspr2 msa/;
-
-    add_proto qw/void aom_idct32x32_1024_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_idct32x32_1024_add sse2 ssse3 avx2 neon dspr2 msa/;
-
-    add_proto qw/void aom_idct32x32_135_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_idct32x32_135_add sse2 ssse3 avx2 neon dspr2 msa/;
-    # Need to add 135 eob idct32x32 implementations.
-    $aom_idct32x32_135_add_sse2=aom_idct32x32_1024_add_sse2;
-    $aom_idct32x32_135_add_neon=aom_idct32x32_1024_add_neon;
-    $aom_idct32x32_135_add_dspr2=aom_idct32x32_1024_add_dspr2;
-    $aom_idct32x32_135_add_msa=aom_idct32x32_1024_add_msa;
-
-    add_proto qw/void aom_idct32x32_34_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_idct32x32_34_add sse2 ssse3 avx2 neon dspr2 msa/;
-    # Need to add 34 eob idct32x32 neon implementation.
-    $aom_idct32x32_34_add_neon=aom_idct32x32_1024_add_neon;
-
-    add_proto qw/void aom_idct32x32_1_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_idct32x32_1_add sse2 avx2 neon dspr2 msa/;
-
-    add_proto qw/void aom_iwht4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_iwht4x4_1_add msa/;
-
-    add_proto qw/void aom_iwht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/aom_iwht4x4_16_add msa sse2/;
-  }  # CONFIG_HIGHBITDEPTH
 }  # CONFIG_AV1
 
 #
@@ -757,14 +675,13 @@
   specialize "aom_blend_a64_hmask", qw/sse4_1/;
   specialize "aom_blend_a64_vmask", qw/sse4_1/;
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
     add_proto qw/void aom_highbd_blend_a64_mask/, "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, uint32_t mask_stride, int h, int w, int suby, int subx, int bd";
     add_proto qw/void aom_highbd_blend_a64_hmask/, "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, int bd";
     add_proto qw/void aom_highbd_blend_a64_vmask/, "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, int bd";
     specialize "aom_highbd_blend_a64_mask", qw/sse4_1/;
     specialize "aom_highbd_blend_a64_hmask", qw/sse4_1/;
     specialize "aom_highbd_blend_a64_vmask", qw/sse4_1/;
-  }
+
 }  # CONFIG_AV1
 
 if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
@@ -794,19 +711,15 @@
     # Avg
     #
     specialize qw/aom_avg_8x8 sse2 neon msa/;
-    if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
       add_proto qw/void aom_highbd_subtract_block/, "int rows, int cols, int16_t *diff_ptr, ptrdiff_t diff_stride, const uint8_t *src_ptr, ptrdiff_t src_stride, const uint8_t *pred_ptr, ptrdiff_t pred_stride, int bd";
       specialize qw/aom_highbd_subtract_block sse2/;
-    }
 
     #
     # Minmax
     #
     add_proto qw/void aom_minmax_8x8/, "const uint8_t *s, int p, const uint8_t *d, int dp, int *min, int *max";
     specialize qw/aom_minmax_8x8 sse2 neon/;
-    if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
       add_proto qw/void aom_highbd_minmax_8x8/, "const uint8_t *s, int p, const uint8_t *d, int dp, int *min, int *max";
-    }
 
     add_proto qw/void aom_hadamard_8x8/, "const int16_t *src_diff, int src_stride, int16_t *coeff";
     specialize qw/aom_hadamard_8x8 sse2 neon/, "$ssse3_x86_64";
@@ -917,7 +830,7 @@
     specialize qw/aom_sad128xh sse2/;
   }
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
+
     foreach (@block_sizes) {
       ($w, $h) = @$_;
       add_proto qw/unsigned int/, "aom_highbd_sad${w}x${h}", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride";
@@ -953,7 +866,6 @@
     specialize qw/aom_highbd_sad16x32_avg   avx2/;
     specialize qw/aom_highbd_sad16x16_avg   avx2/;
     specialize qw/aom_highbd_sad16x8_avg    avx2/;
-  }
 
   #
   # Masked SAD
@@ -964,13 +876,13 @@
     specialize "aom_masked_sad${w}x${h}", qw/ssse3/;
   }
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
+
     foreach (@block_sizes) {
       ($w, $h) = @$_;
       add_proto qw/unsigned int/, "aom_highbd_masked_sad${w}x${h}", "const uint8_t *src8, int src_stride, const uint8_t *ref8, int ref_stride, const uint8_t *second_pred8, const uint8_t *msk, int msk_stride, int invert_mask";
       specialize "aom_highbd_masked_sad${w}x${h}", qw/ssse3/;
     }
-  }
+
 
   #
   # OBMC SAD
@@ -983,7 +895,7 @@
     }
   }
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
+
     foreach (@block_sizes) {
       ($w, $h) = @$_;
       add_proto qw/unsigned int/, "aom_highbd_obmc_sad${w}x${h}", "const uint8_t *pre, int pre_stride, const int32_t *wsrc, const int32_t *mask";
@@ -991,7 +903,7 @@
         specialize "aom_highbd_obmc_sad${w}x${h}", qw/sse4_1/;
       }
     }
-  }
+
 
   #
   # Multi-block SAD, comparing a reference to N blocks 1 pixel apart horizontally
@@ -1030,22 +942,22 @@
   add_proto qw/void/, "aom_sad4x8x8", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
   specialize qw/aom_sad4x8x8 msa/;
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
-    foreach $s (@block_widths) {
-      # Blocks of 3
-      add_proto qw/void/, "aom_highbd_sad${s}x${s}x3", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
-      # Blocks of 8
-      add_proto qw/void/, "aom_highbd_sad${s}x${s}x8", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
-    }
+
+  foreach $s (@block_widths) {
     # Blocks of 3
-    add_proto qw/void/, "aom_highbd_sad16x8x3", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
-    add_proto qw/void/, "aom_highbd_sad8x16x3", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+    add_proto qw/void/, "aom_highbd_sad${s}x${s}x3", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
     # Blocks of 8
-    add_proto qw/void/, "aom_highbd_sad16x8x8", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
-    add_proto qw/void/, "aom_highbd_sad8x16x8", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
-    add_proto qw/void/, "aom_highbd_sad8x4x8", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
-    add_proto qw/void/, "aom_highbd_sad4x8x8", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+    add_proto qw/void/, "aom_highbd_sad${s}x${s}x8", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
   }
+  # Blocks of 3
+  add_proto qw/void/, "aom_highbd_sad16x8x3", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+  add_proto qw/void/, "aom_highbd_sad8x16x3", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+  # Blocks of 8
+  add_proto qw/void/, "aom_highbd_sad16x8x8", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+  add_proto qw/void/, "aom_highbd_sad8x16x8", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+  add_proto qw/void/, "aom_highbd_sad8x4x8", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+  add_proto qw/void/, "aom_highbd_sad4x8x8", "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+
 
   #
   # Multi-block SAD, comparing a reference to N independent blocks
@@ -1072,7 +984,6 @@
   specialize qw/aom_sad4x8x4d               msa sse2/;
   specialize qw/aom_sad4x4x4d               msa sse2/;
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
     #
     # Multi-block SAD, comparing a reference to N independent blocks
     #
@@ -1094,7 +1005,7 @@
     specialize qw/aom_highbd_sad16x32x4d   avx2/;
     specialize qw/aom_highbd_sad16x16x4d   avx2/;
     specialize qw/aom_highbd_sad16x8x4d    avx2/;
-  }
+
 
   #
   # Structured Similarity (SSIM)
@@ -1106,9 +1017,8 @@
     add_proto qw/void aom_ssim_parms_16x16/, "const uint8_t *s, int sp, const uint8_t *r, int rp, uint32_t *sum_s, uint32_t *sum_r, uint32_t *sum_sq_s, uint32_t *sum_sq_r, uint32_t *sum_sxr";
     specialize qw/aom_ssim_parms_16x16/, "$sse2_x86_64";
 
-    if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
-      add_proto qw/void aom_highbd_ssim_parms_8x8/, "const uint16_t *s, int sp, const uint16_t *r, int rp, uint32_t *sum_s, uint32_t *sum_r, uint32_t *sum_sq_s, uint32_t *sum_sq_r, uint32_t *sum_sxr";
-    }
+    add_proto qw/void aom_highbd_ssim_parms_8x8/, "const uint16_t *s, int sp, const uint16_t *r, int rp, uint32_t *sum_s, uint32_t *sum_r, uint32_t *sum_sq_s, uint32_t *sum_sq_r, uint32_t *sum_sxr";
+
   }
 }  # CONFIG_AV1_ENCODER
 
@@ -1135,7 +1045,6 @@
   specialize qw/aom_mse8x16           sse2           msa/;
   specialize qw/aom_mse8x8            sse2           msa/;
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
     foreach $bd (8, 10, 12) {
       add_proto qw/void/, "aom_highbd_${bd}_get16x16var", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum";
       add_proto qw/void/, "aom_highbd_${bd}_get8x8var", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum";
@@ -1148,10 +1057,10 @@
       specialize "aom_highbd_${bd}_mse16x16", qw/sse2/;
       specialize "aom_highbd_${bd}_mse8x8", qw/sse2/;
     }
-  }
+
 
   #
-  # ...
+  #
   #
   add_proto qw/void aom_upsampled_pred/, "uint8_t *comp_pred, int width, int height, int subsample_x_q3, int subsample_y_q3, const uint8_t *ref, int ref_stride";
   specialize qw/aom_upsampled_pred sse2/;
@@ -1164,20 +1073,20 @@
     specialize qw/aom_jnt_comp_avg_upsampled_pred ssse3/;
   }
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
-    add_proto qw/void aom_highbd_upsampled_pred/, "uint16_t *comp_pred, int width, int height, int subsample_x_q3, int subsample_y_q3, const uint8_t *ref8, int ref_stride, int bd";
-    specialize qw/aom_highbd_upsampled_pred sse2/;
-    add_proto qw/void aom_highbd_comp_avg_upsampled_pred/, "uint16_t *comp_pred, const uint8_t *pred8, int width, int height, int subsample_x_q3, int subsample_y_q3, const uint8_t *ref8, int ref_stride, int bd";
-    specialize qw/aom_highbd_comp_avg_upsampled_pred sse2/;
 
-    if (aom_config("CONFIG_JNT_COMP") eq "yes") {
-      add_proto qw/void aom_highbd_jnt_comp_avg_upsampled_pred/, "uint16_t *comp_pred, const uint8_t *pred8, int width, int height, int subsample_x_q3, int subsample_y_q3, const uint8_t *ref8, int ref_stride, int bd, const JNT_COMP_PARAMS *jcp_param";
-      specialize qw/aom_highbd_jnt_comp_avg_upsampled_pred sse2/;
-    }
+  add_proto qw/void aom_highbd_upsampled_pred/, "uint16_t *comp_pred, int width, int height, int subsample_x_q3, int subsample_y_q3, const uint8_t *ref8, int ref_stride, int bd";
+  specialize qw/aom_highbd_upsampled_pred sse2/;
+  add_proto qw/void aom_highbd_comp_avg_upsampled_pred/, "uint16_t *comp_pred, const uint8_t *pred8, int width, int height, int subsample_x_q3, int subsample_y_q3, const uint8_t *ref8, int ref_stride, int bd";
+  specialize qw/aom_highbd_comp_avg_upsampled_pred sse2/;
+
+  if (aom_config("CONFIG_JNT_COMP") eq "yes") {
+    add_proto qw/void aom_highbd_jnt_comp_avg_upsampled_pred/, "uint16_t *comp_pred, const uint8_t *pred8, int width, int height, int subsample_x_q3, int subsample_y_q3, const uint8_t *ref8, int ref_stride, int bd, const JNT_COMP_PARAMS *jcp_param";
+    specialize qw/aom_highbd_jnt_comp_avg_upsampled_pred sse2/;
   }
 
+
   #
-  # ...
+  #
   #
   add_proto qw/unsigned int aom_get_mb_ss/, "const int16_t *";
   add_proto qw/unsigned int aom_get4x4sse_cs/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride";
@@ -1303,42 +1212,41 @@
     }
   }
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
-    foreach $bd (8, 10, 12) {
-      add_proto qw/unsigned int/, "aom_highbd_${bd}_variance2x2", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
 
-      add_proto qw/unsigned int/, "aom_highbd_${bd}_variance2x4", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+  foreach $bd (8, 10, 12) {
+    add_proto qw/unsigned int/, "aom_highbd_${bd}_variance2x2", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
 
-      add_proto qw/unsigned int/, "aom_highbd_${bd}_variance4x2", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+    add_proto qw/unsigned int/, "aom_highbd_${bd}_variance2x4", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
 
-      foreach (@block_sizes) {
-        ($w, $h) = @$_;
-        add_proto qw/unsigned int/, "aom_highbd_${bd}_variance${w}x${h}", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
-        add_proto qw/uint32_t/, "aom_highbd_${bd}_sub_pixel_variance${w}x${h}", "const uint8_t *src_ptr, int source_stride, int xoffset, int  yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
-        add_proto qw/uint32_t/, "aom_highbd_${bd}_sub_pixel_avg_variance${w}x${h}", "const uint8_t *src_ptr, int source_stride, int xoffset, int  yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred";
-        if ($w != 128 && $h != 128 && $w != 4 && $h != 4) {
-          specialize "aom_highbd_${bd}_variance${w}x${h}", "sse2";
-        }
-        # TODO(david.barker): When ext-partition-types is enabled, we currently
-        # don't have vectorized 4x16 highbd variance functions
-        if ($w == 4 && $h == 4) {
+    add_proto qw/unsigned int/, "aom_highbd_${bd}_variance4x2", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+
+    foreach (@block_sizes) {
+      ($w, $h) = @$_;
+      add_proto qw/unsigned int/, "aom_highbd_${bd}_variance${w}x${h}", "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
+      add_proto qw/uint32_t/, "aom_highbd_${bd}_sub_pixel_variance${w}x${h}", "const uint8_t *src_ptr, int source_stride, int xoffset, int  yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
+      add_proto qw/uint32_t/, "aom_highbd_${bd}_sub_pixel_avg_variance${w}x${h}", "const uint8_t *src_ptr, int source_stride, int xoffset, int  yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred";
+      if ($w != 128 && $h != 128 && $w != 4 && $h != 4) {
+        specialize "aom_highbd_${bd}_variance${w}x${h}", "sse2";
+      }
+      # TODO(david.barker): When ext-partition-types is enabled, we currently
+      # don't have vectorized 4x16 highbd variance functions
+      if ($w == 4 && $h == 4) {
           specialize "aom_highbd_${bd}_variance${w}x${h}", "sse4_1";
         }
-        if ($w != 128 && $h != 128 && $w != 4) {
-          specialize "aom_highbd_${bd}_sub_pixel_variance${w}x${h}", qw/sse2/;
-          specialize "aom_highbd_${bd}_sub_pixel_avg_variance${w}x${h}", qw/sse2/;
-        }
-        if ($w == 4 && $h == 4) {
-          specialize "aom_highbd_${bd}_sub_pixel_variance${w}x${h}", "sse4_1";
-          specialize "aom_highbd_${bd}_sub_pixel_avg_variance${w}x${h}", "sse4_1";
-        }
+      if ($w != 128 && $h != 128 && $w != 4) {
+        specialize "aom_highbd_${bd}_sub_pixel_variance${w}x${h}", qw/sse2/;
+        specialize "aom_highbd_${bd}_sub_pixel_avg_variance${w}x${h}", qw/sse2/;
+      }
+      if ($w == 4 && $h == 4) {
+        specialize "aom_highbd_${bd}_sub_pixel_variance${w}x${h}", "sse4_1";
+        specialize "aom_highbd_${bd}_sub_pixel_avg_variance${w}x${h}", "sse4_1";
+      }
 
-        if (aom_config("CONFIG_JNT_COMP") eq "yes") {
-          add_proto qw/uint32_t/, "aom_highbd_${bd}_jnt_sub_pixel_avg_variance${w}x${h}", "const uint8_t *src_ptr, int source_stride, int xoffset, int  yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred, const JNT_COMP_PARAMS* jcp_param";
-        }
+      if (aom_config("CONFIG_JNT_COMP") eq "yes") {
+        add_proto qw/uint32_t/, "aom_highbd_${bd}_jnt_sub_pixel_avg_variance${w}x${h}", "const uint8_t *src_ptr, int source_stride, int xoffset, int  yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred, const JNT_COMP_PARAMS* jcp_param";
       }
     }
-  }  # CONFIG_HIGHBITDEPTH
+  }
 
   #
   # Masked Variance / Masked Subpixel Variance
@@ -1349,7 +1257,7 @@
     specialize "aom_masked_sub_pixel_variance${w}x${h}", qw/ssse3/;
   }
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
+
     foreach $bd ("_8_", "_10_", "_12_") {
       foreach (@block_sizes) {
         ($w, $h) = @$_;
@@ -1357,7 +1265,7 @@
         specialize "aom_highbd${bd}masked_sub_pixel_variance${w}x${h}", qw/ssse3/;
       }
     }
-  }
+
 
   #
   # OBMC Variance / OBMC Subpixel Variance
@@ -1369,7 +1277,7 @@
     specialize "aom_obmc_variance${w}x${h}", q/sse4_1/;
   }
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
+
     foreach $bd ("_", "_10_", "_12_") {
       foreach (@block_sizes) {
         ($w, $h) = @$_;
@@ -1378,7 +1286,7 @@
         specialize "aom_highbd${bd}obmc_variance${w}x${h}", qw/sse4_1/;
       }
     }
-  }
+
 
   add_proto qw/uint32_t aom_sub_pixel_avg_variance64x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int  yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred";
   specialize qw/aom_sub_pixel_avg_variance64x64 avx2 msa sse2 ssse3/;
@@ -1438,7 +1346,7 @@
     add_proto qw/void aom_jnt_comp_avg_pred/, "uint8_t *comp_pred, const uint8_t *pred, int width, int height, const uint8_t *ref, int ref_stride, const JNT_COMP_PARAMS *jcp_param";
     specialize qw/aom_jnt_comp_avg_pred ssse3/;
   }
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
+
     add_proto qw/unsigned int aom_highbd_12_variance64x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
     specialize qw/aom_highbd_12_variance64x64 sse2/;
 
@@ -1800,14 +1708,14 @@
     add_proto qw/uint32_t aom_highbd_8_sub_pixel_avg_variance4x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int  yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred";
     add_proto qw/uint32_t aom_highbd_8_sub_pixel_avg_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int  yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred";
 
-  }  # CONFIG_HIGHBITDEPTH
+
 
   add_proto qw/void aom_comp_mask_pred/, "uint8_t *comp_pred, const uint8_t *pred, int width, int height, const uint8_t *ref, int ref_stride, const uint8_t *mask, int mask_stride, int invert_mask";
   add_proto qw/void aom_comp_mask_upsampled_pred/, "uint8_t *comp_pred, const uint8_t *pred, int width, int height, int subsample_x_q3, int subsample_y_q3, const uint8_t *ref, int ref_stride, const uint8_t *mask, int mask_stride, int invert_mask";
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
-    add_proto qw/void aom_highbd_comp_mask_pred/, "uint16_t *comp_pred, const uint8_t *pred8, int width, int height, const uint8_t *ref8, int ref_stride, const uint8_t *mask, int mask_stride, int invert_mask";
-    add_proto qw/void aom_highbd_comp_mask_upsampled_pred/, "uint16_t *comp_pred, const uint8_t *pred8, int width, int height, int subsample_x_q3, int subsample_y_q3, const uint8_t *ref8, int ref_stride, const uint8_t *mask, int mask_stride, int invert_mask, int bd";
-  }
+
+  add_proto qw/void aom_highbd_comp_mask_pred/, "uint16_t *comp_pred, const uint8_t *pred8, int width, int height, const uint8_t *ref8, int ref_stride, const uint8_t *mask, int mask_stride, int invert_mask";
+  add_proto qw/void aom_highbd_comp_mask_upsampled_pred/, "uint16_t *comp_pred, const uint8_t *pred8, int width, int height, int subsample_x_q3, int subsample_y_q3, const uint8_t *ref8, int ref_stride, const uint8_t *mask, int mask_stride, int invert_mask, int bd";
+
 
 }  # CONFIG_AV1_ENCODER
 
diff --git a/aom_dsp/avg.c b/aom_dsp/avg.c
index f732224..b760582 100644
--- a/aom_dsp/avg.c
+++ b/aom_dsp/avg.c
@@ -171,7 +171,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 void aom_highbd_minmax_8x8_c(const uint8_t *s8, int p, const uint8_t *d8,
                              int dp, int *min, int *max) {
   int i, j;
@@ -187,4 +186,3 @@
     }
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/blend_a64_hmask.c b/aom_dsp/blend_a64_hmask.c
index 99b4b8a..c8dc283 100644
--- a/aom_dsp/blend_a64_hmask.c
+++ b/aom_dsp/blend_a64_hmask.c
@@ -40,7 +40,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 void aom_highbd_blend_a64_hmask_c(uint8_t *dst_8, uint32_t dst_stride,
                                   const uint8_t *src0_8, uint32_t src0_stride,
                                   const uint8_t *src1_8, uint32_t src1_stride,
@@ -68,4 +67,3 @@
     }
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/blend_a64_mask.c b/aom_dsp/blend_a64_mask.c
index 384e81b..0ada244 100644
--- a/aom_dsp/blend_a64_mask.c
+++ b/aom_dsp/blend_a64_mask.c
@@ -140,7 +140,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 void aom_highbd_blend_a64_mask_c(uint8_t *dst_8, uint32_t dst_stride,
                                  const uint8_t *src0_8, uint32_t src0_stride,
                                  const uint8_t *src1_8, uint32_t src1_stride,
@@ -203,4 +202,3 @@
     }
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/blend_a64_vmask.c b/aom_dsp/blend_a64_vmask.c
index 1a5e30e..cdb1df0 100644
--- a/aom_dsp/blend_a64_vmask.c
+++ b/aom_dsp/blend_a64_vmask.c
@@ -41,7 +41,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 void aom_highbd_blend_a64_vmask_c(uint8_t *dst_8, uint32_t dst_stride,
                                   const uint8_t *src0_8, uint32_t src0_stride,
                                   const uint8_t *src1_8, uint32_t src1_stride,
@@ -70,4 +69,3 @@
     }
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/fastssim.c b/aom_dsp/fastssim.c
index 09d945a..1d681fc 100644
--- a/aom_dsp/fastssim.c
+++ b/aom_dsp/fastssim.c
@@ -25,12 +25,11 @@
 
 #define SSIM_C1 (255 * 255 * 0.01 * 0.01)
 #define SSIM_C2 (255 * 255 * 0.03 * 0.03)
-#if CONFIG_HIGHBITDEPTH
 #define SSIM_C1_10 (1023 * 1023 * 0.01 * 0.01)
 #define SSIM_C1_12 (4095 * 4095 * 0.01 * 0.01)
 #define SSIM_C2_10 (1023 * 1023 * 0.03 * 0.03)
 #define SSIM_C2_12 (4095 * 4095 * 0.03 * 0.03)
-#endif
+
 #define FS_MINI(_a, _b) ((_a) < (_b) ? (_a) : (_b))
 #define FS_MAXI(_a, _b) ((_a) > (_b) ? (_a) : (_b))
 
@@ -198,13 +197,10 @@
   int i;
   int j;
   double ssim_c1 = SSIM_C1;
-#if CONFIG_HIGHBITDEPTH
+
   if (bit_depth == 10) ssim_c1 = SSIM_C1_10;
   if (bit_depth == 12) ssim_c1 = SSIM_C1_12;
-#else
-  assert(bit_depth == 8);
-  (void)bit_depth;
-#endif
+
   w = _ctx->level[_l].w;
   h = _ctx->level[_l].h;
   col_sums_x = _ctx->col_buf;
@@ -323,13 +319,8 @@
   int i;
   int j;
   double ssim_c2 = SSIM_C2;
-#if CONFIG_HIGHBITDEPTH
   if (bit_depth == 10) ssim_c2 = SSIM_C2_10;
   if (bit_depth == 12) ssim_c2 = SSIM_C2_12;
-#else
-  assert(bit_depth == 8);
-  (void)bit_depth;
-#endif
 
   w = _ctx->level[_l].w;
   h = _ctx->level[_l].h;
diff --git a/aom_dsp/fwd_txfm.c b/aom_dsp/fwd_txfm.c
index 1ceef77..935bd07 100644
--- a/aom_dsp/fwd_txfm.c
+++ b/aom_dsp/fwd_txfm.c
@@ -740,7 +740,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 void aom_highbd_fdct4x4_c(const int16_t *input, tran_low_t *output,
                           int stride) {
   aom_fdct4x4_c(input, output, stride);
@@ -763,5 +762,3 @@
                                int stride) {
   aom_fdct32x32_rd_c(input, out, stride);
 }
-
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/intrapred.c b/aom_dsp/intrapred.c
index ff58f07..27c178f 100644
--- a/aom_dsp/intrapred.c
+++ b/aom_dsp/intrapred.c
@@ -512,7 +512,6 @@
   DST(1, 3) = AVG3(L, K, J);
 }
 
-#if CONFIG_HIGHBITDEPTH
 static INLINE void highbd_d207e_predictor(uint16_t *dst, ptrdiff_t stride,
                                           int bw, int bh, const uint16_t *above,
                                           const uint16_t *left, int bd) {
@@ -918,7 +917,6 @@
     dst += stride;
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 // This serves as a wrapper function, so that all the prediction functions
 // can be unified and accessed as a pointer array. Note that the boundary
@@ -930,7 +928,6 @@
     type##_predictor(dst, stride, width, height, above, left); \
   }
 
-#if CONFIG_HIGHBITDEPTH
 #define intra_pred_highbd_sized(type, width, height)                        \
   void aom_highbd_##type##_predictor_##width##x##height##_c(                \
       uint16_t *dst, ptrdiff_t stride, const uint16_t *above,               \
@@ -1023,59 +1020,6 @@
   intra_pred_above_4x4(type)
 #endif  // CONFIG_TX64X64
 
-#else
-
-#if CONFIG_TX64X64
-#define intra_pred_rectangular(type) \
-  intra_pred_sized(type, 4, 8) \
-  intra_pred_sized(type, 8, 4) \
-  intra_pred_sized(type, 8, 16) \
-  intra_pred_sized(type, 16, 8) \
-  intra_pred_sized(type, 16, 32) \
-  intra_pred_sized(type, 32, 16) \
-  intra_pred_sized(type, 32, 64) \
-  intra_pred_sized(type, 64, 32) \
-  intra_pred_sized(type, 4, 16) \
-  intra_pred_sized(type, 16, 4) \
-  intra_pred_sized(type, 8, 32) \
-  intra_pred_sized(type, 32, 8) \
-  intra_pred_sized(type, 16, 64) \
-  intra_pred_sized(type, 64, 16)
-#define intra_pred_above_4x4(type) \
-  intra_pred_sized(type, 8, 8) \
-  intra_pred_sized(type, 16, 16) \
-  intra_pred_sized(type, 32, 32) \
-  intra_pred_sized(type, 64, 64) \
-  intra_pred_rectangular(type)
-#define intra_pred_allsizes(type) \
-  intra_pred_sized(type, 2, 2) \
-  intra_pred_sized(type, 4, 4) \
-  intra_pred_above_4x4(type)
-#else  // CONFIG_TX64X64
-#define intra_pred_rectangular(type) \
-  intra_pred_sized(type, 4, 8) \
-  intra_pred_sized(type, 8, 4) \
-  intra_pred_sized(type, 8, 16) \
-  intra_pred_sized(type, 16, 8) \
-  intra_pred_sized(type, 16, 32) \
-  intra_pred_sized(type, 32, 16) \
-  intra_pred_sized(type, 4, 16) \
-  intra_pred_sized(type, 16, 4) \
-  intra_pred_sized(type, 8, 32) \
-  intra_pred_sized(type, 32, 8)
-#define intra_pred_above_4x4(type) \
-  intra_pred_sized(type, 8, 8) \
-  intra_pred_sized(type, 16, 16) \
-  intra_pred_sized(type, 32, 32) \
-  intra_pred_rectangular(type)
-#define intra_pred_allsizes(type) \
-  intra_pred_sized(type, 2, 2) \
-  intra_pred_sized(type, 4, 4) \
-  intra_pred_above_4x4(type)
-#endif  // CONFIG_TX64X64
-
-#endif  // CONFIG_HIGHBITDEPTH
-
 intra_pred_allsizes(d207e)
 intra_pred_allsizes(d63e)
 intra_pred_above_4x4(d45e)
diff --git a/aom_dsp/loopfilter.c b/aom_dsp/loopfilter.c
index 9cde664..be4bd9b 100644
--- a/aom_dsp/loopfilter.c
+++ b/aom_dsp/loopfilter.c
@@ -28,7 +28,6 @@
 #define PARALLEL_DEBLOCKING_5_TAP_CHROMA 0
 #endif
 
-#if CONFIG_HIGHBITDEPTH
 static INLINE int16_t signed_char_clamp_high(int t, int bd) {
   switch (bd) {
     case 10: return (int16_t)clamp(t, -128 * 4, 128 * 4 - 1);
@@ -37,7 +36,6 @@
     default: return (int16_t)clamp(t, -128, 128 - 1);
   }
 }
-#endif
 #if CONFIG_PARALLEL_DEBLOCKING
 // should we apply any filter at all: 11111111 yes, 00000000 no
 static INLINE int8_t filter_mask2(uint8_t limit, uint8_t blimit, uint8_t p1,
@@ -591,7 +589,6 @@
 #endif
 }
 
-#if CONFIG_HIGHBITDEPTH
 #if CONFIG_PARALLEL_DEBLOCKING
 // Should we apply any filter at all: 11111111 yes, 00000000 no ?
 static INLINE int8_t highbd_filter_mask2(uint8_t limit, uint8_t blimit,
@@ -1228,4 +1225,3 @@
   highbd_mb_lpf_vertical_edge_w(s, p, blimit, limit, thresh, 16, bd);
 #endif
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/psnr.c b/aom_dsp/psnr.c
index d543f12..de6d922 100644
--- a/aom_dsp/psnr.c
+++ b/aom_dsp/psnr.c
@@ -48,7 +48,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void encoder_highbd_variance64(const uint8_t *a8, int a_stride,
                                       const uint8_t *b8, int b_stride, int w,
                                       int h, uint64_t *sse, int64_t *sum) {
@@ -80,7 +79,6 @@
   *sse = (unsigned int)sse_long;
   *sum = (int)sum_long;
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 static int64_t get_sse(const uint8_t *a, int a_stride, const uint8_t *b,
                        int b_stride, int width, int height) {
@@ -122,7 +120,6 @@
   return total_sse;
 }
 
-#if CONFIG_HIGHBITDEPTH
 static int64_t highbd_get_sse_shift(const uint8_t *a8, int a_stride,
                                     const uint8_t *b8, int b_stride, int width,
                                     int height, unsigned int input_shift) {
@@ -175,7 +172,6 @@
   }
   return total_sse;
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 int64_t aom_get_y_sse_part(const YV12_BUFFER_CONFIG *a,
                            const YV12_BUFFER_CONFIG *b, int hstart, int width,
@@ -228,7 +224,6 @@
                  a->uv_crop_width, a->uv_crop_height);
 }
 
-#if CONFIG_HIGHBITDEPTH
 int64_t aom_highbd_get_y_sse_part(const YV12_BUFFER_CONFIG *a,
                                   const YV12_BUFFER_CONFIG *b, int hstart,
                                   int width, int vstart, int height) {
@@ -287,11 +282,9 @@
   return highbd_get_sse(a->v_buffer, a->uv_stride, b->v_buffer, b->uv_stride,
                         a->uv_crop_width, a->uv_crop_height);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 int64_t aom_get_sse_plane(const YV12_BUFFER_CONFIG *a,
                           const YV12_BUFFER_CONFIG *b, int plane, int highbd) {
-#if CONFIG_HIGHBITDEPTH
   if (highbd) {
     switch (plane) {
       case 0: return aom_highbd_get_y_sse(a, b);
@@ -300,7 +293,6 @@
       default: assert(plane >= 0 && plane <= 2); return 0;
     }
   }
-#endif
   (void)highbd;
   switch (plane) {
     case 0: return aom_get_y_sse(a, b);
@@ -310,7 +302,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 void aom_calc_highbd_psnr(const YV12_BUFFER_CONFIG *a,
                           const YV12_BUFFER_CONFIG *b, PSNR_STATS *psnr,
                           uint32_t bit_depth, uint32_t in_bit_depth) {
@@ -356,8 +347,6 @@
       aom_sse_to_psnr((double)total_samples, peak, (double)total_sse);
 }
 
-#endif  // !CONFIG_HIGHBITDEPTH
-
 void aom_calc_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b,
                    PSNR_STATS *psnr) {
   static const double peak = 255.0;
diff --git a/aom_dsp/psnr.h b/aom_dsp/psnr.h
index df5f8f9..c7f6c45 100644
--- a/aom_dsp/psnr.h
+++ b/aom_dsp/psnr.h
@@ -49,7 +49,6 @@
 int64_t aom_get_v_sse(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b);
 int64_t aom_get_sse_plane(const YV12_BUFFER_CONFIG *a,
                           const YV12_BUFFER_CONFIG *b, int plane, int highbd);
-#if CONFIG_HIGHBITDEPTH
 int64_t aom_highbd_get_y_sse_part(const YV12_BUFFER_CONFIG *a,
                                   const YV12_BUFFER_CONFIG *b, int hstart,
                                   int width, int vstart, int height);
@@ -68,7 +67,6 @@
 void aom_calc_highbd_psnr(const YV12_BUFFER_CONFIG *a,
                           const YV12_BUFFER_CONFIG *b, PSNR_STATS *psnr,
                           unsigned int bit_depth, unsigned int in_bit_depth);
-#endif
 void aom_calc_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b,
                    PSNR_STATS *psnr);
 
diff --git a/aom_dsp/psnrhvs.c b/aom_dsp/psnrhvs.c
index 8816769..324b387 100644
--- a/aom_dsp/psnrhvs.c
+++ b/aom_dsp/psnrhvs.c
@@ -38,7 +38,6 @@
       *(y + ystride * i + j) = (*(y + ystride * i + j) + 4) >> 3;
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void hbd_od_bin_fdct8x8(tran_low_t *y, int ystride, const int16_t *x,
                                int xstride) {
   int i, j;
@@ -48,7 +47,6 @@
     for (j = 0; j < 8; j++)
       *(y + ystride * i + j) = (*(y + ystride * i + j) + 4) >> 3;
 }
-#endif
 
 /* Normalized inverse quantization matrix for 8x8 DCT at the point of
  * transparency. This is not the JPEG based matrix from the paper,
@@ -214,12 +212,10 @@
         s_gvar = (s_vars[0] + s_vars[1] + s_vars[2] + s_vars[3]) / s_gvar;
       if (d_gvar > 0)
         d_gvar = (d_vars[0] + d_vars[1] + d_vars[2] + d_vars[3]) / d_gvar;
-#if CONFIG_HIGHBITDEPTH
       if (bit_depth == 10 || bit_depth == 12) {
         hbd_od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8);
         hbd_od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8);
       }
-#endif
       if (bit_depth == 8) {
         od_bin_fdct8x8(dct_s_coef, 8, dct_s, 8);
         od_bin_fdct8x8(dct_d_coef, 8, dct_d, 8);
diff --git a/aom_dsp/quantize.h b/aom_dsp/quantize.h
index 03609e8..2f58bce 100644
--- a/aom_dsp/quantize.h
+++ b/aom_dsp/quantize.h
@@ -44,7 +44,6 @@
     const int16_t *scan, const int16_t *iscan, const qm_val_t *qm_ptr,
     const qm_val_t *iqm_ptr, const int log_scale);
 
-#if CONFIG_HIGHBITDEPTH
 void aom_highbd_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
                              int skip_block, const int16_t *zbin_ptr,
                              const int16_t *round_ptr, const int16_t *quant_ptr,
@@ -52,7 +51,6 @@
                              tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
                              const int16_t *dequant_ptr, uint16_t *eob_ptr,
                              const int16_t *scan, const int16_t *iscan);
-#endif
 
 void aom_quantize_dc(const tran_low_t *coeff_ptr, int n_coeffs, int skip_block,
                      const int16_t *round_ptr, const int16_t quant_ptr,
@@ -70,7 +68,6 @@
 #endif  // CONFIG_TX64X64
 
 #if CONFIG_AOM_QM
-#if CONFIG_HIGHBITDEPTH
 void aom_highbd_quantize_dc(const tran_low_t *coeff_ptr, int n_coeffs,
                             int skip_block, const int16_t *round_ptr,
                             const int16_t quant_ptr, tran_low_t *qcoeff_ptr,
@@ -89,11 +86,9 @@
     const int16_t dequant_ptr, uint16_t *eob_ptr, const qm_val_t *qm_ptr,
     const qm_val_t *iqm_ptr);
 #endif  // CONFIG_TX64X64
-#endif  // CONFIG_HIGHBITDEPTH
 
 #else  // CONFIG_AOM_QM
 
-#if CONFIG_HIGHBITDEPTH
 void aom_highbd_quantize_dc(const tran_low_t *coeff_ptr, int n_coeffs,
                             int skip_block, const int16_t *round_ptr,
                             const int16_t quant_ptr, tran_low_t *qcoeff_ptr,
@@ -113,7 +108,6 @@
                                   tran_low_t *dqcoeff_ptr,
                                   const int16_t dequant_ptr, uint16_t *eob_ptr);
 #endif  // CONFIG_TX64X64
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // CONFIG_AOM_QM
 
 #ifdef __cplusplus
diff --git a/aom_dsp/sad.c b/aom_dsp/sad.c
index 809437a..91460c5 100644
--- a/aom_dsp/sad.c
+++ b/aom_dsp/sad.c
@@ -213,10 +213,9 @@
 sadMxN(128, 32)
 sadMxNx4D(128, 32)
 #endif
-/* clang-format on */
+    /* clang-format on */
 
-#if CONFIG_HIGHBITDEPTH
-                static INLINE
+    static INLINE
     unsigned int highbd_sad(const uint8_t *a8, int a_stride, const uint8_t *b8,
                             int b_stride, int width, int height) {
   int y, x;
@@ -410,5 +409,4 @@
 highbd_sadMxN(128, 32)
 highbd_sadMxNx4D(128, 32)
 #endif
-/* clang-format on */
-#endif  // CONFIG_HIGHBITDEPTH
+    /* clang-format on */
diff --git a/aom_dsp/sad_av1.c b/aom_dsp/sad_av1.c
index 7e6ecf1..b7795de 100644
--- a/aom_dsp/sad_av1.c
+++ b/aom_dsp/sad_av1.c
@@ -83,10 +83,9 @@
 MASKSADMxN(32, 128)
 MASKSADMxN(128, 32)
 #endif
-/* clang-format on */
+    /* clang-format on */
 
-#if CONFIG_HIGHBITDEPTH
-                                static INLINE
+    static INLINE
     unsigned int highbd_masked_sad(const uint8_t *src8, int src_stride,
                                    const uint8_t *a8, int a_stride,
                                    const uint8_t *b8, int b_stride,
@@ -156,7 +155,6 @@
 HIGHBD_MASKSADMXN(32, 128)
 HIGHBD_MASKSADMXN(128, 32)
 #endif
-#endif  // CONFIG_HIGHBITDEPTH
 
 // pre: predictor being evaluated
 // wsrc: target weighted prediction (has been *4096 to keep precision)
@@ -216,10 +214,9 @@
 OBMCSADMxN(32, 128)
 OBMCSADMxN(128, 32)
 #endif
-/* clang-format on */
+    /* clang-format on */
 
-#if CONFIG_HIGHBITDEPTH
-                                static INLINE
+    static INLINE
     unsigned int highbd_obmc_sad(const uint8_t *pre8, int pre_stride,
                                  const int32_t *wsrc, const int32_t *mask,
                                  int width, int height) {
@@ -277,5 +274,4 @@
 HIGHBD_OBMCSADMXN(128, 32)
 #endif
 /* clang-format on */
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // CONFIG_AV1
diff --git a/aom_dsp/ssim.c b/aom_dsp/ssim.c
index 6ae378f..fb9f753 100644
--- a/aom_dsp/ssim.c
+++ b/aom_dsp/ssim.c
@@ -31,6 +31,7 @@
     }
   }
 }
+
 void aom_ssim_parms_8x8_c(const uint8_t *s, int sp, const uint8_t *r, int rp,
                           uint32_t *sum_s, uint32_t *sum_r, uint32_t *sum_sq_s,
                           uint32_t *sum_sq_r, uint32_t *sum_sxr) {
@@ -46,7 +47,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 void aom_highbd_ssim_parms_8x8_c(const uint16_t *s, int sp, const uint16_t *r,
                                  int rp, uint32_t *sum_s, uint32_t *sum_r,
                                  uint32_t *sum_sq_s, uint32_t *sum_sq_r,
@@ -62,7 +62,6 @@
     }
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 static const int64_t cc1 = 26634;        // (64^2*(.01*255)^2
 static const int64_t cc2 = 239708;       // (64^2*(.03*255)^2
@@ -108,7 +107,6 @@
   return similarity(sum_s, sum_r, sum_sq_s, sum_sq_r, sum_sxr, 64, 8);
 }
 
-#if CONFIG_HIGHBITDEPTH
 static double highbd_ssim_8x8(const uint16_t *s, int sp, const uint16_t *r,
                               int rp, uint32_t bd, uint32_t shift) {
   uint32_t sum_s = 0, sum_r = 0, sum_sq_s = 0, sum_sq_r = 0, sum_sxr = 0;
@@ -117,7 +115,6 @@
   return similarity(sum_s >> shift, sum_r >> shift, sum_sq_s >> (2 * shift),
                     sum_sq_r >> (2 * shift), sum_sxr >> (2 * shift), 64, bd);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 // We are using a 8x8 moving window with starting location of each 8x8 window
 // on the 4x4 pixel grid. Such arrangement allows the windows to overlap
@@ -142,7 +139,6 @@
   return ssim_total;
 }
 
-#if CONFIG_HIGHBITDEPTH
 static double aom_highbd_ssim2(const uint8_t *img1, const uint8_t *img2,
                                int stride_img1, int stride_img2, int width,
                                int height, uint32_t bd, uint32_t shift) {
@@ -164,7 +160,6 @@
   ssim_total /= samples;
   return ssim_total;
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 double aom_calc_ssim(const YV12_BUFFER_CONFIG *source,
                      const YV12_BUFFER_CONFIG *dest, double *weight) {
@@ -422,7 +417,6 @@
   return inconsistency_total;
 }
 
-#if CONFIG_HIGHBITDEPTH
 double aom_highbd_calc_ssim(const YV12_BUFFER_CONFIG *source,
                             const YV12_BUFFER_CONFIG *dest, double *weight,
                             uint32_t bd, uint32_t in_bd) {
@@ -441,4 +435,3 @@
   *weight = 1;
   return abc[0] * .8 + .1 * (abc[1] + abc[2]);
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/ssim.h b/aom_dsp/ssim.h
index 902735e..a448177 100644
--- a/aom_dsp/ssim.h
+++ b/aom_dsp/ssim.h
@@ -75,11 +75,9 @@
                          double *ssim_u, double *ssim_v, uint32_t bd,
                          uint32_t in_bd);
 
-#if CONFIG_HIGHBITDEPTH
 double aom_highbd_calc_ssim(const YV12_BUFFER_CONFIG *source,
                             const YV12_BUFFER_CONFIG *dest, double *weight,
                             uint32_t bd, uint32_t in_bd);
-#endif  // CONFIG_HIGHBITDEPTH
 
 #ifdef __cplusplus
 }  // extern "C"
diff --git a/aom_dsp/subtract.c b/aom_dsp/subtract.c
index 8dda96e..6afd49b 100644
--- a/aom_dsp/subtract.c
+++ b/aom_dsp/subtract.c
@@ -32,7 +32,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 void aom_highbd_subtract_block_c(int rows, int cols, int16_t *diff,
                                  ptrdiff_t diff_stride, const uint8_t *src8,
                                  ptrdiff_t src_stride, const uint8_t *pred8,
@@ -52,4 +51,3 @@
     src += src_stride;
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/variance.c b/aom_dsp/variance.c
index b47eca3..75ad6c0 100644
--- a/aom_dsp/variance.c
+++ b/aom_dsp/variance.c
@@ -434,7 +434,6 @@
 }
 #endif  // CONFIG_JNT_COMP
 
-#if CONFIG_HIGHBITDEPTH
 static void highbd_variance64(const uint8_t *a8, int a_stride,
                               const uint8_t *b8, int b_stride, int w, int h,
                               uint64_t *sse, int64_t *sum) {
@@ -1023,7 +1022,6 @@
   }
 }
 #endif  // CONFIG_JNT_COMP
-#endif  // CONFIG_HIGHBITDEPTH
 
 #if CONFIG_AV1
 void aom_comp_mask_pred_c(uint8_t *comp_pred, const uint8_t *pred, int width,
@@ -1120,7 +1118,6 @@
 #endif  // CONFIG_EXT_PARTITION
 #endif  // CONFIG_EXT_PARTITION_TYPES
 
-#if CONFIG_HIGHBITDEPTH
 void aom_highbd_comp_mask_pred_c(uint16_t *comp_pred, const uint8_t *pred8,
                                  int width, int height, const uint8_t *ref8,
                                  int ref_stride, const uint8_t *mask,
@@ -1262,7 +1259,6 @@
 HIGHBD_MASK_SUBPIX_VAR(128, 32)
 #endif  // CONFIG_EXT_PARTITION
 #endif  // CONFIG_EXT_PARTITION_TYPES
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // CONFIG_AV1
 
 #if CONFIG_AV1
@@ -1382,7 +1378,6 @@
 #endif  // CONFIG_EXT_PARTITION
 #endif  // CONFIG_EXT_PARTITION_TYPES
 
-#if CONFIG_HIGHBITDEPTH
 static INLINE void highbd_obmc_variance64(const uint8_t *pre8, int pre_stride,
                                           const int32_t *wsrc,
                                           const int32_t *mask, int w, int h,
@@ -1584,5 +1579,4 @@
 HIGHBD_OBMC_SUBPIX_VAR(128, 32)
 #endif  // CONFIG_EXT_PARTITION
 #endif  // CONFIG_EXT_PARTITION_TYPES
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // CONFIG_AV1
diff --git a/aom_dsp/variance.h b/aom_dsp/variance.h
index d4a1e83..f720dd1 100644
--- a/aom_dsp/variance.h
+++ b/aom_dsp/variance.h
@@ -129,10 +129,8 @@
 uint32_t aom_sse_odd_size(const uint8_t *a, int a_stride, const uint8_t *b,
                           int b_stride, int w, int h);
 
-#if CONFIG_HIGHBITDEPTH
 uint64_t aom_highbd_sse_odd_size(const uint8_t *a, int a_stride,
                                  const uint8_t *b, int b_stride, int w, int h);
-#endif  // CONFIG_HIGHBITDEPTH
 
 #ifdef __cplusplus
 }  // extern "C"
diff --git a/aom_dsp/x86/aom_asm_stubs.c b/aom_dsp/x86/aom_asm_stubs.c
index 4067b0b..47afd85 100644
--- a/aom_dsp/x86/aom_asm_stubs.c
+++ b/aom_dsp/x86/aom_asm_stubs.c
@@ -78,7 +78,7 @@
 FUN_CONV_2D(, sse2);
 FUN_CONV_2D(avg_, sse2);
 
-#if CONFIG_HIGHBITDEPTH && ARCH_X86_64
+#if ARCH_X86_64
 highbd_filter8_1dfunction aom_highbd_filter_block1d16_v8_sse2;
 highbd_filter8_1dfunction aom_highbd_filter_block1d16_h8_sse2;
 highbd_filter8_1dfunction aom_highbd_filter_block1d8_v8_sse2;
@@ -178,5 +178,5 @@
   ((int16_t *)filter_y)[3] -= 128;
 }
 #endif  // CONFIG_LOOP_RESTORATION
-#endif  // CONFIG_HIGHBITDEPTH && ARCH_X86_64
+#endif  // ARCH_X86_64
 #endif  // HAVE_SSE2
diff --git a/aom_dsp/x86/aom_convolve_copy_sse2.asm b/aom_dsp/x86/aom_convolve_copy_sse2.asm
index 4d31428..9d4251f 100644
--- a/aom_dsp/x86/aom_convolve_copy_sse2.asm
+++ b/aom_dsp/x86/aom_convolve_copy_sse2.asm
@@ -339,7 +339,5 @@
 INIT_XMM sse2
 convolve_fn copy
 convolve_fn avg
-%if CONFIG_HIGHBITDEPTH
 convolve_fn copy, highbd
 convolve_fn avg, highbd
-%endif
diff --git a/aom_dsp/x86/blend_a64_hmask_sse4.c b/aom_dsp/x86/blend_a64_hmask_sse4.c
index e916e4f..05ebd9f 100644
--- a/aom_dsp/x86/blend_a64_hmask_sse4.c
+++ b/aom_dsp/x86/blend_a64_hmask_sse4.c
@@ -24,7 +24,6 @@
                             src1_stride, mask, 0, h, w, 0, 0);
 }
 
-#if CONFIG_HIGHBITDEPTH
 void aom_highbd_blend_a64_hmask_sse4_1(
     uint8_t *dst_8, uint32_t dst_stride, const uint8_t *src0_8,
     uint32_t src0_stride, const uint8_t *src1_8, uint32_t src1_stride,
@@ -33,4 +32,3 @@
                                    src1_8, src1_stride, mask, 0, h, w, 0, 0,
                                    bd);
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/x86/blend_a64_mask_sse4.c b/aom_dsp/x86/blend_a64_mask_sse4.c
index 68d74e5..ae29f1e 100644
--- a/aom_dsp/x86/blend_a64_mask_sse4.c
+++ b/aom_dsp/x86/blend_a64_mask_sse4.c
@@ -473,7 +473,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 //////////////////////////////////////////////////////////////////////////////
 // No sub-sampling
 //////////////////////////////////////////////////////////////////////////////
@@ -921,4 +920,3 @@
         mask_stride, h, w);
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/x86/blend_a64_vmask_sse4.c b/aom_dsp/x86/blend_a64_vmask_sse4.c
index 9dabe5b..4a8fcdc 100644
--- a/aom_dsp/x86/blend_a64_vmask_sse4.c
+++ b/aom_dsp/x86/blend_a64_vmask_sse4.c
@@ -143,7 +143,6 @@
                  w);
 }
 
-#if CONFIG_HIGHBITDEPTH
 //////////////////////////////////////////////////////////////////////////////
 // Implementation - No sub-sampling
 //////////////////////////////////////////////////////////////////////////////
@@ -282,4 +281,3 @@
                                   src1_stride, mask, h, w);
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/x86/blend_sse4.h b/aom_dsp/x86/blend_sse4.h
index daa2b2b..4880438 100644
--- a/aom_dsp/x86/blend_sse4.h
+++ b/aom_dsp/x86/blend_sse4.h
@@ -53,7 +53,6 @@
   return v_res_w;
 }
 
-#if CONFIG_HIGHBITDEPTH
 typedef __m128i (*blend_unit_fn)(const uint16_t *src0, const uint16_t *src1,
                                  const __m128i v_m0_w, const __m128i v_m1_w);
 
@@ -141,6 +140,5 @@
 
   return v_res_w;
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 #endif  // AOM_DSP_X86_BLEND_SSE4_H_
diff --git a/aom_dsp/x86/convolve.h b/aom_dsp/x86/convolve.h
index 8641164..c6c3b58 100644
--- a/aom_dsp/x86/convolve.h
+++ b/aom_dsp/x86/convolve.h
@@ -179,7 +179,6 @@
   }
 #endif
 
-#if CONFIG_HIGHBITDEPTH
 typedef void highbd_filter8_1dfunction(const uint16_t *src_ptr,
                                        const ptrdiff_t src_pitch,
                                        uint16_t *output_ptr,
@@ -283,6 +282,5 @@
                                     w, h, bd);                                \
     }                                                                         \
   }
-#endif  // CONFIG_HIGHBITDEPTH
 
 #endif  // AOM_DSP_X86_CONVOLVE_H_
diff --git a/aom_dsp/x86/fwd_txfm_sse2.c b/aom_dsp/x86/fwd_txfm_sse2.c
index 657dcfa..463d71f 100644
--- a/aom_dsp/x86/fwd_txfm_sse2.c
+++ b/aom_dsp/x86/fwd_txfm_sse2.c
@@ -107,7 +107,6 @@
 #undef FDCT32x32_HIGH_PRECISION
 #undef DCT_HIGH_BIT_DEPTH
 
-#if CONFIG_HIGHBITDEPTH
 #define DCT_HIGH_BIT_DEPTH 1
 #define FDCT4x4_2D aom_highbd_fdct4x4_sse2
 #define FDCT8x8_2D aom_highbd_fdct8x8_sse2
@@ -129,4 +128,3 @@
 #undef FDCT32x32_2D
 #undef FDCT32x32_HIGH_PRECISION
 #undef DCT_HIGH_BIT_DEPTH
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/x86/fwd_txfm_ssse3_x86_64.asm b/aom_dsp/x86/fwd_txfm_ssse3_x86_64.asm
index 8fa1c04..466d8f9 100644
--- a/aom_dsp/x86/fwd_txfm_ssse3_x86_64.asm
+++ b/aom_dsp/x86/fwd_txfm_ssse3_x86_64.asm
@@ -131,7 +131,6 @@
 %endmacro
 
 %macro STORE_OUTPUT 2 ; index, result
-%if CONFIG_HIGHBITDEPTH
   ; const __m128i sign_bits = _mm_cmplt_epi16(*poutput, zero);
   ; __m128i out0 = _mm_unpacklo_epi16(*poutput, sign_bits);
   ; __m128i out1 = _mm_unpackhi_epi16(*poutput, sign_bits);
@@ -144,9 +143,6 @@
   punpckhwd          m12, m11
   mova               [outputq + 4*%1 +  0], m%2
   mova               [outputq + 4*%1 + 16], m12
-%else
-  mova               [outputq + 2*%1], m%2
-%endif
 %endmacro
 
 INIT_XMM ssse3
diff --git a/aom_dsp/x86/inv_wht_sse2.asm b/aom_dsp/x86/inv_wht_sse2.asm
index f0668e6..0bc841a 100644
--- a/aom_dsp/x86/inv_wht_sse2.asm
+++ b/aom_dsp/x86/inv_wht_sse2.asm
@@ -85,15 +85,10 @@
 
 INIT_XMM sse2
 cglobal iwht4x4_16_add, 3, 3, 7, input, output, stride
-%if CONFIG_HIGHBITDEPTH
   mova            m0,        [inputq +  0]
   packssdw        m0,        [inputq + 16]
   mova            m1,        [inputq + 32]
   packssdw        m1,        [inputq + 48]
-%else
-  mova            m0,        [inputq +  0]
-  mova            m1,        [inputq + 16]
-%endif
   psraw           m0,        2
   psraw           m1,        2
 
diff --git a/aom_dsp/x86/masked_sad_intrin_ssse3.c b/aom_dsp/x86/masked_sad_intrin_ssse3.c
index 2536f91..1438948 100644
--- a/aom_dsp/x86/masked_sad_intrin_ssse3.c
+++ b/aom_dsp/x86/masked_sad_intrin_ssse3.c
@@ -239,7 +239,6 @@
   return (sad + 31) >> 6;
 }
 
-#if CONFIG_HIGHBITDEPTH
 // For width a multiple of 8
 static INLINE unsigned int highbd_masked_sad_ssse3(
     const uint8_t *src8, int src_stride, const uint8_t *a8, int a_stride,
@@ -424,5 +423,3 @@
   int sad = _mm_cvtsi128_si32(res);
   return (sad + 31) >> 6;
 }
-
-#endif
diff --git a/aom_dsp/x86/masked_variance_intrin_ssse3.c b/aom_dsp/x86/masked_variance_intrin_ssse3.c
index d9118e7..d670a4f 100644
--- a/aom_dsp/x86/masked_variance_intrin_ssse3.c
+++ b/aom_dsp/x86/masked_variance_intrin_ssse3.c
@@ -523,7 +523,6 @@
   *sse = _mm_cvtsi128_si32(_mm_srli_si128(sum, 4));
 }
 
-#if CONFIG_HIGHBITDEPTH
 // For width a multiple of 8
 static void highbd_bilinear_filter(const uint16_t *src, int src_stride,
                                    int xoffset, int yoffset, uint16_t *dst,
@@ -1040,5 +1039,3 @@
   *sum_ = _mm_cvtsi128_si32(sum);
   *sse = _mm_cvtsi128_si32(_mm_srli_si128(sum, 4));
 }
-
-#endif
diff --git a/aom_dsp/x86/obmc_sad_sse4.c b/aom_dsp/x86/obmc_sad_sse4.c
index 52dd508..c14351b 100644
--- a/aom_dsp/x86/obmc_sad_sse4.c
+++ b/aom_dsp/x86/obmc_sad_sse4.c
@@ -150,7 +150,6 @@
 // High bit-depth
 ////////////////////////////////////////////////////////////////////////////////
 
-#if CONFIG_HIGHBITDEPTH
 static INLINE unsigned int hbd_obmc_sad_w4(const uint8_t *pre8,
                                            const int pre_stride,
                                            const int32_t *wsrc,
@@ -276,4 +275,3 @@
 HBD_OBMCSADWXH(16, 64)
 HBD_OBMCSADWXH(64, 16)
 #endif
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/x86/obmc_variance_sse4.c b/aom_dsp/x86/obmc_variance_sse4.c
index 392616a..18f1203 100644
--- a/aom_dsp/x86/obmc_variance_sse4.c
+++ b/aom_dsp/x86/obmc_variance_sse4.c
@@ -163,7 +163,6 @@
 // High bit-depth
 ////////////////////////////////////////////////////////////////////////////////
 
-#if CONFIG_HIGHBITDEPTH
 static INLINE void hbd_obmc_variance_w4(
     const uint8_t *pre8, const int pre_stride, const int32_t *wsrc,
     const int32_t *mask, uint64_t *const sse, int64_t *const sum, const int h) {
@@ -377,4 +376,3 @@
 HBD_OBMCVARWXH(128, 32)
 #endif  // CONFIG_EXT_PARTITION
 #endif  // CONFIG_EXT_PARTITION_TYPES
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_dsp/x86/quantize_avx_x86_64.asm b/aom_dsp/x86/quantize_avx_x86_64.asm
index f6e2b17..e6b4026 100644
--- a/aom_dsp/x86/quantize_avx_x86_64.asm
+++ b/aom_dsp/x86/quantize_avx_x86_64.asm
@@ -44,16 +44,11 @@
   mova                            m0, [zbinq]              ; m0 = zbin
 
   ; Get DC and first 15 AC coeffs - in this special case, that is all.
-%if CONFIG_HIGHBITDEPTH
   ; coeff stored as 32bit numbers but we process them as 16 bit numbers
   mova                            m9, [coeffq]
   packssdw                        m9, [coeffq+16]          ; m9 = c[i]
   mova                           m10, [coeffq+32]
   packssdw                       m10, [coeffq+48]          ; m10 = c[i]
-%else
-  mova                            m9, [coeffq]             ; m9 = c[i]
-  mova                           m10, [coeffq+16]          ; m10 = c[i]
-%endif
 
   mov                             r0, eobmp                ; Output pointer
   mov                             r1, qcoeffmp             ; Output pointer
@@ -76,15 +71,10 @@
   ptest                          m14, m14
   jnz .single_nonzero
 
-%if CONFIG_HIGHBITDEPTH
   mova                       [r1   ], ymm5
   mova                       [r1+32], ymm5
   mova                       [r2   ], ymm5
   mova                       [r2+32], ymm5
-%else
-  mova                          [r1], ymm5
-  mova                          [r2], ymm5
-%endif
   mov                           [r0], word 0
 
   vzeroupper
@@ -124,7 +114,6 @@
   pand                            m8, m7
   pand                           m13, m12
 
-%if CONFIG_HIGHBITDEPTH
   ; Store 16bit numbers as 32bit numbers in array pointed to by qcoeff
   pcmpgtw                         m6, m5, m8
   punpckhwd                       m6, m8, m6
@@ -136,16 +125,11 @@
   pmovsxwd                       m11, m13
   mova                  [qcoeffq+32], m11
   mova                  [qcoeffq+48], m6
-%else
-  mova                  [qcoeffq   ], m8
-  mova                  [qcoeffq+16], m13
-%endif
 
   pmullw                          m8, m3                   ; dqc[i] = qc[i] * q
   punpckhqdq                      m3, m3
   pmullw                         m13, m3                   ; dqc[i] = qc[i] * q
 
-%if CONFIG_HIGHBITDEPTH
   ; Store 16bit numbers as 32bit numbers in array pointed to by qcoeff
   pcmpgtw                         m6, m5, m8
   punpckhwd                       m6, m8, m6
@@ -157,10 +141,6 @@
   pmovsxwd                       m11, m13
   mova                 [dqcoeffq+32], m11
   mova                 [dqcoeffq+48], m6
-%else
-  mova                 [dqcoeffq   ], m8
-  mova                 [dqcoeffq+16], m13
-%endif
 
   mova                            m6, [iscanq]            ; m6 = scan[i]
   mova                           m11, [iscanq+16]         ; m11 = scan[i]
@@ -229,29 +209,20 @@
 
   DEFINE_ARGS coeff, ncoeff, d1, qcoeff, dqcoeff, iscan, d2, d3, d4, d5, eob
 
-%if CONFIG_HIGHBITDEPTH
+
   lea                         coeffq, [  coeffq+ncoeffq*4]
   lea                        qcoeffq, [ qcoeffq+ncoeffq*4]
   lea                       dqcoeffq, [dqcoeffq+ncoeffq*4]
-%else
-  lea                         coeffq, [  coeffq+ncoeffq*2]
-  lea                        qcoeffq, [ qcoeffq+ncoeffq*2]
-  lea                       dqcoeffq, [dqcoeffq+ncoeffq*2]
-%endif
+
   lea                         iscanq, [  iscanq+ncoeffq*2]
   neg                        ncoeffq
 
   ; get DC and first 15 AC coeffs
-%if CONFIG_HIGHBITDEPTH
   ; coeff stored as 32bit numbers & require 16bit numbers
   mova                            m9, [coeffq+ncoeffq*4+ 0]
   packssdw                        m9, [coeffq+ncoeffq*4+16]
   mova                           m10, [coeffq+ncoeffq*4+32]
   packssdw                       m10, [coeffq+ncoeffq*4+48]
-%else
-  mova                            m9, [coeffq+ncoeffq*2+ 0] ; m9 = c[i]
-  mova                           m10, [coeffq+ncoeffq*2+16] ; m10 = c[i]
-%endif
 
   pabsw                           m6, m9                   ; m6 = abs(m9)
   pabsw                          m11, m10                  ; m11 = abs(m10)
@@ -264,16 +235,10 @@
   ptest                          m14, m14
   jnz .first_nonzero
 
-%if CONFIG_HIGHBITDEPTH
   mova        [qcoeffq+ncoeffq*4   ], ymm5
   mova        [qcoeffq+ncoeffq*4+32], ymm5
   mova       [dqcoeffq+ncoeffq*4   ], ymm5
   mova       [dqcoeffq+ncoeffq*4+32], ymm5
-%else
-  mova           [qcoeffq+ncoeffq*2], ymm5
-  mova          [dqcoeffq+ncoeffq*2], ymm5
-%endif
-
   add                        ncoeffq, mmsize
 
   punpckhqdq                      m1, m1
@@ -302,7 +267,6 @@
   pand                            m8, m7
   pand                           m13, m12
 
-%if CONFIG_HIGHBITDEPTH
   ; store 16bit numbers as 32bit numbers in array pointed to by qcoeff
   pcmpgtw                         m6, m5, m8
   punpckhwd                       m6, m8, m6
@@ -314,10 +278,6 @@
   pmovsxwd                       m11, m13
   mova        [qcoeffq+ncoeffq*4+32], m11
   mova        [qcoeffq+ncoeffq*4+48], m6
-%else
-  mova        [qcoeffq+ncoeffq*2+ 0], m8
-  mova        [qcoeffq+ncoeffq*2+16], m13
-%endif
 
 %ifidn %1, b_32x32
   pabsw                           m8, m8
@@ -333,7 +293,6 @@
   psignw                         m13, m10
 %endif
 
-%if CONFIG_HIGHBITDEPTH
   ; store 16bit numbers as 32bit numbers in array pointed to by qcoeff
   pcmpgtw                         m6, m5, m8
   punpckhwd                       m6, m8, m6
@@ -345,10 +304,6 @@
   pmovsxwd                       m11, m13
   mova       [dqcoeffq+ncoeffq*4+32], m11
   mova       [dqcoeffq+ncoeffq*4+48], m6
-%else
-  mova       [dqcoeffq+ncoeffq*2+ 0], m8
-  mova       [dqcoeffq+ncoeffq*2+16], m13
-%endif
 
   pcmpeqw                         m8, m5                    ; m8 = c[i] == 0
   pcmpeqw                        m13, m5                    ; m13 = c[i] == 0
@@ -363,16 +318,11 @@
 
 .ac_only_loop:
 
-%if CONFIG_HIGHBITDEPTH
   ; pack coeff from 32bit to 16bit array
   mova                            m9, [coeffq+ncoeffq*4+ 0]
   packssdw                        m9, [coeffq+ncoeffq*4+16]
   mova                           m10, [coeffq+ncoeffq*4+32]
   packssdw                       m10, [coeffq+ncoeffq*4+48]
-%else
-  mova                            m9, [coeffq+ncoeffq*2+ 0] ; m9 = c[i]
-  mova                           m10, [coeffq+ncoeffq*2+16] ; m10 = c[i]
-%endif
 
   pabsw                           m6, m9                   ; m6 = abs(m9)
   pabsw                          m11, m10                  ; m11 = abs(m10)
@@ -385,15 +335,11 @@
   ptest                          m14, m14
   jnz .rest_nonzero
 
-%if CONFIG_HIGHBITDEPTH
   mova        [qcoeffq+ncoeffq*4+ 0], ymm5
   mova        [qcoeffq+ncoeffq*4+32], ymm5
   mova       [dqcoeffq+ncoeffq*4+ 0], ymm5
   mova       [dqcoeffq+ncoeffq*4+32], ymm5
-%else
-  mova        [qcoeffq+ncoeffq*2+ 0], ymm5
-  mova       [dqcoeffq+ncoeffq*2+ 0], ymm5
-%endif
+
   add                        ncoeffq, mmsize
   jnz .ac_only_loop
 
@@ -424,7 +370,6 @@
   pand                           m14, m7
   pand                           m13, m12
 
-%if CONFIG_HIGHBITDEPTH
   ; store 16bit numbers as 32bit numbers in array pointed to by qcoeff
   pcmpgtw                         m6, m5, m14
   punpckhwd                       m6, m14, m6
@@ -436,10 +381,6 @@
   pmovsxwd                       m11, m13
   mova        [qcoeffq+ncoeffq*4+32], m11
   mova        [qcoeffq+ncoeffq*4+48], m6
-%else
-  mova        [qcoeffq+ncoeffq*2+ 0], m14
-  mova        [qcoeffq+ncoeffq*2+16], m13
-%endif
 
 %ifidn %1, b_32x32
   pabsw                          m14, m14
@@ -454,7 +395,6 @@
   psignw                         m13, m10
 %endif
 
-%if CONFIG_HIGHBITDEPTH
   ; store 16bit numbers as 32bit numbers in array pointed to by qcoeff
   pcmpgtw                         m6, m5, m14
   punpckhwd                       m6, m14, m6
@@ -466,10 +406,6 @@
   pmovsxwd                       m11, m13
   mova       [dqcoeffq+ncoeffq*4+32], m11
   mova       [dqcoeffq+ncoeffq*4+48], m6
-%else
-  mova       [dqcoeffq+ncoeffq*2+ 0], m14
-  mova       [dqcoeffq+ncoeffq*2+16], m13
-%endif
 
   pcmpeqw                        m14, m5                    ; m14 = c[i] == 0
   pcmpeqw                        m13, m5                    ; m13 = c[i] == 0
@@ -510,27 +446,16 @@
 
 DEFINE_ARGS dqcoeff, ncoeff, qcoeff, eob
 
-%if CONFIG_HIGHBITDEPTH
   lea                       dqcoeffq, [dqcoeffq+ncoeffq*4]
   lea                        qcoeffq, [ qcoeffq+ncoeffq*4]
-%else
-  lea                       dqcoeffq, [dqcoeffq+ncoeffq*2]
-  lea                        qcoeffq, [ qcoeffq+ncoeffq*2]
-%endif
-
   neg                        ncoeffq
   pxor                            m7, m7
 
 .blank_loop:
-%if CONFIG_HIGHBITDEPTH
   mova       [dqcoeffq+ncoeffq*4+ 0], ymm7
   mova       [dqcoeffq+ncoeffq*4+32], ymm7
   mova        [qcoeffq+ncoeffq*4+ 0], ymm7
   mova        [qcoeffq+ncoeffq*4+32], ymm7
-%else
-  mova       [dqcoeffq+ncoeffq*2+ 0], ymm7
-  mova        [qcoeffq+ncoeffq*2+ 0], ymm7
-%endif
   add                        ncoeffq, mmsize
   jl .blank_loop
 
diff --git a/aom_dsp/x86/quantize_ssse3_x86_64.asm b/aom_dsp/x86/quantize_ssse3_x86_64.asm
index 36b4ddd..7cf4bfa 100644
--- a/aom_dsp/x86/quantize_ssse3_x86_64.asm
+++ b/aom_dsp/x86/quantize_ssse3_x86_64.asm
@@ -56,29 +56,18 @@
 %endif
   pxor                            m5, m5                   ; m5 = dedicated zero
   DEFINE_ARGS coeff, ncoeff, d1, qcoeff, dqcoeff, iscan, d2, d3, d4, d5, eob
-%if CONFIG_HIGHBITDEPTH
   lea                         coeffq, [  coeffq+ncoeffq*4]
   lea                        qcoeffq, [ qcoeffq+ncoeffq*4]
   lea                       dqcoeffq, [dqcoeffq+ncoeffq*4]
-%else
-  lea                         coeffq, [  coeffq+ncoeffq*2]
-  lea                        qcoeffq, [ qcoeffq+ncoeffq*2]
-  lea                       dqcoeffq, [dqcoeffq+ncoeffq*2]
-%endif
   lea                         iscanq, [  iscanq+ncoeffq*2]
   neg                        ncoeffq
 
   ; get DC and first 15 AC coeffs
-%if CONFIG_HIGHBITDEPTH
   ; coeff stored as 32bit numbers & require 16bit numbers
   mova                            m9, [  coeffq+ncoeffq*4+ 0]
   packssdw                        m9, [  coeffq+ncoeffq*4+16]
   mova                           m10, [  coeffq+ncoeffq*4+32]
   packssdw                       m10, [  coeffq+ncoeffq*4+48]
-%else
-  mova                            m9, [  coeffq+ncoeffq*2+ 0] ; m9 = c[i]
-  mova                           m10, [  coeffq+ncoeffq*2+16] ; m10 = c[i]
-%endif
   pabsw                           m6, m9                   ; m6 = abs(m9)
   pabsw                          m11, m10                  ; m11 = abs(m10)
   pcmpgtw                         m7, m6, m0               ; m7 = c[i] >= zbin
@@ -99,7 +88,7 @@
   psignw                         m13, m10                  ; m13 = reinsert sign
   pand                            m8, m7
   pand                           m13, m12
-%if CONFIG_HIGHBITDEPTH
+
   ; store 16bit numbers as 32bit numbers in array pointed to by qcoeff
   mova                           m11, m8
   mova                            m6, m8
@@ -117,10 +106,7 @@
   mova        [qcoeffq+ncoeffq*4+32], m11
   mova        [qcoeffq+ncoeffq*4+48], m6
   pxor                            m5, m5             ; reset m5 to zero register
-%else
-  mova        [qcoeffq+ncoeffq*2+ 0], m8
-  mova        [qcoeffq+ncoeffq*2+16], m13
-%endif
+
 %ifidn %1, b_32x32
   pabsw                           m8, m8
   pabsw                          m13, m13
@@ -134,7 +120,6 @@
   psignw                          m8, m9
   psignw                         m13, m10
 %endif
-%if CONFIG_HIGHBITDEPTH
   ; store 16bit numbers as 32bit numbers in array pointed to by qcoeff
   mova                            m11, m8
   mova                            m6, m8
@@ -152,10 +137,6 @@
   mova       [dqcoeffq+ncoeffq*4+32], m11
   mova       [dqcoeffq+ncoeffq*4+48], m6
   pxor                            m5, m5             ; reset m5 to zero register
-%else
-  mova       [dqcoeffq+ncoeffq*2+ 0], m8
-  mova       [dqcoeffq+ncoeffq*2+16], m13
-%endif
   pcmpeqw                         m8, m5                   ; m8 = c[i] == 0
   pcmpeqw                        m13, m5                   ; m13 = c[i] == 0
   mova                            m6, [  iscanq+ncoeffq*2+ 0] ; m6 = scan[i]
@@ -169,16 +150,12 @@
   jz .accumulate_eob
 
 .ac_only_loop:
-%if CONFIG_HIGHBITDEPTH
   ; pack coeff from 32bit to 16bit array
   mova                            m9, [  coeffq+ncoeffq*4+ 0]
   packssdw                        m9, [  coeffq+ncoeffq*4+16]
   mova                           m10, [  coeffq+ncoeffq*4+32]
   packssdw                       m10, [  coeffq+ncoeffq*4+48]
-%else
-  mova                            m9, [  coeffq+ncoeffq*2+ 0] ; m9 = c[i]
-  mova                           m10, [  coeffq+ncoeffq*2+16] ; m10 = c[i]
-%endif
+
   pabsw                           m6, m9                   ; m6 = abs(m9)
   pabsw                          m11, m10                  ; m11 = abs(m10)
   pcmpgtw                         m7, m6, m0               ; m7 = c[i] >= zbin
@@ -201,7 +178,6 @@
   psignw                         m13, m10                  ; m13 = reinsert sign
   pand                           m14, m7
   pand                           m13, m12
-%if CONFIG_HIGHBITDEPTH
   ; store 16bit numbers as 32bit numbers in array pointed to by qcoeff
   pxor                           m11, m11
   mova                           m11, m14
@@ -220,10 +196,7 @@
   mova        [qcoeffq+ncoeffq*4+32], m11
   mova        [qcoeffq+ncoeffq*4+48], m6
   pxor                            m5, m5             ; reset m5 to zero register
-%else
-  mova        [qcoeffq+ncoeffq*2+ 0], m14
-  mova        [qcoeffq+ncoeffq*2+16], m13
-%endif
+
 %ifidn %1, b_32x32
   pabsw                          m14, m14
   pabsw                          m13, m13
@@ -236,7 +209,7 @@
   psignw                         m14, m9
   psignw                         m13, m10
 %endif
-%if CONFIG_HIGHBITDEPTH
+
   ; store 16bit numbers as 32bit numbers in array pointed to by qcoeff
   mova                           m11, m14
   mova                            m6, m14
@@ -254,10 +227,7 @@
   mova       [dqcoeffq+ncoeffq*4+32], m11
   mova       [dqcoeffq+ncoeffq*4+48], m6
   pxor                            m5, m5
-%else
-  mova       [dqcoeffq+ncoeffq*2+ 0], m14
-  mova       [dqcoeffq+ncoeffq*2+16], m13
-%endif
+
   pcmpeqw                        m14, m5                   ; m14 = c[i] == 0
   pcmpeqw                        m13, m5                   ; m13 = c[i] == 0
   mova                            m6, [  iscanq+ncoeffq*2+ 0] ; m6 = scan[i]
@@ -274,7 +244,6 @@
 %ifidn %1, b_32x32
   jmp .accumulate_eob
 .skip_iter:
-%if CONFIG_HIGHBITDEPTH
   mova        [qcoeffq+ncoeffq*4+ 0], m5
   mova        [qcoeffq+ncoeffq*4+16], m5
   mova        [qcoeffq+ncoeffq*4+32], m5
@@ -283,12 +252,6 @@
   mova       [dqcoeffq+ncoeffq*4+16], m5
   mova       [dqcoeffq+ncoeffq*4+32], m5
   mova       [dqcoeffq+ncoeffq*4+48], m5
-%else
-  mova        [qcoeffq+ncoeffq*2+ 0], m5
-  mova        [qcoeffq+ncoeffq*2+16], m5
-  mova       [dqcoeffq+ncoeffq*2+ 0], m5
-  mova       [dqcoeffq+ncoeffq*2+16], m5
-%endif
   add                        ncoeffq, mmsize
   jl .ac_only_loop
 %endif
@@ -313,17 +276,11 @@
   mov                             r2, qcoeffmp
   mov                             r3, eobmp
   DEFINE_ARGS dqcoeff, ncoeff, qcoeff, eob
-%if CONFIG_HIGHBITDEPTH
   lea                       dqcoeffq, [dqcoeffq+ncoeffq*4]
   lea                        qcoeffq, [ qcoeffq+ncoeffq*4]
-%else
-  lea                       dqcoeffq, [dqcoeffq+ncoeffq*2]
-  lea                        qcoeffq, [ qcoeffq+ncoeffq*2]
-%endif
   neg                        ncoeffq
   pxor                            m7, m7
 .blank_loop:
-%if CONFIG_HIGHBITDEPTH
   mova       [dqcoeffq+ncoeffq*4+ 0], m7
   mova       [dqcoeffq+ncoeffq*4+16], m7
   mova       [dqcoeffq+ncoeffq*4+32], m7
@@ -332,12 +289,6 @@
   mova        [qcoeffq+ncoeffq*4+16], m7
   mova        [qcoeffq+ncoeffq*4+32], m7
   mova        [qcoeffq+ncoeffq*4+48], m7
-%else
-  mova       [dqcoeffq+ncoeffq*2+ 0], m7
-  mova       [dqcoeffq+ncoeffq*2+16], m7
-  mova        [qcoeffq+ncoeffq*2+ 0], m7
-  mova        [qcoeffq+ncoeffq*2+16], m7
-%endif
   add                        ncoeffq, mmsize
   jl .blank_loop
   mov                    word [eobq], 0
diff --git a/aom_mem/aom_mem.c b/aom_mem/aom_mem.c
index 2698f3c..a8ee3ba 100644
--- a/aom_mem/aom_mem.c
+++ b/aom_mem/aom_mem.c
@@ -80,11 +80,9 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 void *aom_memset16(void *dest, int val, size_t length) {
   size_t i;
   uint16_t *dest16 = (uint16_t *)dest;
   for (i = 0; i < length; i++) *dest16++ = val;
   return dest;
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/aom_mem/aom_mem.h b/aom_mem/aom_mem.h
index 0d533c8..0c65c5d 100644
--- a/aom_mem/aom_mem.h
+++ b/aom_mem/aom_mem.h
@@ -28,10 +28,7 @@
 void *aom_malloc(size_t size);
 void *aom_calloc(size_t num, size_t size);
 void aom_free(void *memblk);
-
-#if CONFIG_HIGHBITDEPTH
 void *aom_memset16(void *dest, int val, size_t length);
-#endif
 
 #include <string.h>
 
diff --git a/aom_scale/generic/yv12config.c b/aom_scale/generic/yv12config.c
index 9ec602a..de9759d 100644
--- a/aom_scale/generic/yv12config.c
+++ b/aom_scale/generic/yv12config.c
@@ -33,10 +33,7 @@
     if (ybf->buffer_alloc_sz > 0) {
       aom_free(ybf->buffer_alloc);
     }
-
-#if CONFIG_HIGHBITDEPTH
     if (ybf->y_buffer_8bit) aom_free(ybf->y_buffer_8bit);
-#endif
 
     /* buffer_alloc isn't accessed by most functions.  Rather y_buffer,
       u_buffer and v_buffer point to buffer_alloc and are used.  Clear out
@@ -50,10 +47,7 @@
 }
 
 int aom_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
-                             int ss_x, int ss_y,
-#if CONFIG_HIGHBITDEPTH
-                             int use_highbitdepth,
-#endif
+                             int ss_x, int ss_y, int use_highbitdepth,
                              int border, int byte_alignment,
                              aom_codec_frame_buffer_t *fb,
                              aom_get_frame_buffer_cb_fn_t cb, void *cb_priv) {
@@ -72,12 +66,8 @@
     const uint64_t uvplane_size =
         (uv_height + 2 * uv_border_h) * (uint64_t)uv_stride + byte_alignment;
 
-#if CONFIG_HIGHBITDEPTH
     const uint64_t frame_size =
         (1 + use_highbitdepth) * (yplane_size + 2 * uvplane_size);
-#else
-    const uint64_t frame_size = yplane_size + 2 * uvplane_size;
-#endif  // CONFIG_HIGHBITDEPTH
 
     uint8_t *buf = NULL;
 
@@ -147,7 +137,6 @@
     ybf->subsampling_y = ss_y;
 
     buf = ybf->buffer_alloc;
-#if CONFIG_HIGHBITDEPTH
     if (use_highbitdepth) {
       // Store uint16 addresses when using 16bit framebuffers
       buf = CONVERT_TO_BYTEPTR(ybf->buffer_alloc);
@@ -155,7 +144,6 @@
     } else {
       ybf->flags = 0;
     }
-#endif  // CONFIG_HIGHBITDEPTH
 
     ybf->y_buffer = (uint8_t *)yv12_align_addr(
         buf + (border * y_stride) + border, aom_byte_align);
@@ -167,7 +155,6 @@
                                        (uv_border_h * uv_stride) + uv_border_w,
                                    aom_byte_align);
 
-#if CONFIG_HIGHBITDEPTH
     if (use_highbitdepth) {
       if (ybf->y_buffer_8bit) aom_free(ybf->y_buffer_8bit);
       ybf->y_buffer_8bit = (uint8_t *)aom_memalign(32, (size_t)yplane_size);
@@ -175,7 +162,6 @@
     } else {
       assert(!ybf->y_buffer_8bit);
     }
-#endif
 
     ybf->corrupted = 0; /* assume not corrupted by errors */
     return 0;
@@ -184,18 +170,13 @@
 }
 
 int aom_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
-                           int ss_x, int ss_y,
-#if CONFIG_HIGHBITDEPTH
-                           int use_highbitdepth,
-#endif
-                           int border, int byte_alignment) {
+                           int ss_x, int ss_y, int use_highbitdepth, int border,
+                           int byte_alignment) {
   if (ybf) {
     aom_free_frame_buffer(ybf);
     return aom_realloc_frame_buffer(ybf, width, height, ss_x, ss_y,
-#if CONFIG_HIGHBITDEPTH
-                                    use_highbitdepth,
-#endif
-                                    border, byte_alignment, NULL, NULL, NULL);
+                                    use_highbitdepth, border, byte_alignment,
+                                    NULL, NULL, NULL);
   }
   return -2;
 }
diff --git a/aom_scale/generic/yv12extend.c b/aom_scale/generic/yv12extend.c
index 8266743..3cfed30 100644
--- a/aom_scale/generic/yv12extend.c
+++ b/aom_scale/generic/yv12extend.c
@@ -57,7 +57,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void extend_plane_high(uint8_t *const src8, int src_stride, int width,
                               int height, int extend_top, int extend_left,
                               int extend_bottom, int extend_right) {
@@ -98,7 +97,6 @@
     dst_ptr2 += src_stride;
   }
 }
-#endif
 
 void aom_yv12_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf) {
   assert(ybf->border % 2 == 0);
@@ -107,7 +105,6 @@
   assert(ybf->y_height - ybf->y_crop_height >= 0);
   assert(ybf->y_width - ybf->y_crop_width >= 0);
 
-#if CONFIG_HIGHBITDEPTH
   if (ybf->flags & YV12_FLAG_HIGHBITDEPTH) {
     for (int plane = 0; plane < 3; ++plane) {
       const int is_uv = plane > 0;
@@ -120,7 +117,6 @@
     }
     return;
   }
-#endif
   for (int plane = 0; plane < 3; ++plane) {
     const int is_uv = plane > 0;
     const int plane_border = ybf->border >> is_uv;
@@ -142,7 +138,6 @@
   assert(ybf->y_height - ybf->y_crop_height >= 0);
   assert(ybf->y_width - ybf->y_crop_width >= 0);
 
-#if CONFIG_HIGHBITDEPTH
   if (ybf->flags & YV12_FLAG_HIGHBITDEPTH) {
     for (int plane = 0; plane < 3; ++plane) {
       const int is_uv = plane > 0;
@@ -156,7 +151,6 @@
     }
     return;
   }
-#endif
   for (int plane = 0; plane < 3; ++plane) {
     const int is_uv = plane > 0;
     const int top = ext_size >> (is_uv ? ss_y : 0);
@@ -187,7 +181,6 @@
   assert(ybf->y_height - ybf->y_crop_height >= 0);
   assert(ybf->y_width - ybf->y_crop_width >= 0);
 
-#if CONFIG_HIGHBITDEPTH
   if (ybf->flags & YV12_FLAG_HIGHBITDEPTH) {
     extend_plane_high(ybf->y_buffer, ybf->y_stride, ybf->y_crop_width,
                       ybf->y_crop_height, ext_size, ext_size,
@@ -195,7 +188,6 @@
                       ext_size + ybf->y_width - ybf->y_crop_width);
     return;
   }
-#endif
   extend_plane(ybf->y_buffer, ybf->y_stride, ybf->y_crop_width,
                ybf->y_crop_height, ext_size, ext_size,
                ext_size + ybf->y_height - ybf->y_crop_height,
@@ -203,13 +195,11 @@
 }
 #endif  // CONFIG_AV1
 
-#if CONFIG_HIGHBITDEPTH
 static void memcpy_short_addr(uint8_t *dst8, const uint8_t *src8, int num) {
   uint16_t *dst = CONVERT_TO_SHORTPTR(dst8);
   uint16_t *src = CONVERT_TO_SHORTPTR(src8);
   memcpy(dst, src, num * sizeof(uint16_t));
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 // Copies the source image into the destination image and updates the
 // destination's UMV borders.
@@ -224,7 +214,6 @@
   assert(src_bc->y_height == dst_bc->y_height);
 #endif
 
-#if CONFIG_HIGHBITDEPTH
   assert((src_bc->flags & YV12_FLAG_HIGHBITDEPTH) ==
          (dst_bc->flags & YV12_FLAG_HIGHBITDEPTH));
 
@@ -243,7 +232,6 @@
     aom_yv12_extend_frame_borders_c(dst_bc);
     return;
   }
-#endif
   for (int plane = 0; plane < 3; ++plane) {
     const uint8_t *plane_src = src_bc->buffers[plane];
     uint8_t *plane_dst = dst_bc->buffers[plane];
@@ -264,7 +252,6 @@
   const uint8_t *src = src_ybc->y_buffer;
   uint8_t *dst = dst_ybc->y_buffer;
 
-#if CONFIG_HIGHBITDEPTH
   if (src_ybc->flags & YV12_FLAG_HIGHBITDEPTH) {
     const uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
     uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst);
@@ -275,7 +262,6 @@
     }
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
 
   for (row = 0; row < src_ybc->y_height; ++row) {
     memcpy(dst, src, src_ybc->y_width);
@@ -290,7 +276,6 @@
   const uint8_t *src = src_bc->u_buffer;
   uint8_t *dst = dst_bc->u_buffer;
 
-#if CONFIG_HIGHBITDEPTH
   if (src_bc->flags & YV12_FLAG_HIGHBITDEPTH) {
     const uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
     uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst);
@@ -301,7 +286,6 @@
     }
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
 
   for (row = 0; row < src_bc->uv_height; ++row) {
     memcpy(dst, src, src_bc->uv_width);
@@ -316,7 +300,6 @@
   const uint8_t *src = src_bc->v_buffer;
   uint8_t *dst = dst_bc->v_buffer;
 
-#if CONFIG_HIGHBITDEPTH
   if (src_bc->flags & YV12_FLAG_HIGHBITDEPTH) {
     const uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
     uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst);
@@ -327,7 +310,6 @@
     }
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
 
   for (row = 0; row < src_bc->uv_height; ++row) {
     memcpy(dst, src, src_bc->uv_width);
diff --git a/aom_scale/yv12config.h b/aom_scale/yv12config.h
index df825bb..71799c3 100644
--- a/aom_scale/yv12config.h
+++ b/aom_scale/yv12config.h
@@ -86,12 +86,10 @@
     uint8_t *buffers[4];
   };
 
-#if CONFIG_HIGHBITDEPTH
   // If the frame is stored in a 16-bit buffer, this stores an 8-bit version
   // for use in global motion detection. It is allocated on-demand.
   uint8_t *y_buffer_8bit;
   int buf_8bit_valid;
-#endif
 
   uint8_t *buffer_alloc;
   size_t buffer_alloc_sz;
@@ -114,11 +112,8 @@
 #define YV12_FLAG_HIGHBITDEPTH 8
 
 int aom_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
-                           int ss_x, int ss_y,
-#if CONFIG_HIGHBITDEPTH
-                           int use_highbitdepth,
-#endif
-                           int border, int byte_alignment);
+                           int ss_x, int ss_y, int use_highbitdepth, int border,
+                           int byte_alignment);
 
 // 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
@@ -128,10 +123,7 @@
 // internally to decode the current frame. Returns 0 on success. Returns < 0
 // on failure.
 int aom_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
-                             int ss_x, int ss_y,
-#if CONFIG_HIGHBITDEPTH
-                             int use_highbitdepth,
-#endif
+                             int ss_x, int ss_y, int use_highbitdepth,
                              int border, int byte_alignment,
                              aom_codec_frame_buffer_t *fb,
                              aom_get_frame_buffer_cb_fn_t cb, void *cb_priv);
diff --git a/aomdec.c b/aomdec.c
index c1144e3..72faa21 100644
--- a/aomdec.c
+++ b/aomdec.c
@@ -104,10 +104,8 @@
     ARG_DEF(NULL, "md5", 0, "Compute the MD5 sum of the decoded frame");
 static const arg_def_t framestatsarg =
     ARG_DEF(NULL, "framestats", 1, "Output per-frame stats (.csv format)");
-#if CONFIG_HIGHBITDEPTH
 static const arg_def_t outbitdeptharg =
     ARG_DEF(NULL, "output-bit-depth", 1, "Output bit-depth for decoded frames");
-#endif
 #if CONFIG_EXT_TILE
 static const arg_def_t tiler = ARG_DEF(NULL, "tile-row", 1,
                                        "Row index of tile to decode "
@@ -117,40 +115,21 @@
                                        "(-1 for all columns)");
 #endif  // CONFIG_EXT_TILE
 
-static const arg_def_t *all_args[] = { &help,
-                                       &codecarg,
-                                       &use_yv12,
-                                       &use_i420,
-                                       &flipuvarg,
-                                       &rawvideo,
-                                       &noblitarg,
-                                       &progressarg,
-                                       &limitarg,
-                                       &skiparg,
-                                       &postprocarg,
-                                       &summaryarg,
-                                       &outputfile,
-                                       &threadsarg,
-                                       &frameparallelarg,
-                                       &verbosearg,
-                                       &scalearg,
-                                       &fb_arg,
-                                       &md5arg,
-                                       &framestatsarg,
-                                       &continuearg,
-#if CONFIG_HIGHBITDEPTH
-                                       &outbitdeptharg,
-#endif
+static const arg_def_t *all_args[] = {
+  &help,        &codecarg,       &use_yv12,    &use_i420,   &flipuvarg,
+  &rawvideo,    &noblitarg,      &progressarg, &limitarg,   &skiparg,
+  &postprocarg, &summaryarg,     &outputfile,  &threadsarg, &frameparallelarg,
+  &verbosearg,  &scalearg,       &fb_arg,      &md5arg,     &framestatsarg,
+  &continuearg, &outbitdeptharg,
 #if CONFIG_EXT_TILE
-                                       &tiler,
-                                       &tilec,
+  &tiler,       &tilec,
 #endif  // CONFIG_EXT_TILE
-                                       NULL };
+  NULL
+};
 
 #if CONFIG_LIBYUV
 static INLINE int libyuv_scale(aom_image_t *src, aom_image_t *dst,
                                FilterModeEnum mode) {
-#if CONFIG_HIGHBITDEPTH
   if (src->fmt == AOM_IMG_FMT_I42016) {
     assert(dst->fmt == AOM_IMG_FMT_I42016);
     return I420Scale_16(
@@ -162,7 +141,6 @@
         dst->stride[AOM_PLANE_U] / 2, (uint16_t *)dst->planes[AOM_PLANE_V],
         dst->stride[AOM_PLANE_V] / 2, dst->d_w, dst->d_h, mode);
   }
-#endif
   assert(src->fmt == AOM_IMG_FMT_I420);
   assert(dst->fmt == AOM_IMG_FMT_I420);
   return I420Scale(src->planes[AOM_PLANE_Y], src->stride[AOM_PLANE_Y],
@@ -302,11 +280,7 @@
 static void write_image_file(const aom_image_t *img, const int *planes,
                              const int num_planes, FILE *file) {
   int i, y;
-#if CONFIG_HIGHBITDEPTH
   const int bytes_per_sample = ((img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) ? 2 : 1);
-#else
-  const int bytes_per_sample = 1;
-#endif
 
   for (i = 0; i < num_planes; ++i) {
     const int plane = planes[i];
@@ -501,14 +475,12 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static int img_shifted_realloc_required(const aom_image_t *img,
                                         const aom_image_t *shifted,
                                         aom_img_fmt_t required_fmt) {
   return img->d_w != shifted->d_w || img->d_h != shifted->d_h ||
          required_fmt != shifted->fmt;
 }
-#endif
 
 static int main_loop(int argc, const char **argv_) {
   aom_codec_ctx_t decoder;
@@ -534,9 +506,7 @@
   int opt_yv12 = 0;
   int opt_i420 = 0;
   aom_codec_dec_cfg_t cfg = { 0, 0, 0, CONFIG_LOWBITDEPTH };
-#if CONFIG_HIGHBITDEPTH
   unsigned int output_bit_depth = 0;
-#endif
 #if CONFIG_EXT_TILE
   int tile_row = -1;
   int tile_col = -1;
@@ -545,9 +515,7 @@
   int dec_flags = 0;
   int do_scale = 0;
   aom_image_t *scaled_img = NULL;
-#if CONFIG_HIGHBITDEPTH
   aom_image_t *img_shifted = NULL;
-#endif
   int frame_avail, got_data, flush_decoder = 0;
   int num_external_frame_buffers = 0;
   struct ExternalFrameBufferList ext_fb_list = { 0, NULL };
@@ -636,11 +604,9 @@
       num_external_frame_buffers = arg_parse_uint(&arg);
     else if (arg_match(&arg, &continuearg, argi))
       keep_going = 1;
-#if CONFIG_HIGHBITDEPTH
     else if (arg_match(&arg, &outbitdeptharg, argi)) {
       output_bit_depth = arg_parse_uint(&arg);
     }
-#endif
 #if CONFIG_EXT_TILE
     else if (arg_match(&arg, &tiler, argi))
       tile_row = arg_parse_int(&arg);
@@ -905,7 +871,6 @@
 #endif
         }
       }
-#if CONFIG_HIGHBITDEPTH
       // Default to codec bit depth if output bit depth not set
       if (!output_bit_depth && single_file && !do_md5) {
         output_bit_depth = img->bit_depth;
@@ -938,7 +903,6 @@
           img = img_shifted;
         }
       }
-#endif
 
 #if CONFIG_EXT_TILE
       aom_input_ctx.width = img->d_w;
@@ -1060,9 +1024,7 @@
   if (input.aom_input_ctx->file_type != FILE_TYPE_WEBM) free(buf);
 
   if (scaled_img) aom_img_free(scaled_img);
-#if CONFIG_HIGHBITDEPTH
   if (img_shifted) aom_img_free(img_shifted);
-#endif
 
   for (i = 0; i < ext_fb_list.num_external_frame_buffers; ++i) {
     free(ext_fb_list.ext_fb[i].data);
diff --git a/aomenc.c b/aomenc.c
index f84f9cd..074ce9e 100644
--- a/aomenc.c
+++ b/aomenc.c
@@ -197,8 +197,6 @@
 static const arg_def_t disable_warning_prompt =
     ARG_DEF("y", "disable-warning-prompt", 0,
             "Display warnings, but do not prompt user to continue.");
-
-#if CONFIG_HIGHBITDEPTH
 static const struct arg_enum_list bitdepth_enum[] = {
   { "8", AOM_BITS_8 }, { "10", AOM_BITS_10 }, { "12", AOM_BITS_12 }, { NULL, 0 }
 };
@@ -209,8 +207,6 @@
     bitdepth_enum);
 static const arg_def_t inbitdeptharg =
     ARG_DEF(NULL, "input-bit-depth", 1, "Bit depth of input");
-#endif
-
 static const arg_def_t *main_args[] = { &help,
                                         &debugmode,
                                         &outputfile,
@@ -286,9 +282,7 @@
                                           &timebase,
                                           &framerate,
                                           &error_resilient,
-#if CONFIG_HIGHBITDEPTH
                                           &bitdeptharg,
-#endif
                                           &lag_in_frames,
 #if CONFIG_EXT_TILE
                                           &large_scale_tile,
@@ -633,10 +627,8 @@
 #if CONFIG_TEMPMV_SIGNALING
                                        &disable_tempmv,
 #endif
-#if CONFIG_HIGHBITDEPTH
                                        &bitdeptharg,
                                        &inbitdeptharg,
-#endif  // CONFIG_HIGHBITDEPTH
                                        NULL };
 static const int av1_arg_ctrl_map[] = { AOME_SET_CPUUSED,
                                         AOME_SET_DEVSF,
@@ -1125,12 +1117,10 @@
       config->cfg.g_w = arg_parse_uint(&arg);
     } else if (arg_match(&arg, &height, argi)) {
       config->cfg.g_h = arg_parse_uint(&arg);
-#if CONFIG_HIGHBITDEPTH
     } else if (arg_match(&arg, &bitdeptharg, argi)) {
       config->cfg.g_bit_depth = arg_parse_enum_or_int(&arg);
     } else if (arg_match(&arg, &inbitdeptharg, argi)) {
       config->cfg.g_input_bit_depth = arg_parse_uint(&arg);
-#endif
 #if CONFIG_WEBM_IO
     } else if (arg_match(&arg, &stereo_mode, argi)) {
       config->stereo_fmt = arg_parse_enum_or_int(&arg);
@@ -1225,10 +1215,8 @@
       if (!match) argj++;
     }
   }
-#if CONFIG_HIGHBITDEPTH
   config->use_16bit_internal =
       config->cfg.g_bit_depth > AOM_BITS_8 || !CONFIG_LOWBITDEPTH;
-#endif
   return eos_mark_found;
 }
 
@@ -1494,9 +1482,7 @@
 
   flags |= global->show_psnr ? AOM_CODEC_USE_PSNR : 0;
   flags |= global->out_part ? AOM_CODEC_USE_OUTPUT_PARTITION : 0;
-#if CONFIG_HIGHBITDEPTH
   flags |= stream->config.use_16bit_internal ? AOM_CODEC_USE_HIGHBITDEPTH : 0;
-#endif
 
   /* Construct Encoder Context */
   aom_codec_enc_init(&stream->encoder, global->codec->codec_interface(),
@@ -1549,8 +1535,7 @@
       (cfg->g_timebase.den * (int64_t)(frames_in)*global->framerate.den) /
       cfg->g_timebase.num / global->framerate.num;
 
-/* Scale if necessary */
-#if CONFIG_HIGHBITDEPTH
+  /* Scale if necessary */
   if (img) {
     if ((img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) &&
         (img->d_w != cfg->g_w || img->d_h != cfg->g_h)) {
@@ -1585,7 +1570,6 @@
 #endif
     }
   }
-#endif
   if (img && (img->d_w != cfg->g_w || img->d_h != cfg->g_h)) {
     if (img->fmt != AOM_IMG_FMT_I420 && img->fmt != AOM_IMG_FMT_YV12) {
       fprintf(stderr, "%s can only scale 4:2:0 8bpp inputs\n", exec_name);
@@ -1767,7 +1751,6 @@
   aom_codec_control(&stream->encoder, AV1_GET_NEW_FRAME_IMAGE, &enc_img);
   aom_codec_control(&stream->decoder, AV1_GET_NEW_FRAME_IMAGE, &dec_img);
 
-#if CONFIG_HIGHBITDEPTH
   if ((enc_img.fmt & AOM_IMG_FMT_HIGHBITDEPTH) !=
       (dec_img.fmt & AOM_IMG_FMT_HIGHBITDEPTH)) {
     if (enc_img.fmt & AOM_IMG_FMT_HIGHBITDEPTH) {
@@ -1785,22 +1768,17 @@
       dec_img = dec_hbd_img;
     }
   }
-#endif
 
   ctx_exit_on_error(&stream->encoder, "Failed to get encoder reference frame");
   ctx_exit_on_error(&stream->decoder, "Failed to get decoder reference frame");
 
   if (!aom_compare_img(&enc_img, &dec_img)) {
     int y[4], u[4], v[4];
-#if CONFIG_HIGHBITDEPTH
     if (enc_img.fmt & AOM_IMG_FMT_HIGHBITDEPTH) {
       aom_find_mismatch_high(&enc_img, &dec_img, y, u, v);
     } else {
       aom_find_mismatch(&enc_img, &dec_img, y, u, v);
     }
-#else
-    aom_find_mismatch(&enc_img, &dec_img, y, u, v);
-#endif
     stream->decoder.err = 1;
     warn_or_exit_on_error(&stream->decoder, fatal == TEST_DECODE_FATAL,
                           "Stream %d: Encode/decode mismatch on frame %d at"
@@ -1838,12 +1816,10 @@
 int main(int argc, const char **argv_) {
   int pass;
   aom_image_t raw;
-#if CONFIG_HIGHBITDEPTH
   aom_image_t raw_shift;
   int allocated_raw_shift = 0;
   int use_16bit_internal = 0;
   int input_shift = 0;
-#endif
   int frame_avail, got_data;
 
   struct AvxInputContext input;
@@ -1999,7 +1975,6 @@
         }
       }
       if (stream->config.cfg.g_profile > 1) {
-        if (!CONFIG_HIGHBITDEPTH) fatal("Unsupported profile.");
         stream->config.use_16bit_internal = 1;
       }
       if (profile_updated && !global.quiet) {
@@ -2084,8 +2059,6 @@
       open_output_file(stream, &global, &input.pixel_aspect_ratio);
     }
     FOREACH_STREAM(stream, streams) { initialize_encoder(stream, &global); }
-
-#if CONFIG_HIGHBITDEPTH
     if (strcmp(global.codec->name, "av1") == 0 ||
         strcmp(global.codec->name, "av1") == 0) {
       // Check to see if at least one stream uses 16 bit internal.
@@ -2103,7 +2076,6 @@
         }
       };
     }
-#endif
 
     frame_avail = 1;
     got_data = 0;
@@ -2140,7 +2112,6 @@
       }
 
       if (frames_in > global.skip_frames) {
-#if CONFIG_HIGHBITDEPTH
         aom_image_t *frame_to_encode;
         if (input_shift || (use_16bit_internal && input.bit_depth == 8)) {
           assert(use_16bit_internal);
@@ -2173,12 +2144,6 @@
                          frames_in);
           }
         }
-#else
-        aom_usec_timer_start(&timer);
-        FOREACH_STREAM(stream, streams) {
-          encode_frame(stream, &global, frame_avail ? &raw : NULL, frames_in);
-        }
-#endif
         aom_usec_timer_mark(&timer);
         cx_time += aom_usec_timer_elapsed(&timer);
 
@@ -2320,9 +2285,7 @@
   }
 #endif
 
-#if CONFIG_HIGHBITDEPTH
   if (allocated_raw_shift) aom_img_free(&raw_shift);
-#endif
   aom_img_free(&raw);
   free(argv);
   free(streams);
diff --git a/av1/av1.cmake b/av1/av1.cmake
index ad51fbf..a0a4f99 100644
--- a/av1/av1.cmake
+++ b/av1/av1.cmake
@@ -237,20 +237,10 @@
     "${AOM_ROOT}/av1/encoder/mips/msa/fdct_msa.h"
     "${AOM_ROOT}/av1/encoder/mips/msa/temporal_filter_msa.c")
 
-if (CONFIG_HIGHBITDEPTH)
+
   set(AOM_AV1_COMMON_INTRIN_SSE4_1
       ${AOM_AV1_COMMON_INTRIN_SSE4_1}
       "${AOM_ROOT}/av1/common/x86/av1_highbd_convolve_sse4.c")
-else ()
-  set(AOM_AV1_COMMON_INTRIN_NEON
-      ${AOM_AV1_COMMON_INTRIN_NEON}
-      "${AOM_ROOT}/av1/common/arm/neon/iht4x4_add_neon.c"
-      "${AOM_ROOT}/av1/common/arm/neon/iht8x8_add_neon.c")
-
-  set(AOM_AV1_ENCODER_INTRIN_NEON
-      ${AOM_AV1_ENCODER_INTRIN_NEON}
-      "${AOM_ROOT}/av1/encoder/arm/neon/error_neon.c")
-endif ()
 
 set(AOM_AV1_COMMON_SOURCES
     ${AOM_AV1_COMMON_SOURCES}
@@ -291,7 +281,7 @@
     ${AOM_AV1_COMMON_INTRIN_AVX2}
     "${AOM_ROOT}/av1/common/x86/convolve_2d_avx2.c")
 
-if (CONFIG_HIGHBITDEPTH)
+
   set(AOM_AV1_COMMON_INTRIN_AVX2
       ${AOM_AV1_COMMON_INTRIN_AVX2}
       "${AOM_ROOT}/av1/common/x86/highbd_convolve_2d_avx2.c")
@@ -305,7 +295,6 @@
         ${AOM_AV1_COMMON_INTRIN_SSE4_1}
         "${AOM_ROOT}/av1/common/x86/highbd_convolve_2d_sse4.c")
   endif ()
-endif ()
 
 if (CONFIG_JNT_COMP)
   set(AOM_AV1_COMMON_INTRIN_SSE4_1
@@ -460,7 +449,6 @@
       "${AOM_ROOT}/av1/common/x86/warp_plane_sse4.c")
 endif ()
 
-if (CONFIG_HIGHBITDEPTH)
   set(AOM_AV1_COMMON_INTRIN_SSSE3
       ${AOM_AV1_COMMON_INTRIN_SSSE3}
       "${AOM_ROOT}/av1/common/x86/highbd_warp_plane_ssse3.c")
@@ -470,7 +458,6 @@
         ${AOM_AV1_COMMON_INTRIN_SSE4_1}
         "${AOM_ROOT}/av1/common/x86/highbd_warp_plane_sse4.c")
   endif ()
-endif ()
 
 if (CONFIG_HASH_ME)
   set(AOM_AV1_ENCODER_SOURCES
diff --git a/av1/av1_common.mk b/av1/av1_common.mk
index 86faa45..4063fce 100644
--- a/av1/av1_common.mk
+++ b/av1/av1_common.mk
@@ -79,9 +79,7 @@
 AV1_COMMON_SRCS-$(HAVE_AVX2) += common/x86/convolve_avx2.c
 AV1_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/av1_convolve_ssse3.c
 AV1_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/av1_convolve_scale_sse4.c
-ifeq ($(CONFIG_HIGHBITDEPTH),yes)
 AV1_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/av1_highbd_convolve_sse4.c
-endif
 AV1_COMMON_SRCS-yes += common/convolve.c
 AV1_COMMON_SRCS-yes += common/convolve.h
 ifeq ($(CONFIG_LOOP_RESTORATION),yes)
@@ -128,22 +126,16 @@
 AV1_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/highbd_inv_txfm_sse4.c
 AV1_COMMON_SRCS-$(HAVE_AVX2) += common/x86/highbd_inv_txfm_avx2.c
 
-ifneq ($(CONFIG_HIGHBITDEPTH),yes)
-AV1_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/iht4x4_add_neon.c
-AV1_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/iht8x8_add_neon.c
-endif
-
 AV1_COMMON_SRCS-$(HAVE_SSE2) += common/x86/warp_plane_sse2.c
 AV1_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/warp_plane_ssse3.c
 ifeq ($(CONFIG_JNT_COMP), yes)
 AV1_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/warp_plane_sse4.c
 endif
-ifeq ($(CONFIG_HIGHBITDEPTH),yes)
 AV1_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/highbd_warp_plane_ssse3.c
 ifeq ($(CONFIG_JNT_COMP), yes)
 AV1_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/highbd_warp_plane_sse4.c
 endif
-endif
+
 
 AV1_COMMON_SRCS-$(HAVE_SSE2) += common/x86/convolve_sse2.c
 AV1_COMMON_SRCS-$(HAVE_SSE2) += common/x86/convolve_2d_sse2.c
@@ -151,13 +143,11 @@
 AV1_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/convolve_2d_sse4.c
 endif
 AV1_COMMON_SRCS-$(HAVE_AVX2) += common/x86/convolve_2d_avx2.c
-ifeq ($(CONFIG_HIGHBITDEPTH),yes)
 AV1_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/highbd_convolve_2d_ssse3.c
 AV1_COMMON_SRCS-$(HAVE_AVX2) += common/x86/highbd_convolve_2d_avx2.c
 ifeq ($(CONFIG_JNT_COMP), yes)
 AV1_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/highbd_convolve_2d_sse4.c
 endif
-endif
 
 ifeq ($(CONFIG_LV_MAP),yes)
 AV1_COMMON_SRCS-$(HAVE_SSE2) += common/x86/txb_sse2.c
diff --git a/av1/av1_cx.mk b/av1/av1_cx.mk
index 57c4576..de60cea5 100644
--- a/av1/av1_cx.mk
+++ b/av1/av1_cx.mk
@@ -151,14 +151,8 @@
 
 AV1_CX_SRCS-yes += encoder/wedge_utils.c
 AV1_CX_SRCS-$(HAVE_SSE2) += encoder/x86/wedge_utils_sse2.c
-
 AV1_CX_SRCS-$(HAVE_AVX2) += encoder/x86/error_intrin_avx2.c
-
-ifneq ($(CONFIG_HIGHBITDEPTH),yes)
-AV1_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/error_neon.c
-endif
 AV1_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/quantize_neon.c
-
 AV1_CX_SRCS-$(HAVE_MSA) += encoder/mips/msa/error_msa.c
 AV1_CX_SRCS-$(HAVE_MSA) += encoder/mips/msa/fdct4x4_msa.c
 AV1_CX_SRCS-$(HAVE_MSA) += encoder/mips/msa/fdct8x8_msa.c
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 95f6a05..ce1c739 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -378,11 +378,6 @@
 #endif
   }
 
-#if !CONFIG_HIGHBITDEPTH
-  if (cfg->g_profile > (unsigned int)PROFILE_1) {
-    ERROR("Profile > 1 not supported in this build configuration");
-  }
-#endif
   if (cfg->g_profile <= (unsigned int)PROFILE_1 &&
       cfg->g_bit_depth > AOM_BITS_8) {
     ERROR("Codec high bit-depth not supported in profile < 2");
@@ -1066,10 +1061,8 @@
 
     if (res == AOM_CODEC_OK) {
       set_encoder_config(&priv->oxcf, &priv->cfg, &priv->extra_cfg);
-#if CONFIG_HIGHBITDEPTH
       priv->oxcf.use_highbitdepth =
           (ctx->init_flags & AOM_CODEC_USE_HIGHBITDEPTH) ? 1 : 0;
-#endif
       priv->cpi = av1_create_compressor(&priv->oxcf, priv->buffer_pool);
       if (priv->cpi == NULL)
         res = AOM_CODEC_MEM_ERROR;
@@ -1757,13 +1750,11 @@
 CODEC_INTERFACE(aom_codec_av1_cx) = {
   "AOMedia Project AV1 Encoder" VERSION_STRING,
   AOM_CODEC_INTERNAL_ABI_VERSION,
-#if CONFIG_HIGHBITDEPTH
-  AOM_CODEC_CAP_HIGHBITDEPTH |
-#endif
-      AOM_CODEC_CAP_ENCODER | AOM_CODEC_CAP_PSNR,  // aom_codec_caps_t
-  encoder_init,                                    // aom_codec_init_fn_t
-  encoder_destroy,                                 // aom_codec_destroy_fn_t
-  encoder_ctrl_maps,                               // aom_codec_ctrl_fn_map_t
+  AOM_CODEC_CAP_HIGHBITDEPTH | AOM_CODEC_CAP_ENCODER |
+      AOM_CODEC_CAP_PSNR,  // aom_codec_caps_t
+  encoder_init,            // aom_codec_init_fn_t
+  encoder_destroy,         // aom_codec_destroy_fn_t
+  encoder_ctrl_maps,       // aom_codec_ctrl_fn_map_t
   {
       // NOLINT
       NULL,  // aom_codec_peek_si_fn_t
diff --git a/av1/av1_iface_common.h b/av1/av1_iface_common.h
index 6c9a2a6..dece441 100644
--- a/av1/av1_iface_common.h
+++ b/av1/av1_iface_common.h
@@ -60,7 +60,6 @@
   img->stride[AOM_PLANE_U] = yv12->uv_stride;
   img->stride[AOM_PLANE_V] = yv12->uv_stride;
   img->stride[AOM_PLANE_ALPHA] = yv12->y_stride;
-#if CONFIG_HIGHBITDEPTH
   if (yv12->flags & YV12_FLAG_HIGHBITDEPTH) {
     // aom_image_t uses byte strides and a pointer to the first byte
     // of the image.
@@ -75,7 +74,6 @@
     img->stride[AOM_PLANE_V] = 2 * yv12->uv_stride;
     img->stride[AOM_PLANE_ALPHA] = 2 * yv12->y_stride;
   }
-#endif  // CONFIG_HIGHBITDEPTH
   img->bps = bps;
   img->user_priv = user_priv;
   img->img_data = yv12->buffer_alloc;
@@ -112,7 +110,6 @@
 #endif
   yv12->color_range = img->range;
 
-#if CONFIG_HIGHBITDEPTH
   if (img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) {
     // In aom_image_t
     //     planes point to uint8 address of start of data
@@ -134,9 +131,6 @@
     yv12->flags = 0;
   }
   yv12->border = (yv12->y_stride - img->w) / 2;
-#else
-  yv12->border = (img->stride[AOM_PLANE_Y] - img->w) / 2;
-#endif  // CONFIG_HIGHBITDEPTH
   yv12->subsampling_x = img->x_chroma_shift;
   yv12->subsampling_y = img->y_chroma_shift;
   return AOM_CODEC_OK;
diff --git a/av1/common/alloccommon.c b/av1/common/alloccommon.c
index 535a2fa..7c8b3ad 100644
--- a/av1/common/alloccommon.c
+++ b/av1/common/alloccommon.c
@@ -146,11 +146,8 @@
 #else
   const int frame_w = cm->width;
 #endif  // CONFIG_HORZONLY_FRAME_SUPERRES
-#if CONFIG_HIGHBITDEPTH
   const int use_highbd = cm->use_highbitdepth ? 1 : 0;
-#else
-  const int use_highbd = 0;
-#endif
+
   for (int p = 0; p < MAX_MB_PLANE; ++p) {
     const int is_uv = p > 0;
     const int ss_x = is_uv && cm->subsampling_x;
diff --git a/av1/common/av1_loopfilter.c b/av1/common/av1_loopfilter.c
index 82f8fbc..3d81228 100644
--- a/av1/common/av1_loopfilter.c
+++ b/av1/common/av1_loopfilter.c
@@ -570,7 +570,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void highbd_filter_selectively_vert_row2(
     int subsampling_factor, uint16_t *s, int pitch, unsigned int mask_16x16_l,
     unsigned int mask_8x8_l, unsigned int mask_4x4_l,
@@ -665,7 +664,6 @@
     mask_4x4_int_1 >>= 1;
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 static void filter_selectively_horiz(
     uint8_t *s, int pitch, unsigned int mask_16x16, unsigned int mask_8x8,
@@ -760,7 +758,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void highbd_filter_selectively_horiz(
     uint16_t *s, int pitch, unsigned int mask_16x16, unsigned int mask_8x8,
     unsigned int mask_4x4, unsigned int mask_4x4_int,
@@ -859,7 +856,6 @@
     mask_4x4_int >>= count;
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 // This function ors into the current lfm structure, where to do loop
 // filters for the specific mi we are looking at. It uses information
@@ -1332,7 +1328,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void highbd_filter_selectively_vert(
     uint16_t *s, int pitch, unsigned int mask_16x16, unsigned int mask_8x8,
     unsigned int mask_4x4, unsigned int mask_4x4_int,
@@ -1366,7 +1361,6 @@
     mask_4x4_int >>= 1;
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 typedef struct {
   unsigned int m16x16;
@@ -1598,7 +1592,6 @@
     }
 #endif  // CONFIG_LOOPFILTERING_ACROSS_TILES
 
-#if CONFIG_HIGHBITDEPTH
     if (cm->use_highbitdepth)
       highbd_filter_selectively_vert(
           CONVERT_TO_SHORTPTR(dst->buf), dst->stride,
@@ -1606,7 +1599,6 @@
           col_masks.m4x4 & border_mask, mask_4x4_int, &cm->lf_info, &lfl[r][0],
           (int)cm->bit_depth);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       filter_selectively_vert(
           dst->buf, dst->stride, col_masks.m16x16 & border_mask,
           col_masks.m8x8 & border_mask, col_masks.m4x4 & border_mask,
@@ -1649,14 +1641,12 @@
     if (mi_row + idx_r == 0) memset(&row_masks, 0, sizeof(row_masks));
 #endif  // CONFIG_LOOPFILTERING_ACROSS_TILES
 
-#if CONFIG_HIGHBITDEPTH
     if (cm->use_highbitdepth)
       highbd_filter_selectively_horiz(
           CONVERT_TO_SHORTPTR(dst->buf), dst->stride, row_masks.m16x16,
           row_masks.m8x8, row_masks.m4x4, mask_4x4_int, &cm->lf_info,
           &lfl[r][0], (int)cm->bit_depth);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       filter_selectively_horiz(dst->buf, dst->stride, row_masks.m16x16,
                                row_masks.m8x8, row_masks.m4x4, mask_4x4_int,
                                &cm->lf_info, &lfl[r][0]);
@@ -1685,15 +1675,13 @@
     unsigned int mask_4x4_l = mask_4x4 & 0xffff;
     unsigned int mask_4x4_int_l = mask_4x4_int & 0xffff;
 
-// Disable filtering on the leftmost column.
-#if CONFIG_HIGHBITDEPTH
+    // Disable filtering on the leftmost column.
     if (cm->use_highbitdepth)
       highbd_filter_selectively_vert_row2(
           plane->subsampling_x, CONVERT_TO_SHORTPTR(dst->buf), dst->stride,
           mask_16x16_l, mask_8x8_l, mask_4x4_l, mask_4x4_int_l, &cm->lf_info,
           &lfm->lfl_y[r][0], (int)cm->bit_depth);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       filter_selectively_vert_row2(
           plane->subsampling_x, dst->buf, dst->stride, mask_16x16_l, mask_8x8_l,
           mask_4x4_l, mask_4x4_int_l, &cm->lf_info, &lfm->lfl_y[r][0]);
@@ -1737,14 +1725,12 @@
       mask_4x4_r = mask_4x4 & 0xff;
     }
 
-#if CONFIG_HIGHBITDEPTH
     if (cm->use_highbitdepth)
       highbd_filter_selectively_horiz(
           CONVERT_TO_SHORTPTR(dst->buf), dst->stride, mask_16x16_r, mask_8x8_r,
           mask_4x4_r, mask_4x4_int & 0xff, &cm->lf_info, &lfm->lfl_y[r][0],
           (int)cm->bit_depth);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       filter_selectively_horiz(dst->buf, dst->stride, mask_16x16_r, mask_8x8_r,
                                mask_4x4_r, mask_4x4_int & 0xff, &cm->lf_info,
                                &lfm->lfl_y[r][0]);
@@ -1788,15 +1774,13 @@
       unsigned int mask_4x4_l = mask_4x4 & 0xff;
       unsigned int mask_4x4_int_l = mask_4x4_int & 0xff;
 
-// Disable filtering on the leftmost column.
-#if CONFIG_HIGHBITDEPTH
+      // Disable filtering on the leftmost column.
       if (cm->use_highbitdepth)
         highbd_filter_selectively_vert_row2(
             plane->subsampling_x, CONVERT_TO_SHORTPTR(dst->buf), dst->stride,
             mask_16x16_l, mask_8x8_l, mask_4x4_l, mask_4x4_int_l, &cm->lf_info,
             &lfm->lfl_uv[r >> 1][0], (int)cm->bit_depth);
       else
-#endif  // CONFIG_HIGHBITDEPTH
         filter_selectively_vert_row2(plane->subsampling_x, dst->buf,
                                      dst->stride, mask_16x16_l, mask_8x8_l,
                                      mask_4x4_l, mask_4x4_int_l, &cm->lf_info,
@@ -1855,14 +1839,12 @@
       mask_4x4_r = mask_4x4 & 0xf;
     }
 
-#if CONFIG_HIGHBITDEPTH
     if (cm->use_highbitdepth)
       highbd_filter_selectively_horiz(
           CONVERT_TO_SHORTPTR(dst->buf), dst->stride, mask_16x16_r, mask_8x8_r,
           mask_4x4_r, mask_4x4_int_r, &cm->lf_info, &lfm->lfl_uv[r >> 1][0],
           (int)cm->bit_depth);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       filter_selectively_horiz(dst->buf, dst->stride, mask_16x16_r, mask_8x8_r,
                                mask_4x4_r, mask_4x4_int_r, &cm->lf_info,
                                &lfm->lfl_uv[r >> 1][0]);
@@ -2222,45 +2204,38 @@
       switch (params.filter_length) {
         // apply 4-tap filtering
         case 4:
-#if CONFIG_HIGHBITDEPTH
           if (cm->use_highbitdepth)
             aom_highbd_lpf_vertical_4(CONVERT_TO_SHORTPTR(p), dst_stride,
                                       params.mblim, params.lim, params.hev_thr,
                                       cm->bit_depth);
           else
-#endif  // CONFIG_HIGHBITDEPTH
             aom_lpf_vertical_4(p, dst_stride, params.mblim, params.lim,
                                params.hev_thr);
           break;
 #if PARALLEL_DEBLOCKING_5_TAP_CHROMA
         case 6:  // apply 6-tap filter for chroma plane only
           assert(plane != 0);
-#if CONFIG_HIGHBITDEPTH
           if (cm->use_highbitdepth)
             aom_highbd_lpf_vertical_6_c(CONVERT_TO_SHORTPTR(p), dst_stride,
                                         params.mblim, params.lim,
                                         params.hev_thr, cm->bit_depth);
           else
-#endif  // CONFIG_HIGHBITDEPTH
             aom_lpf_vertical_6_c(p, dst_stride, params.mblim, params.lim,
                                  params.hev_thr);
           break;
 #endif
         // apply 8-tap filtering
         case 8:
-#if CONFIG_HIGHBITDEPTH
           if (cm->use_highbitdepth)
             aom_highbd_lpf_vertical_8(CONVERT_TO_SHORTPTR(p), dst_stride,
                                       params.mblim, params.lim, params.hev_thr,
                                       cm->bit_depth);
           else
-#endif  // CONFIG_HIGHBITDEPTH
             aom_lpf_vertical_8(p, dst_stride, params.mblim, params.lim,
                                params.hev_thr);
           break;
         // apply 16-tap filtering
         case 16:
-#if CONFIG_HIGHBITDEPTH
           if (cm->use_highbitdepth)
 #if CONFIG_DEBLOCK_13TAP
             // TODO(olah): Remove _c once SIMD for 13-tap is available
@@ -2273,13 +2248,12 @@
                                        cm->bit_depth);
 #endif
           else
-#endif  // CONFIG_HIGHBITDEPTH
 #if CONFIG_DEBLOCK_13TAP
             aom_lpf_vertical_16_c(p, dst_stride, params.mblim, params.lim,
                                   params.hev_thr);
 #else
-          aom_lpf_vertical_16(p, dst_stride, params.mblim, params.lim,
-                              params.hev_thr);
+            aom_lpf_vertical_16(p, dst_stride, params.mblim, params.lim,
+                                params.hev_thr);
 #endif
           break;
         // no filtering
@@ -2287,13 +2261,11 @@
       }
       // process the internal edge
       if (params.filter_length_internal) {
-#if CONFIG_HIGHBITDEPTH
         if (cm->use_highbitdepth)
           aom_highbd_lpf_vertical_4(CONVERT_TO_SHORTPTR(p + 4), dst_stride,
                                     params.mblim, params.lim, params.hev_thr,
                                     cm->bit_depth);
         else
-#endif  // CONFIG_HIGHBITDEPTH
           aom_lpf_vertical_4(p + 4, dst_stride, params.mblim, params.lim,
                              params.hev_thr);
       }
@@ -2333,45 +2305,39 @@
       switch (params.filter_length) {
         // apply 4-tap filtering
         case 4:
-#if CONFIG_HIGHBITDEPTH
           if (cm->use_highbitdepth)
             aom_highbd_lpf_horizontal_4(CONVERT_TO_SHORTPTR(p), dst_stride,
                                         params.mblim, params.lim,
                                         params.hev_thr, cm->bit_depth);
           else
-#endif  // CONFIG_HIGHBITDEPTH
             aom_lpf_horizontal_4(p, dst_stride, params.mblim, params.lim,
                                  params.hev_thr);
           break;
 #if PARALLEL_DEBLOCKING_5_TAP_CHROMA
         // apply 6-tap filtering
-        case 6: assert(plane != 0);
-#if CONFIG_HIGHBITDEPTH
+        case 6:
+          assert(plane != 0);
           if (cm->use_highbitdepth)
             aom_highbd_lpf_horizontal_6_c(CONVERT_TO_SHORTPTR(p), dst_stride,
                                           params.mblim, params.lim,
                                           params.hev_thr, cm->bit_depth);
           else
-#endif  // CONFIG_HIGHBITDEPTH
             aom_lpf_horizontal_6_c(p, dst_stride, params.mblim, params.lim,
                                    params.hev_thr);
           break;
 #endif
         // apply 8-tap filtering
         case 8:
-#if CONFIG_HIGHBITDEPTH
           if (cm->use_highbitdepth)
             aom_highbd_lpf_horizontal_8(CONVERT_TO_SHORTPTR(p), dst_stride,
                                         params.mblim, params.lim,
                                         params.hev_thr, cm->bit_depth);
           else
-#endif  // CONFIG_HIGHBITDEPTH
             aom_lpf_horizontal_8(p, dst_stride, params.mblim, params.lim,
                                  params.hev_thr);
           break;
         // apply 16-tap filtering
         case 16:
-#if CONFIG_HIGHBITDEPTH
           if (cm->use_highbitdepth)
 #if CONFIG_DEBLOCK_13TAP
             // TODO(olah): Remove _c once SIMD for 13-tap is available
@@ -2384,13 +2350,12 @@
                 params.hev_thr, cm->bit_depth);
 #endif
           else
-#endif  // CONFIG_HIGHBITDEPTH
 #if CONFIG_DEBLOCK_13TAP
             aom_lpf_horizontal_16_dual_c(p, dst_stride, params.mblim,
                                          params.lim, params.hev_thr);
 #else
-          aom_lpf_horizontal_16_dual(p, dst_stride, params.mblim, params.lim,
-                                     params.hev_thr);
+            aom_lpf_horizontal_16_dual(p, dst_stride, params.mblim, params.lim,
+                                       params.hev_thr);
 #endif
           break;
         // no filtering
@@ -2398,13 +2363,11 @@
       }
       // process the internal edge
       if (params.filter_length_internal) {
-#if CONFIG_HIGHBITDEPTH
         if (cm->use_highbitdepth)
           aom_highbd_lpf_horizontal_4(CONVERT_TO_SHORTPTR(p + 4 * dst_stride),
                                       dst_stride, params.mblim, params.lim,
                                       params.hev_thr, cm->bit_depth);
         else
-#endif  // CONFIG_HIGHBITDEPTH
           aom_lpf_horizontal_4(p + 4 * dst_stride, dst_stride, params.mblim,
                                params.lim, params.hev_thr);
       }
diff --git a/av1/common/av1_rtcd_defs.pl b/av1/common/av1_rtcd_defs.pl
index 2efc85f..4662624 100755
--- a/av1/common/av1_rtcd_defs.pl
+++ b/av1/common/av1_rtcd_defs.pl
@@ -70,19 +70,18 @@
 
 if (aom_config("CONFIG_HORZONLY_FRAME_SUPERRES") eq "yes") {
   add_proto qw/void av1_convolve_horiz_rs/, "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int w, int h, const int16_t *x_filters, int interp_taps, const int x0_qn, const int x_step_qn";
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
+
     add_proto qw/void av1_highbd_convolve_horiz_rs/, "const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, int h, const int16_t *x_filters, int interp_taps, const int x0_qn, const int x_step_qn, int bd";
-  }
 }
 
-if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
+
   add_proto qw/void av1_highbd_convolve_init/, "void";
   specialize qw/av1_highbd_convolve_init sse4_1/;
   add_proto qw/void av1_highbd_convolve_horiz/, "const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, int h, const InterpFilterParams fp, const int subpel_x_q4, int x_step_q4, int avg, int bd";
   specialize qw/av1_highbd_convolve_horiz sse4_1/;
   add_proto qw/void av1_highbd_convolve_vert/, "const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, int h, const InterpFilterParams fp, const int subpel_x_q4, int x_step_q4, int avg, int bd";
   specialize qw/av1_highbd_convolve_vert sse4_1/;
-}
+
 
 #
 # txb
@@ -97,11 +96,7 @@
 #
 add_proto qw/void av1_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 if (aom_config("CONFIG_DAALA_TX4") ne "yes") {
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
     specialize qw/av1_iht4x4_16_add sse2/;
-  } else {
-    specialize qw/av1_iht4x4_16_add sse2 neon/;
-  }
 }
 
 if (aom_config("CONFIG_DAALA_TX") ne "yes") {
@@ -133,28 +128,17 @@
 
   add_proto qw/void av1_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
   if (aom_config("CONFIG_DAALA_TX8") ne "yes") {
-    if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
       specialize qw/av1_iht8x8_64_add sse2/;
-   } else {
-       specialize qw/av1_iht8x8_64_add sse2 neon/;
-    }
   }
 
   add_proto qw/void av1_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
 
   if (aom_config("CONFIG_DAALA_TX16") ne "yes") {
-    if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
       specialize qw/av1_iht16x16_256_add sse2 avx2/;
-    } else {
-      specialize qw/av1_iht16x16_256_add sse2 avx2/;
-    }
   }
 
   add_proto qw/void av1_iht32x32_1024_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") ne "yes") {
-  }
-
   add_proto qw/void av1_iht32x32_1024_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
 
   if (aom_config("CONFIG_TX64X64") eq "yes") {
@@ -191,18 +175,16 @@
   add_proto qw/void av1_d153_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint8_t *above, const uint8_t *left";
   add_proto qw/void av1_paeth_filter_predictor/, "uint8_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint8_t *above, const uint8_t *left";
   # High bitdepth functions
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
     add_proto qw/void av1_highbd_dc_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
     add_proto qw/void av1_highbd_v_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
     add_proto qw/void av1_highbd_h_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
     add_proto qw/void av1_highbd_d117_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
     add_proto qw/void av1_highbd_d153_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
     add_proto qw/void av1_highbd_paeth_filter_predictor/, "uint16_t *dst, ptrdiff_t stride, TX_SIZE tx_size, const uint16_t *above, const uint16_t *left, int bd";
-  }
+
 }
 
 # High bitdepth functions
-if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
   #
   # Sub Pixel Filters
   #
@@ -256,7 +238,6 @@
   add_proto qw/void av1_highbd_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
   add_proto qw/void av1_highbd_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
-}
 
 #inv txfm
 add_proto qw/void av1_inv_txfm2d_add_4x8/, "const int32_t *input, uint16_t *output, int stride, TX_TYPE tx_type, int bd";
@@ -300,7 +281,6 @@
 
   # ENCODEMB INVOKE
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
     # the transform coefficients are held in 32-bit
     # values, so the assembler code for  av1_block_error can no longer be used.
     add_proto qw/int64_t av1_block_error/, "const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz";
@@ -315,25 +295,6 @@
     if (aom_config("CONFIG_TX64X64") eq "yes") {
       add_proto qw/void av1_quantize_fp_64x64/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
     }
-  } else {
-    add_proto qw/int64_t av1_block_error/, "const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz";
-    specialize qw/av1_block_error sse2 avx2 msa/;
-
-    add_proto qw/int64_t av1_block_error_fp/, "const int16_t *coeff, const int16_t *dqcoeff, int block_size";
-    specialize qw/av1_block_error_fp neon sse2/;
-
-    add_proto qw/void av1_quantize_fp/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
-    specialize qw/av1_quantize_fp neon sse2 avx2/, "$ssse3_x86_64";
-
-    add_proto qw/void av1_quantize_fp_32x32/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
-    specialize qw/av1_quantize_fp_32x32 avx2/, "$ssse3_x86_64";
-
-    if (aom_config("CONFIG_TX64X64") eq "yes") {
-      add_proto qw/void av1_quantize_fp_64x64/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
-    }
-
-  }
-
   # fdct functions
 
   add_proto qw/void av1_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
@@ -451,7 +412,6 @@
     add_proto qw/void av1_quantize_b/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan, int log_scale";
   }
 
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
 
     # ENCODEMB INVOKE
     if (aom_config("CONFIG_NEW_QUANT") eq "yes") {
@@ -477,7 +437,6 @@
 
     add_proto qw/void av1_highbd_temporal_filter_apply/, "uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count";
 
-  }
 
   add_proto qw/void av1_highbd_quantize_fp/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan, int log_scale";
   specialize qw/av1_highbd_quantize_fp sse4_1 avx2/;
@@ -532,7 +491,6 @@
   specialize qw/av1_warp_affine sse2 ssse3/;
 }
 
-if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
   add_proto qw/void av1_highbd_warp_affine/, "const int32_t *mat, const uint16_t *ref, int width, int height, int stride, uint16_t *pred, int p_col, int p_row, int p_width, int p_height, int p_stride, int subsampling_x, int subsampling_y, int bd, ConvolveParams *conv_params, int16_t alpha, int16_t beta, int16_t gamma, int16_t delta";
 
 if (aom_config("CONFIG_JNT_COMP") eq "yes") {
@@ -542,7 +500,7 @@
 } else {
   specialize qw/av1_highbd_warp_affine ssse3/;
 }
-}
+
 
 if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
   add_proto qw/double compute_cross_correlation/, "unsigned char *im1, int stride1, int x1, int y1, unsigned char *im2, int stride2, int x2, int y2";
@@ -591,7 +549,6 @@
   specialize qw/av1_jnt_convolve_2d_copy sse2/;
 }
 
-if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
   add_proto qw/void av1_highbd_convolve_2d/, "const uint16_t *src, int src_stride, CONV_BUF_TYPE *dst, int dst_stride, int w, int h, InterpFilterParams *filter_params_x, InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd";
   specialize qw/av1_highbd_convolve_2d ssse3 avx2/;
   add_proto qw/void av1_highbd_convolve_rounding/, "const int32_t *src, int src_stride, uint8_t *dst, int dst_stride, int w, int h, int bits, int bd";
@@ -604,7 +561,7 @@
     add_proto qw/void av1_highbd_jnt_convolve_2d/, "const uint16_t *src, int src_stride, CONV_BUF_TYPE *dst, int dst_stride, int w, int h, InterpFilterParams *filter_params_x, InterpFilterParams *filter_params_y, const int subpel_x_q4, const int subpel_y_q4, ConvolveParams *conv_params, int bd";
     specialize qw/av1_highbd_jnt_convolve_2d sse4_1/;
   }
-}
+
 
 # INTRA_EDGE functions
 if (aom_config("CONFIG_INTRA_EDGE") eq "yes") {
@@ -612,12 +569,12 @@
   specialize qw/av1_filter_intra_edge sse4_1/;
   add_proto qw/void av1_upsample_intra_edge/, "uint8_t *p, int sz";
   specialize qw/av1_upsample_intra_edge sse4_1/;
-  if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
+  
     add_proto qw/void av1_filter_intra_edge_high/, "uint16_t *p, int sz, int strength";
     specialize qw/av1_filter_intra_edge_high sse4_1/;
     add_proto qw/void av1_upsample_intra_edge_high/, "uint16_t *p, int sz, int bd";
     specialize qw/av1_upsample_intra_edge_high sse4_1/;
-  }
+  
 }
 
 # DAALA_TX functions
diff --git a/av1/common/cdef.c b/av1/common/cdef.c
index ed768cd..b0399f0 100644
--- a/av1/common/cdef.c
+++ b/av1/common/cdef.c
@@ -120,18 +120,14 @@
 static void copy_sb8_16(AOM_UNUSED AV1_COMMON *cm, uint16_t *dst, int dstride,
                         const uint8_t *src, int src_voffset, int src_hoffset,
                         int sstride, int vsize, int hsize) {
-#if CONFIG_HIGHBITDEPTH
   if (cm->use_highbitdepth) {
     const uint16_t *base =
         &CONVERT_TO_SHORTPTR(src)[src_voffset * sstride + src_hoffset];
     copy_rect8_16bit_to_16bit(dst, dstride, base, sstride, vsize, hsize);
   } else {
-#endif
     const uint8_t *base = &src[src_voffset * sstride + src_hoffset];
     copy_rect8_8bit_to_16bit(dst, dstride, base, sstride, vsize, hsize);
-#if CONFIG_HIGHBITDEPTH
   }
-#endif
 }
 
 static INLINE void fill_rect(uint16_t *dst, int dstride, int v, int h,
@@ -393,7 +389,7 @@
           fill_rect(&src[hsize + CDEF_HBORDER], CDEF_BSTRIDE,
                     vsize + 2 * CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
         }
-#if CONFIG_HIGHBITDEPTH
+
         if (cm->use_highbitdepth) {
           cdef_filter_fb(
               NULL,
@@ -407,7 +403,6 @@
               ydec[pli], dir, NULL, var, pli, dlist, cdef_count, level,
               sec_strength, pri_damping, sec_damping, coeff_shift);
         } else {
-#endif
           cdef_filter_fb(
               &xd->plane[pli]
                    .dst.buf[xd->plane[pli].dst.stride *
@@ -417,10 +412,7 @@
               &src[CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER], xdec[pli],
               ydec[pli], dir, NULL, var, pli, dlist, cdef_count, level,
               sec_strength, pri_damping, sec_damping, coeff_shift);
-
-#if CONFIG_HIGHBITDEPTH
         }
-#endif
       }
       cdef_left = 1;
     }
diff --git a/av1/common/cfl.c b/av1/common/cfl.c
index a9e8aa4..78e7c09 100644
--- a/av1/common/cfl.c
+++ b/av1/common/cfl.c
@@ -47,13 +47,13 @@
                        CFL_PRED_TYPE pred_plane, int width) {
   assert(pred_plane < CFL_PRED_PLANES);
   assert(width <= CFL_BUF_LINE);
-#if CONFIG_HIGHBITDEPTH
+
   if (get_bitdepth_data_path_index(xd)) {
     uint16_t *const input_16 = CONVERT_TO_SHORTPTR(input);
     memcpy(xd->cfl.dc_pred_cache[pred_plane], input_16, width << 1);
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
+
   memcpy(xd->cfl.dc_pred_cache[pred_plane], input, width);
 }
 
@@ -65,7 +65,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void cfl_load_dc_pred_hbd(const int16_t *dc_pred_cache, uint16_t *dst,
                                  int dst_stride, int width, int height) {
   const size_t num_bytes = width << 1;
@@ -74,8 +73,6 @@
     dst += dst_stride;
   }
 }
-#endif
-
 void cfl_load_dc_pred(MACROBLOCKD *const xd, uint8_t *dst, int dst_stride,
                       TX_SIZE tx_size, CFL_PRED_TYPE pred_plane) {
   const int width = tx_size_wide[tx_size];
@@ -83,14 +80,12 @@
   assert(pred_plane < CFL_PRED_PLANES);
   assert(width <= CFL_BUF_LINE);
   assert(height <= CFL_BUF_LINE);
-#if CONFIG_HIGHBITDEPTH
   if (get_bitdepth_data_path_index(xd)) {
     uint16_t *dst_16 = CONVERT_TO_SHORTPTR(dst);
     cfl_load_dc_pred_hbd(xd->cfl.dc_pred_cache[pred_plane], dst_16, dst_stride,
                          width, height);
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
   cfl_load_dc_pred_lbd(xd->cfl.dc_pred_cache[pred_plane], dst, dst_stride,
                        width, height);
 }
@@ -189,7 +184,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void cfl_build_prediction_hbd(const int16_t *pred_buf_q3, uint16_t *dst,
                                      int dst_stride, int width, int height,
                                      int alpha_q3, int bit_depth) {
@@ -203,7 +197,6 @@
     pred_buf_q3 += CFL_BUF_LINE;
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 static void cfl_compute_parameters(MACROBLOCKD *const xd, TX_SIZE tx_size) {
   CFL_CTX *const cfl = &xd->cfl;
@@ -246,7 +239,6 @@
 
   const int alpha_q3 =
       cfl_idx_to_alpha(mbmi->cfl_alpha_idx, mbmi->cfl_alpha_signs, plane - 1);
-#if CONFIG_HIGHBITDEPTH
   if (get_bitdepth_data_path_index(xd)) {
     uint16_t *dst_16 = CONVERT_TO_SHORTPTR(dst);
     cfl_build_prediction_hbd(cfl->pred_buf_q3, dst_16, dst_stride,
@@ -254,7 +246,6 @@
                              alpha_q3, xd->bd);
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
   cfl_build_prediction_lbd(cfl->pred_buf_q3, dst, dst_stride,
                            tx_size_wide[tx_size], tx_size_high[tx_size],
                            alpha_q3);
@@ -326,7 +317,6 @@
   { cfl_luma_subsampling_440_lbd, cfl_luma_subsampling_420_lbd },
 };
 
-#if CONFIG_HIGHBITDEPTH
 static void cfl_luma_subsampling_420_hbd(const uint16_t *input,
                                          int input_stride, int16_t *output_q3,
                                          int width, int height) {
@@ -392,7 +382,6 @@
   { cfl_luma_subsampling_444_hbd, cfl_luma_subsampling_422_hbd },
   { cfl_luma_subsampling_440_hbd, cfl_luma_subsampling_420_hbd },
 };
-#endif  // CONFIG_HIGHBITDEPTH
 
 static void cfl_store(CFL_CTX *cfl, const uint8_t *input, int input_stride,
                       int row, int col, int width, int height, int use_hbd) {
@@ -426,7 +415,6 @@
   int16_t *pred_buf_q3 =
       cfl->pred_buf_q3 + (store_row * CFL_BUF_LINE + store_col);
 
-#if CONFIG_HIGHBITDEPTH
   if (use_hbd) {
     const uint16_t *input_16 = CONVERT_TO_SHORTPTR(input);
     // AND sub_x and sub_y with 1 to ensures that an attacker won't be able to
@@ -435,7 +423,6 @@
                                         store_width, store_height);
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
   (void)use_hbd;
   // AND sub_x and sub_y with 1 to ensures that an attacker won't be able to
   // index the function pointer array out of bounds.
diff --git a/av1/common/convolve.c b/av1/common/convolve.c
index 3a8b3c0..094d455 100644
--- a/av1/common/convolve.c
+++ b/av1/common/convolve.c
@@ -53,7 +53,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 void av1_highbd_convolve_horiz_rs_c(const uint16_t *src, int src_stride,
                                     uint16_t *dst, int dst_stride, int w, int h,
                                     const int16_t *x_filters, int interp_taps,
@@ -76,7 +75,6 @@
     dst += dst_stride;
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 void av1_convolve_horiz_c(const uint8_t *src, int src_stride, uint8_t *dst,
@@ -869,7 +867,6 @@
         &filter_params_y, subpel_x_q4, subpel_y_q4, conv_params);
 }
 
-#if CONFIG_HIGHBITDEPTH
 void av1_highbd_convolve_rounding_c(const int32_t *src, int src_stride,
                                     uint8_t *dst8, int dst_stride, int w, int h,
                                     int bits, int bd) {
@@ -1168,7 +1165,6 @@
 #endif  // CONFIG_JNT_COMP
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 typedef void (*ConvolveFunc)(const uint8_t *src, int src_stride, uint8_t *dst,
                              int dst_stride, int w, int h,
@@ -1419,19 +1415,12 @@
 }
 
 void av1_convolve_init(AV1_COMMON *cm) {
-#if CONFIG_HIGHBITDEPTH
   if (cm->use_highbitdepth)
     av1_highbd_convolve_init();
   else
     av1_lowbd_convolve_init();
-#else
-  (void)cm;
-  av1_lowbd_convolve_init();
-#endif
-  return;
 }
 
-#if CONFIG_HIGHBITDEPTH
 void av1_highbd_convolve_horiz_c(const uint16_t *src, int src_stride,
                                  uint16_t *dst, int dst_stride, int w, int h,
                                  const InterpFilterParams filter_params,
@@ -1848,4 +1837,3 @@
 #endif  // CONFIG_DUAL_FILTER && USE_EXTRA_FILTER
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/av1/common/convolve.h b/av1/common/convolve.h
index 6378bb1..cd03895 100644
--- a/av1/common/convolve.h
+++ b/av1/common/convolve.h
@@ -134,7 +134,6 @@
   return conv_params;
 }
 
-#if CONFIG_HIGHBITDEPTH
 void av1_highbd_convolve_2d_facade(const uint8_t *src8, int src_stride,
                                    uint8_t *dst, int dst_stride, int w, int h,
                                    InterpFilters interp_filters,
@@ -142,7 +141,6 @@
                                    const int subpel_y_q4, int y_step_q4,
                                    int scaled, ConvolveParams *conv_params,
                                    int bd);
-#endif
 
 void av1_convolve(const uint8_t *src, int src_stride, uint8_t *dst,
                   int dst_stride, int w, int h, InterpFilters interp_filters,
@@ -160,7 +158,6 @@
                         int xstep, const int subpel_y, int ystep,
                         ConvolveParams *conv_params);
 
-#if CONFIG_HIGHBITDEPTH
 void av1_highbd_convolve(const uint8_t *src, int src_stride, uint8_t *dst,
                          int dst_stride, int w, int h,
                          InterpFilters interp_filters, const int subpel_x,
@@ -172,8 +169,6 @@
                                InterpFilters interp_filters, const int subpel_x,
                                int xstep, const int subpel_y, int ystep,
                                int avg, int bd);
-#endif  // CONFIG_HIGHBITDEPTH
-
 #ifdef __cplusplus
 }  // extern "C"
 #endif
diff --git a/av1/common/entropy.h b/av1/common/entropy.h
index 7316ef6..97114f7 100644
--- a/av1/common/entropy.h
+++ b/av1/common/entropy.h
@@ -164,10 +164,8 @@
 }
 
 #define DCT_MAX_VALUE 16384
-#if CONFIG_HIGHBITDEPTH
 #define DCT_MAX_VALUE_HIGH10 65536
 #define DCT_MAX_VALUE_HIGH12 262144
-#endif  // CONFIG_HIGHBITDEPTH
 
 /* Coefficients are predicted via a 3-dimensional probability table. */
 
diff --git a/av1/common/idct.h b/av1/common/idct.h
index edf9726..0855302 100644
--- a/av1/common/idct.h
+++ b/av1/common/idct.h
@@ -32,13 +32,11 @@
   transform_1d cols, rows;  // vertical and horizontal
 } transform_2d;
 
-#if CONFIG_HIGHBITDEPTH
 typedef void (*highbd_transform_1d)(const tran_low_t *, tran_low_t *, int bd);
 
 typedef struct {
   highbd_transform_1d cols, rows;  // vertical and horizontal
 } highbd_transform_2d;
-#endif  // CONFIG_HIGHBITDEPTH
 
 #if !CONFIG_DAALA_TX
 #define MAX_TX_SCALE 1
diff --git a/av1/common/onyxc_int.h b/av1/common/onyxc_int.h
index da0dae0..bec864e 100644
--- a/av1/common/onyxc_int.h
+++ b/av1/common/onyxc_int.h
@@ -243,10 +243,8 @@
   int largest_tile_id;
 #endif
 
-#if CONFIG_HIGHBITDEPTH
   // Marks if we need to use 16bit frame buffers (1: yes, 0: no).
   int use_highbitdepth;
-#endif
   YV12_BUFFER_CONFIG *frame_to_show;
   RefCntBuffer *prev_frame;
 
diff --git a/av1/common/quant_common.c b/av1/common/quant_common.c
index 0887cb8..e034fce 100644
--- a/av1/common/quant_common.c
+++ b/av1/common/quant_common.c
@@ -132,7 +132,6 @@
   1184, 1232, 1282, 1336,
 };
 
-#if CONFIG_HIGHBITDEPTH
 static const int16_t dc_qlookup_10_Q3[QINDEX_RANGE] = {
   4,    9,    10,   13,   15,   17,   20,   22,   25,   28,   31,   34,   37,
   40,   43,   47,   50,   53,   57,   60,   64,   68,   71,   75,   78,   82,
@@ -182,7 +181,6 @@
   13501, 13913, 14343, 14807, 15290, 15812, 16356, 16943, 17575, 18237, 18949,
   19718, 20521, 21387,
 };
-#endif
 
 static const int16_t ac_qlookup_Q3[QINDEX_RANGE] = {
   4,    8,    9,    10,   11,   12,   13,   14,   15,   16,   17,   18,   19,
@@ -207,7 +205,6 @@
   1567, 1597, 1628, 1660, 1692, 1725, 1759, 1793, 1828,
 };
 
-#if CONFIG_HIGHBITDEPTH
 static const int16_t ac_qlookup_10_Q3[QINDEX_RANGE] = {
   4,    9,    11,   13,   16,   18,   21,   24,   27,   30,   33,   37,   40,
   44,   48,   51,   55,   59,   63,   67,   71,   75,   79,   83,   88,   92,
@@ -257,7 +254,6 @@
   22766, 23214, 23662, 24126, 24590, 25070, 25551, 26047, 26559, 27071, 27599,
   28143, 28687, 29247,
 };
-#endif
 
 #if !CONFIG_DAALA_TX
 
@@ -291,7 +287,6 @@
 // underflow to 0 in the actual quantization routines.
 
 int16_t av1_dc_quant_Q3(int qindex, int delta, aom_bit_depth_t bit_depth) {
-#if CONFIG_HIGHBITDEPTH
   switch (bit_depth) {
     case AOM_BITS_8: return dc_qlookup_Q3[clamp(qindex + delta, 0, MAXQ)];
     case AOM_BITS_10: return dc_qlookup_10_Q3[clamp(qindex + delta, 0, MAXQ)];
@@ -300,14 +295,9 @@
       assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
       return -1;
   }
-#else
-  (void)bit_depth;
-  return dc_qlookup_Q3[clamp(qindex + delta, 0, MAXQ)];
-#endif
 }
 
 int16_t av1_ac_quant_Q3(int qindex, int delta, aom_bit_depth_t bit_depth) {
-#if CONFIG_HIGHBITDEPTH
   switch (bit_depth) {
     case AOM_BITS_8: return ac_qlookup_Q3[clamp(qindex + delta, 0, MAXQ)];
     case AOM_BITS_10: return ac_qlookup_10_Q3[clamp(qindex + delta, 0, MAXQ)];
@@ -316,10 +306,6 @@
       assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
       return -1;
   }
-#else
-  (void)bit_depth;
-  return ac_qlookup_Q3[clamp(qindex + delta, 0, MAXQ)];
-#endif
 }
 
 // In AV1 TX, the coefficients are always scaled up a factor of 8 (3
@@ -336,7 +322,6 @@
 int16_t av1_qindex_from_ac_Q3(int ac_Q3, aom_bit_depth_t bit_depth) {
   int i;
   const int16_t *tab = ac_qlookup_Q3;
-#if CONFIG_HIGHBITDEPTH
   switch (bit_depth) {
     case AOM_BITS_10: {
       tab = ac_qlookup_10_Q3;
@@ -350,7 +335,6 @@
       assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
       return -1;
   }
-#endif
   (void)bit_depth;
   for (i = 0; i < QINDEX_RANGE; i++) {
     if (ac_Q3 <= tab[i]) return i;
diff --git a/av1/common/reconinter.c b/av1/common/reconinter.c
index 7ba8c62..bf5dd4b 100644
--- a/av1/common/reconinter.c
+++ b/av1/common/reconinter.c
@@ -88,22 +88,18 @@
     const struct macroblockd_plane *const pd = &xd->plane[plane];
     const struct buf_2d *const pre_buf = &pd->pre[ref];
     av1_warp_plane(&final_warp_params,
-#if CONFIG_HIGHBITDEPTH
                    xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH, xd->bd,
-#endif  // CONFIG_HIGHBITDEPTH
                    pre_buf->buf0, pre_buf->width, pre_buf->height,
                    pre_buf->stride, dst, p_col, p_row, w, h, dst_stride,
                    pd->subsampling_x, pd->subsampling_y, conv_params);
     return;
   }
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     highbd_inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y,
                            sf, w, h, conv_params, interp_filters, xs, ys,
                            xd->bd);
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
   inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y, sf, w,
                   h, conv_params, interp_filters, xs, ys);
 }
@@ -379,7 +375,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 void build_compound_seg_mask_highbd(uint8_t *mask, SEG_MASK_TYPE mask_type,
                                     const uint8_t *src0, int src0_stride,
                                     const uint8_t *src1, int src1_stride,
@@ -395,7 +390,6 @@
     default: assert(0);
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 #elif COMPOUND_SEGMENT_TYPE == 1
 #define DIFF_FACTOR 16
@@ -472,7 +466,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void diffwtd_mask_highbd(uint8_t *mask, int which_inverse, int mask_base,
                                 const uint16_t *src0, int src0_stride,
                                 const uint16_t *src1, int src1_stride,
@@ -509,7 +502,6 @@
     default: assert(0);
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // COMPOUND_SEGMENT_TYPE
 
 #if MASK_MASTER_SIZE == 64
@@ -714,7 +706,6 @@
                      mask, block_size_wide[sb_type], h, w, subh, subw);
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void build_masked_compound_highbd(
     uint8_t *dst_8, int dst_stride, const uint8_t *src0_8, int src0_stride,
     const uint8_t *src1_8, int src1_stride,
@@ -731,7 +722,6 @@
                             src1_stride, mask, block_size_wide[sb_type], h, w,
                             subh, subw, bd);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 void av1_make_masked_inter_predictor(
     const uint8_t *pre, int pre_stride, uint8_t *dst, int dst_stride,
@@ -760,13 +750,9 @@
                   tmp_buf[INTER_PRED_BYTES_PER_PIXEL * MAX_SB_SQUARE]);
 #undef INTER_PRED_BYTES_PER_PIXEL
 
-#if CONFIG_HIGHBITDEPTH
   uint8_t *tmp_dst = (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
                          ? CONVERT_TO_BYTEPTR(tmp_buf)
                          : tmp_buf;
-#else
-  uint8_t *tmp_dst = tmp_buf;
-#endif
 
   const int tmp_buf_stride = MAX_SB_SIZE;
   const int is_conv_no_round = conv_params->round == CONVOLVE_OPT_NO_ROUND;
@@ -792,19 +778,15 @@
                                   tmp_buf_stride, mi->mbmi.sb_type, h, w,
                                   conv_params, xd->bd);
     } else {
-#if CONFIG_HIGHBITDEPTH
       if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
         build_compound_seg_mask_highbd(comp_data.seg_mask, comp_data.mask_type,
                                        dst, dst_stride, tmp_dst, MAX_SB_SIZE,
                                        mi->mbmi.sb_type, h, w, xd->bd);
       } else {
-#endif
         build_compound_seg_mask(comp_data.seg_mask, comp_data.mask_type, dst,
                                 dst_stride, tmp_dst, MAX_SB_SIZE,
                                 mi->mbmi.sb_type, h, w);
-#if CONFIG_HIGHBITDEPTH
       }
-#endif
     }
   }
 
@@ -815,24 +797,20 @@
 
     const int convolve_rounding_bits =
         FILTER_BITS * 2 - conv_params->round_0 - conv_params->round_1;
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
       av1_highbd_convolve_rounding(org_dst, org_dst_stride, dst, dst_stride, w,
                                    h, convolve_rounding_bits, xd->bd);
     else
-#endif
       av1_convolve_rounding(org_dst, org_dst_stride, dst, dst_stride, w, h,
                             convolve_rounding_bits);
 
     conv_params->do_post_rounding = 0;
   } else {
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
       build_masked_compound_highbd(dst, dst_stride, dst, dst_stride, tmp_dst,
                                    MAX_SB_SIZE, &comp_data, mi->mbmi.sb_type, h,
                                    w, xd->bd);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       build_masked_compound(dst, dst_stride, dst, dst_stride, tmp_dst,
                             MAX_SB_SIZE, &comp_data, mi->mbmi.sb_type, h, w);
   }
@@ -841,7 +819,6 @@
 // TODO(sarahparker) av1_highbd_build_inter_predictor and
 // av1_build_inter_predictor should be combined with
 // av1_make_inter_predictor
-#if CONFIG_HIGHBITDEPTH
 void av1_highbd_build_inter_predictor(
     const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride,
     const MV *src_mv, const struct scale_factors *sf, int w, int h, int ref,
@@ -866,7 +843,6 @@
                            p_col, p_row, plane, ref, xd->mi[0], 0,
                            sf->x_step_q4, sf->y_step_q4, xd);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 void av1_build_inter_predictor(
     const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride,
@@ -1126,7 +1102,6 @@
                 xs, ys, xd);
         }  // for (ref = 0; ref < 1 + is_compound; ++ref)
         if (conv_params.do_post_rounding) {
-#if CONFIG_HIGHBITDEPTH
           if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
             av1_highbd_convolve_rounding(
                 tmp_dst, tmp_dst_stride, dst, dst_buf->stride, b4_w, b4_h,
@@ -1134,7 +1109,6 @@
                     conv_params.round_1,
                 xd->bd);
           else
-#endif  // CONFIG_HIGHBITDEPTH
             av1_convolve_rounding(
                 tmp_dst, tmp_dst_stride, dst, dst_buf->stride, b4_w, b4_h,
                 FILTER_BITS * 2 + is_compound - conv_params.round_0 -
@@ -1266,7 +1240,6 @@
 
     // TODO(angiebird): This part needs optimization
     if (conv_params.do_post_rounding) {
-#if CONFIG_HIGHBITDEPTH
       if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
         av1_highbd_convolve_rounding(
             tmp_dst, MAX_SB_SIZE, dst, dst_buf->stride, w, h,
@@ -1274,7 +1247,6 @@
                 conv_params.round_1,
             xd->bd);
       else
-#endif  // CONFIG_HIGHBITDEPTH
         av1_convolve_rounding(tmp_dst, MAX_SB_SIZE, dst, dst_buf->stride, w, h,
                               FILTER_BITS * 2 + is_compound -
                                   conv_params.round_0 - conv_params.round_1);
@@ -1486,9 +1458,7 @@
   (void)above_mi;
   struct obmc_inter_pred_ctxt *ctxt = (struct obmc_inter_pred_ctxt *)fun_ctxt;
   const BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type;
-#if CONFIG_HIGHBITDEPTH
   const int is_hbd = (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? 1 : 0;
-#endif  // CONFIG_HIGHBITDEPTH
   const int overlap =
       AOMMIN(block_size_high[bsize], block_size_high[BLOCK_64X64]) >> 1;
 
@@ -1506,12 +1476,10 @@
     const uint8_t *const tmp = &ctxt->adjacent[plane][plane_col];
     const uint8_t *const mask = av1_get_obmc_mask(bh);
 
-#if CONFIG_HIGHBITDEPTH
     if (is_hbd)
       aom_highbd_blend_a64_vmask(dst, dst_stride, dst, dst_stride, tmp,
                                  tmp_stride, mask, bh, bw, xd->bd);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       aom_blend_a64_vmask(dst, dst_stride, dst, dst_stride, tmp, tmp_stride,
                           mask, bh, bw);
   }
@@ -1526,9 +1494,7 @@
   const BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type;
   const int overlap =
       AOMMIN(block_size_wide[bsize], block_size_wide[BLOCK_64X64]) >> 1;
-#if CONFIG_HIGHBITDEPTH
   const int is_hbd = (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? 1 : 0;
-#endif  // CONFIG_HIGHBITDEPTH
 
   for (int plane = 0; plane < MAX_MB_PLANE; ++plane) {
     const struct macroblockd_plane *pd = &xd->plane[plane];
@@ -1544,12 +1510,10 @@
     const uint8_t *const tmp = &ctxt->adjacent[plane][plane_row * tmp_stride];
     const uint8_t *const mask = av1_get_obmc_mask(bw);
 
-#if CONFIG_HIGHBITDEPTH
     if (is_hbd)
       aom_highbd_blend_a64_hmask(dst, dst_stride, dst, dst_stride, tmp,
                                  tmp_stride, mask, bh, bw, xd->bd);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       aom_blend_a64_hmask(dst, dst_stride, dst, dst_stride, tmp, tmp_stride,
                           mask, bh, bw);
   }
@@ -1778,13 +1742,8 @@
 
 void av1_build_obmc_inter_predictors_sb(const AV1_COMMON *cm, MACROBLOCKD *xd,
                                         int mi_row, int mi_col) {
-#if CONFIG_HIGHBITDEPTH
   DECLARE_ALIGNED(16, uint8_t, tmp_buf1[2 * MAX_MB_PLANE * MAX_SB_SQUARE]);
   DECLARE_ALIGNED(16, uint8_t, tmp_buf2[2 * MAX_MB_PLANE * MAX_SB_SQUARE]);
-#else
-  DECLARE_ALIGNED(16, uint8_t, tmp_buf1[MAX_MB_PLANE * MAX_SB_SQUARE]);
-  DECLARE_ALIGNED(16, uint8_t, tmp_buf2[MAX_MB_PLANE * MAX_SB_SQUARE]);
-#endif  // CONFIG_HIGHBITDEPTH
   uint8_t *dst_buf1[MAX_MB_PLANE], *dst_buf2[MAX_MB_PLANE];
   int dst_stride1[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
   int dst_stride2[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
@@ -1793,7 +1752,6 @@
   int dst_height1[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
   int dst_height2[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
 
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     int len = sizeof(uint16_t);
     dst_buf1[0] = CONVERT_TO_BYTEPTR(tmp_buf1);
@@ -1803,16 +1761,13 @@
     dst_buf2[1] = CONVERT_TO_BYTEPTR(tmp_buf2 + MAX_SB_SQUARE * len);
     dst_buf2[2] = CONVERT_TO_BYTEPTR(tmp_buf2 + MAX_SB_SQUARE * 2 * len);
   } else {
-#endif  // CONFIG_HIGHBITDEPTH
     dst_buf1[0] = tmp_buf1;
     dst_buf1[1] = tmp_buf1 + MAX_SB_SQUARE;
     dst_buf1[2] = tmp_buf1 + MAX_SB_SQUARE * 2;
     dst_buf2[0] = tmp_buf2;
     dst_buf2[1] = tmp_buf2 + MAX_SB_SQUARE;
     dst_buf2[2] = tmp_buf2 + MAX_SB_SQUARE * 2;
-#if CONFIG_HIGHBITDEPTH
   }
-#endif  // CONFIG_HIGHBITDEPTH
   av1_build_prediction_by_above_preds(cm, xd, mi_row, mi_col, dst_buf1,
                                       dst_width1, dst_height1, dst_stride1);
   av1_build_prediction_by_left_preds(cm, xd, mi_row, mi_col, dst_buf2,
@@ -1923,7 +1878,6 @@
                      interstride, mask, bw, bh, bw, 0, 0);
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void combine_interintra_highbd(
     INTERINTRA_MODE mode, int use_wedge_interintra, int wedge_index,
     int wedge_sign, BLOCK_SIZE bsize, BLOCK_SIZE plane_bsize,
@@ -1951,7 +1905,6 @@
                             interpred8, interstride, mask, bw, bh, bw, 0, 0,
                             bd);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 void av1_build_intra_predictors_for_interintra(const AV1_COMMON *cm,
                                                MACROBLOCKD *xd,
@@ -1972,7 +1925,6 @@
                             const uint8_t *inter_pred, int inter_stride,
                             const uint8_t *intra_pred, int intra_stride) {
   const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, &xd->plane[plane]);
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     combine_interintra_highbd(
         xd->mi[0]->mbmi.interintra_mode, xd->mi[0]->mbmi.use_wedge_interintra,
@@ -1982,7 +1934,6 @@
         inter_stride, intra_pred, intra_stride, xd->bd);
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
   combine_interintra(xd->mi[0]->mbmi.interintra_mode,
                      xd->mi[0]->mbmi.use_wedge_interintra,
                      xd->mi[0]->mbmi.interintra_wedge_index,
@@ -1994,7 +1945,6 @@
 void av1_build_interintra_predictors_sby(const AV1_COMMON *cm, MACROBLOCKD *xd,
                                          uint8_t *ypred, int ystride,
                                          BUFFER_SET *ctx, BLOCK_SIZE bsize) {
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     DECLARE_ALIGNED(16, uint16_t, intrapredictor[MAX_SB_SQUARE]);
     av1_build_intra_predictors_for_interintra(
@@ -2003,7 +1953,6 @@
                            CONVERT_TO_BYTEPTR(intrapredictor), MAX_SB_SIZE);
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
   {
     DECLARE_ALIGNED(16, uint8_t, intrapredictor[MAX_SB_SQUARE]);
     av1_build_intra_predictors_for_interintra(cm, xd, bsize, 0, ctx,
@@ -2017,7 +1966,6 @@
                                          uint8_t *upred, int ustride,
                                          BUFFER_SET *ctx, int plane,
                                          BLOCK_SIZE bsize) {
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     DECLARE_ALIGNED(16, uint16_t, uintrapredictor[MAX_SB_SQUARE]);
     av1_build_intra_predictors_for_interintra(
@@ -2025,10 +1973,7 @@
         MAX_SB_SIZE);
     av1_combine_interintra(xd, bsize, plane, upred, ustride,
                            CONVERT_TO_BYTEPTR(uintrapredictor), MAX_SB_SIZE);
-    return;
-  }
-#endif  // CONFIG_HIGHBITDEPTH
-  {
+  } else {
     DECLARE_ALIGNED(16, uint8_t, uintrapredictor[MAX_SB_SQUARE]);
     av1_build_intra_predictors_for_interintra(cm, xd, bsize, plane, ctx,
                                               uintrapredictor, MAX_SB_SIZE);
@@ -2067,14 +2012,10 @@
 
   const struct scale_factors *const sf = &xd->block_refs[ref]->sf;
   struct buf_2d *const pre_buf = &pd->pre[ref];
-#if CONFIG_HIGHBITDEPTH
   uint8_t *const dst =
       (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH ? CONVERT_TO_BYTEPTR(ext_dst)
                                                    : ext_dst) +
       ext_dst_stride * y + x;
-#else
-  uint8_t *const dst = ext_dst + ext_dst_stride * y + x;
-#endif
   const MV mv = mi->mbmi.mv[ref].as_mv;
   uint8_t *pre;
   int xs, ys, subpel_x, subpel_y;
@@ -2161,7 +2102,6 @@
 
   if (is_compound && is_masked_compound_type(mbmi->interinter_compound_type)) {
     if (!plane && comp_data.interinter_compound_type == COMPOUND_SEG) {
-#if CONFIG_HIGHBITDEPTH
       if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
         build_compound_seg_mask_highbd(
             comp_data.seg_mask, comp_data.mask_type,
@@ -2169,31 +2109,26 @@
             CONVERT_TO_BYTEPTR(ext_dst1), ext_dst_stride1, mbmi->sb_type, h, w,
             xd->bd);
       else
-#endif  // CONFIG_HIGHBITDEPTH
         build_compound_seg_mask(comp_data.seg_mask, comp_data.mask_type,
                                 ext_dst0, ext_dst_stride0, ext_dst1,
                                 ext_dst_stride1, mbmi->sb_type, h, w);
     }
 
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
       build_masked_compound_highbd(
           dst, dst_buf->stride, CONVERT_TO_BYTEPTR(ext_dst0), ext_dst_stride0,
           CONVERT_TO_BYTEPTR(ext_dst1), ext_dst_stride1, &comp_data,
           mbmi->sb_type, h, w, xd->bd);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       build_masked_compound(dst, dst_buf->stride, ext_dst0, ext_dst_stride0,
                             ext_dst1, ext_dst_stride1, &comp_data,
                             mbmi->sb_type, h, w);
   } else {
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
       aom_highbd_convolve_copy(CONVERT_TO_BYTEPTR(ext_dst0), ext_dst_stride0,
                                dst, dst_buf->stride, NULL, 0, NULL, 0, w, h,
                                xd->bd);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       aom_convolve_copy(ext_dst0, ext_dst_stride0, dst, dst_buf->stride, NULL,
                         0, NULL, 0, w, h);
   }
diff --git a/av1/common/reconinter.h b/av1/common/reconinter.h
index c8b0181..653315f 100644
--- a/av1/common/reconinter.h
+++ b/av1/common/reconinter.h
@@ -114,7 +114,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static INLINE void highbd_inter_predictor(const uint8_t *src, int src_stride,
                                           uint8_t *dst, int dst_stride,
                                           int subpel_x, int subpel_y,
@@ -177,7 +176,6 @@
     }
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 // Set to (1 << 5) if the 32-ary codebooks are used for any bock size
 #define MAX_WEDGE_TYPES (1 << 4)
@@ -265,12 +263,10 @@
                              const uint8_t *src0, int src0_stride,
                              const uint8_t *src1, int src1_stride,
                              BLOCK_SIZE sb_type, int h, int w);
-#if CONFIG_HIGHBITDEPTH
 void build_compound_seg_mask_highbd(uint8_t *mask, SEG_MASK_TYPE mask_type,
                                     const uint8_t *src0, int src0_stride,
                                     const uint8_t *src1, int src1_stride,
                                     BLOCK_SIZE sb_type, int h, int w, int bd);
-#endif  // CONFIG_HIGHBITDEPTH
 
 void av1_make_masked_inter_predictor(
     const uint8_t *pre, int pre_stride, uint8_t *dst, int dst_stride,
@@ -322,14 +318,12 @@
     const WarpTypesAllowed *warp_types, int p_col, int p_row, int plane,
     int ref, enum mv_precision precision, int x, int y, const MACROBLOCKD *xd);
 
-#if CONFIG_HIGHBITDEPTH
 void av1_highbd_build_inter_predictor(
     const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride,
     const MV *mv_q3, const struct scale_factors *sf, int w, int h, int do_avg,
     InterpFilters interp_filters, const WarpTypesAllowed *warp_types, int p_col,
     int p_row, int plane, enum mv_precision precision, int x, int y,
     const MACROBLOCKD *xd);
-#endif
 
 static INLINE int scaled_buffer_offset(int x_offset, int y_offset, int stride,
                                        const struct scale_factors *sf) {
diff --git a/av1/common/reconintra.c b/av1/common/reconintra.c
index 01f39da..5ec821d 100644
--- a/av1/common/reconintra.c
+++ b/av1/common/reconintra.c
@@ -14,14 +14,11 @@
 #include "./av1_rtcd.h"
 #include "./aom_config.h"
 #include "./aom_dsp_rtcd.h"
-#include "aom_ports/system_state.h"
-
-#if CONFIG_HIGHBITDEPTH
 #include "aom_dsp/aom_dsp_common.h"
-#endif  // CONFIG_HIGHBITDEPTH
 #include "aom_mem/aom_mem.h"
-#include "aom_ports/mem.h"
 #include "aom_ports/aom_once.h"
+#include "aom_ports/mem.h"
+#include "aom_ports/system_state.h"
 #include "av1/common/reconintra.h"
 #include "av1/common/onyxc_int.h"
 #if CONFIG_CFL
@@ -641,13 +638,11 @@
 static intra_pred_fn pred[INTRA_MODES][TX_SIZES_ALL];
 static intra_pred_fn dc_pred[2][2][TX_SIZES_ALL];
 
-#if CONFIG_HIGHBITDEPTH
 typedef void (*intra_high_pred_fn)(uint16_t *dst, ptrdiff_t stride,
                                    const uint16_t *above, const uint16_t *left,
                                    int bd);
 static intra_high_pred_fn pred_high[INTRA_MODES][TX_SIZES_ALL];
 static intra_high_pred_fn dc_pred_high[2][2][TX_SIZES_ALL];
-#endif  // CONFIG_HIGHBITDEPTH
 
 static void av1_init_intra_predictors_internal(void) {
 #if CONFIG_EXT_INTRA
@@ -722,7 +717,6 @@
   INIT_ALL_SIZES(dc_pred[1][0], dc_left);
   INIT_ALL_SIZES(dc_pred[1][1], dc);
 
-#if CONFIG_HIGHBITDEPTH
   INIT_ALL_SIZES(pred_high[V_PRED], highbd_v);
   INIT_ALL_SIZES(pred_high[H_PRED], highbd_h);
   INIT_ALL_SIZES(pred_high[D207_PRED], highbd_d207e);
@@ -741,8 +735,6 @@
   INIT_ALL_SIZES(dc_pred_high[0][1], highbd_dc_top);
   INIT_ALL_SIZES(dc_pred_high[1][0], highbd_dc_left);
   INIT_ALL_SIZES(dc_pred_high[1][1], highbd_dc);
-#endif  // CONFIG_HIGHBITDEPTH
-
 #undef intra_pred_allsizes
 }
 
@@ -986,7 +978,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 // Directional prediction, zone 1: 0 < angle < 90
 static void highbd_dr_prediction_z1(uint16_t *dst, ptrdiff_t stride, int bw,
                                     int bh, const uint16_t *above,
@@ -1203,7 +1194,6 @@
     pred_high[H_PRED][tx_size](dst, stride, above, left, bd);
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // CONFIG_EXT_INTRA
 
 #if CONFIG_FILTER_INTRA
@@ -1361,7 +1351,6 @@
     default: assert(0);
   }
 }
-#if CONFIG_HIGHBITDEPTH
 static void highbd_filter_intra_predictor(uint16_t *dst, ptrdiff_t stride,
                                           TX_SIZE tx_size,
                                           const uint16_t *above,
@@ -1476,7 +1465,6 @@
     default: assert(0);
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // CONFIG_FILTER_INTRA
 
 #if CONFIG_INTRA_EDGE
@@ -1609,7 +1597,6 @@
 }
 #endif  // CONFIG_EXT_INTRA_MOD
 
-#if CONFIG_HIGHBITDEPTH
 void av1_filter_intra_edge_high_c(uint16_t *p, int sz, int strength) {
   if (!strength) return;
 
@@ -1646,8 +1633,6 @@
 }
 #endif  // CONFIG_EXT_INTRA_MOD
 
-#endif  // CONFIG_HIGHBITDEPTH
-
 #if CONFIG_INTRA_EDGE_UPSAMPLE
 static int use_intra_edge_upsample(int bs0, int bs1, int delta, int type) {
   const int d = abs(delta);
@@ -1686,7 +1671,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 void av1_upsample_intra_edge_high_c(uint16_t *p, int sz, int bd) {
   // interpolate half-sample positions
   assert(sz <= MAX_UPSAMPLE_SZ);
@@ -1710,12 +1694,9 @@
     p[2 * i] = in[i + 2];
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // CONFIG_INTRA_EDGE_UPSAMPLE
-
 #endif  // CONFIG_INTRA_EDGE
 
-#if CONFIG_HIGHBITDEPTH
 static void build_intra_predictors_high(
     const MACROBLOCKD *xd, const uint8_t *ref8, int ref_stride, uint8_t *dst8,
     int dst_stride, PREDICTION_MODE mode, TX_SIZE tx_size, int n_top_px,
@@ -1954,7 +1935,6 @@
     pred_high[mode][tx_size](dst, dst_stride, above_row, left_col, xd->bd);
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref,
                                    int ref_stride, uint8_t *dst, int dst_stride,
@@ -2257,7 +2237,6 @@
     const uint16_t *const palette =
         mbmi->palette_mode_info.palette_colors + plane * PALETTE_MAX_SIZE;
 
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
       uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst);
       for (r = 0; r < txhpx; ++r) {
@@ -2266,20 +2245,16 @@
         }
       }
     } else {
-#endif  // CONFIG_HIGHBITDEPTH
       for (r = 0; r < txhpx; ++r) {
         for (c = 0; c < txwpx; ++c) {
           dst[r * dst_stride + c] =
               (uint8_t)palette[map[(r + y) * stride + c + x]];
         }
       }
-#if CONFIG_HIGHBITDEPTH
     }
-#endif  // CONFIG_HIGHBITDEPTH
     return;
   }
 
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     build_intra_predictors_high(
         xd, ref, ref_stride, dst, dst_stride, mode, tx_size,
@@ -2289,7 +2264,6 @@
         have_bottom_left ? AOMMIN(txhpx, yd) : 0, plane);
     return;
   }
-#endif
 
   build_intra_predictors(xd, ref, ref_stride, dst, dst_stride, mode, tx_size,
                          have_top ? AOMMIN(txwpx, xr + txwpx) : 0,
@@ -2364,15 +2338,11 @@
 
   int row_bytes = block_width;
 
-#if CONFIG_HIGHBITDEPTH
   if (buf_flags & YV12_FLAG_HIGHBITDEPTH) {
     row_bytes *= 2;
     ref_row = (uint8_t *)CONVERT_TO_SHORTPTR(ref_row);
     dst_row = (const uint8_t *)CONVERT_TO_SHORTPTR(dst_row);
   }
-#else
-  (void)buf_flags;
-#endif  // CONFIG_HIGHBITDEPTH
 
   memcpy(tmp_row, ref_row, row_bytes);
   memcpy(ref_row, dst_row, row_bytes);
@@ -2382,15 +2352,10 @@
 static void restore_ref_row(int buf_flags, int block_width,
                             const uint8_t *tmp_row, uint8_t *ref_row) {
   int row_bytes = block_width;
-#if CONFIG_HIGHBITDEPTH
   if (buf_flags & YV12_FLAG_HIGHBITDEPTH) {
     row_bytes *= 2;
     ref_row = (uint8_t *)CONVERT_TO_SHORTPTR(ref_row);
   }
-#else
-  (void)buf_flags;
-#endif  // CONFIG_HIGHBITDEPTH
-
   memcpy(ref_row, tmp_row, row_bytes);
 }
 
@@ -2402,7 +2367,6 @@
                              uint8_t *tmp_row) {
   if (ref_row == dst_row && ref_stride == dst_stride) return 0;
 
-#if CONFIG_HIGHBITDEPTH
   if (buf_flags & YV12_FLAG_HIGHBITDEPTH) {
     uint16_t *tmp_16 = (uint16_t *)tmp_row;
     uint16_t *ref_16 = CONVERT_TO_SHORTPTR(ref_row);
@@ -2413,23 +2377,17 @@
       ref_16[i * ref_stride] = dst_16[i * dst_stride];
     }
   } else {
-#endif  // CONFIG_HIGHBITDEPTH
     for (int i = 0; i < block_height; ++i) {
       tmp_row[i] = ref_row[i * ref_stride];
       ref_row[i * ref_stride] = dst_row[i * dst_stride];
     }
-#if CONFIG_HIGHBITDEPTH
   }
-#else
-  (void)buf_flags;
-#endif  // CONFIG_HIGHBITDEPTH
   return 1;
 }
 
 static void restore_ref_col(int buf_flags, int block_height,
                             const uint8_t *tmp_row, uint8_t *ref_row,
                             int ref_stride) {
-#if CONFIG_HIGHBITDEPTH
   if (buf_flags & YV12_FLAG_HIGHBITDEPTH) {
     const uint16_t *tmp_16 = (const uint16_t *)tmp_row;
     uint16_t *ref_16 = CONVERT_TO_SHORTPTR(ref_row);
@@ -2438,15 +2396,10 @@
       ref_16[i * ref_stride] = tmp_16[i];
     }
   } else {
-#endif  // CONFIG_HIGHBITDEPTH
     for (int i = 0; i < block_height; ++i) {
       ref_row[i * ref_stride] = tmp_row[i];
     }
-#if CONFIG_HIGHBITDEPTH
   }
-#else
-  (void)buf_flags;
-#endif  // CONFIG_HIGHBITDEPTH
 }
 
 void av1_predict_intra_block(const AV1_COMMON *cm, const MACROBLOCKD *xd,
@@ -2479,14 +2432,10 @@
          (block_width == (wpx >> 1) && block_height == hpx) ||
          (block_width == wpx && block_height == (hpx >> 1)));
 
-// The tmp buffer needs to be big enough to hold MAX_SB_SIZE samples
-// from the image. If CONFIG_HIGHBITDEPTH is enabled, it also needs
-// to be big enough and correctly aligned to hold 16-bit entries.
-#if CONFIG_HIGHBITDEPTH
+  // The tmp buffer needs to be big enough to hold MAX_SB_SIZE samples
+  // from the image. If CONFIG_HIGHBITDEPTH is enabled, it also needs
+  // to be big enough and correctly aligned to hold 16-bit entries.
   uint16_t tmp_buf[MAX_SB_SIZE];
-#else
-  uint8_t tmp_buf[MAX_SB_SIZE];
-#endif  // CONFIG_HIGHBITDEPTH
   uint8_t *tmp = (uint8_t *)tmp_buf;
 
   if (block_width < block_height) {
diff --git a/av1/common/resize.c b/av1/common/resize.c
index e390810..2aec8e2 100644
--- a/av1/common/resize.c
+++ b/av1/common/resize.c
@@ -17,9 +17,7 @@
 #include <string.h>
 
 #include "./aom_config.h"
-#if CONFIG_HIGHBITDEPTH
 #include "aom_dsp/aom_dsp_common.h"
-#endif  // CONFIG_HIGHBITDEPTH
 #include "aom_ports/mem.h"
 #include "aom_scale/aom_scale.h"
 #include "av1/common/common.h"
@@ -680,7 +678,6 @@
 }
 #endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
-#if CONFIG_HIGHBITDEPTH
 static void highbd_interpolate_core(const uint16_t *const input, int in_length,
                                     uint16_t *output, int out_length, int bd,
                                     const int16_t *interp_filters,
@@ -992,8 +989,6 @@
 }
 #endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
-#endif  // CONFIG_HIGHBITDEPTH
-
 void av1_resize_frame420(const uint8_t *const y, int y_stride,
                          const uint8_t *const u, const uint8_t *const v,
                          int uv_stride, int height, int width, uint8_t *oy,
@@ -1028,7 +1023,6 @@
   resize_plane(v, height, width, uv_stride, ov, oheight, owidth, ouv_stride);
 }
 
-#if CONFIG_HIGHBITDEPTH
 void av1_highbd_resize_frame420(const uint8_t *const y, int y_stride,
                                 const uint8_t *const u, const uint8_t *const v,
                                 int uv_stride, int height, int width,
@@ -1070,15 +1064,9 @@
   highbd_resize_plane(v, height, width, uv_stride, ov, oheight, owidth,
                       ouv_stride, bd);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
-#if CONFIG_HIGHBITDEPTH
 void av1_resize_and_extend_frame(const YV12_BUFFER_CONFIG *src,
                                  YV12_BUFFER_CONFIG *dst, int bd) {
-#else
-void av1_resize_and_extend_frame(const YV12_BUFFER_CONFIG *src,
-                                 YV12_BUFFER_CONFIG *dst) {
-#endif  // CONFIG_HIGHBITDEPTH
   // TODO(dkovalev): replace YV12_BUFFER_CONFIG with aom_image_t
   int i;
   const uint8_t *const srcs[3] = { src->y_buffer, src->u_buffer,
@@ -1096,13 +1084,11 @@
                                dst->uv_crop_height };
 
   for (i = 0; i < MAX_MB_PLANE; ++i) {
-#if CONFIG_HIGHBITDEPTH
     if (src->flags & YV12_FLAG_HIGHBITDEPTH)
       highbd_resize_plane(srcs[i], src_heights[i], src_widths[i],
                           src_strides[i], dsts[i], dst_heights[i],
                           dst_widths[i], dst_strides[i], bd);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       resize_plane(srcs[i], src_heights[i], src_widths[i], src_strides[i],
                    dsts[i], dst_heights[i], dst_widths[i], dst_strides[i]);
   }
@@ -1110,15 +1096,9 @@
 }
 
 #if CONFIG_HORZONLY_FRAME_SUPERRES
-#if CONFIG_HIGHBITDEPTH
 void av1_upscale_normative_and_extend_frame(const YV12_BUFFER_CONFIG *src,
                                             YV12_BUFFER_CONFIG *dst,
                                             int superres_denom, int bd) {
-#else
-void av1_upscale_normative_and_extend_frame(const YV12_BUFFER_CONFIG *src,
-                                            YV12_BUFFER_CONFIG *dst,
-                                            int superres_denom) {
-#endif  // CONFIG_HIGHBITDEPTH
   int i;
   const uint8_t *const srcs[3] = { src->y_buffer, src->u_buffer,
                                    src->v_buffer };
@@ -1135,13 +1115,11 @@
                                dst->uv_crop_height };
 
   for (i = 0; i < MAX_MB_PLANE; ++i) {
-#if CONFIG_HIGHBITDEPTH
     if (src->flags & YV12_FLAG_HIGHBITDEPTH)
       highbd_upscale_normative_plane(
           srcs[i], src_heights[i], src_widths[i], src_strides[i], dsts[i],
           dst_heights[i], dst_widths[i], dst_strides[i], superres_denom, bd);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       upscale_normative_plane(srcs[i], src_heights[i], src_widths[i],
                               src_strides[i], dsts[i], dst_heights[i],
                               dst_widths[i], dst_strides[i], superres_denom);
@@ -1155,11 +1133,7 @@
                                           YV12_BUFFER_CONFIG *scaled) {
   if (cm->width != unscaled->y_crop_width ||
       cm->height != unscaled->y_crop_height) {
-#if CONFIG_HIGHBITDEPTH
     av1_resize_and_extend_frame(unscaled, scaled, (int)cm->bit_depth);
-#else
-    av1_resize_and_extend_frame(unscaled, scaled);
-#endif  // CONFIG_HIGHBITDEPTH
     return scaled;
   } else {
     return unscaled;
@@ -1212,10 +1186,8 @@
 
   if (aom_alloc_frame_buffer(&copy_buffer, cm->width, cm->height,
                              cm->subsampling_x, cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-                             cm->use_highbitdepth,
-#endif  // CONFIG_HIGHBITDEPTH
-                             AOM_BORDER_IN_PIXELS, cm->byte_alignment))
+                             cm->use_highbitdepth, AOM_BORDER_IN_PIXELS,
+                             cm->byte_alignment))
     aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
                        "Failed to allocate copy buffer for superres upscaling");
 
@@ -1240,13 +1212,11 @@
           &cm->error, AOM_CODEC_MEM_ERROR,
           "Failed to free current frame buffer before superres upscaling");
 
-    if (aom_realloc_frame_buffer(
-            frame_to_show, cm->superres_upscaled_width,
-            cm->superres_upscaled_height, cm->subsampling_x, cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-            cm->use_highbitdepth,
-#endif  // CONFIG_HIGHBITDEPTH
-            AOM_BORDER_IN_PIXELS, cm->byte_alignment, fb, cb, cb_priv))
+    if (aom_realloc_frame_buffer(frame_to_show, cm->superres_upscaled_width,
+                                 cm->superres_upscaled_height,
+                                 cm->subsampling_x, cm->subsampling_y,
+                                 cm->use_highbitdepth, AOM_BORDER_IN_PIXELS,
+                                 cm->byte_alignment, fb, cb, cb_priv))
       aom_internal_error(
           &cm->error, AOM_CODEC_MEM_ERROR,
           "Failed to allocate current frame buffer for superres upscaling");
@@ -1254,10 +1224,7 @@
     // Don't use callbacks on the encoder.
     if (aom_alloc_frame_buffer(frame_to_show, cm->superres_upscaled_width,
                                cm->superres_upscaled_height, cm->subsampling_x,
-                               cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-                               cm->use_highbitdepth,
-#endif  // CONFIG_HIGHBITDEPTH
+                               cm->subsampling_y, cm->use_highbitdepth,
                                AOM_BORDER_IN_PIXELS, cm->byte_alignment))
       aom_internal_error(
           &cm->error, AOM_CODEC_MEM_ERROR,
@@ -1272,15 +1239,9 @@
 
   // Scale up and back into frame_to_show.
   assert(frame_to_show->y_crop_width != cm->width);
-#if CONFIG_HIGHBITDEPTH
   av1_upscale_normative_and_extend_frame(&copy_buffer, frame_to_show,
                                          cm->superres_scale_denominator,
                                          (int)cm->bit_depth);
-#else
-  av1_upscale_normative_and_extend_frame(&copy_buffer, frame_to_show,
-                                         cm->superres_scale_denominator);
-#endif  // CONFIG_HIGHBITDEPTH
-
   // Free the copy buffer
   aom_free_frame_buffer(&copy_buffer);
 }
diff --git a/av1/common/resize.h b/av1/common/resize.h
index d738c0e..f348736 100644
--- a/av1/common/resize.h
+++ b/av1/common/resize.h
@@ -39,7 +39,6 @@
                          int oy_stride, uint8_t *ou, uint8_t *ov,
                          int ouv_stride, int oheight, int owidth);
 
-#if CONFIG_HIGHBITDEPTH
 void av1_highbd_resize_plane(const uint8_t *const input, int height, int width,
                              int in_stride, uint8_t *output, int height2,
                              int width2, int out_stride, int bd);
@@ -61,26 +60,13 @@
                                 uint8_t *oy, int oy_stride, uint8_t *ou,
                                 uint8_t *ov, int ouv_stride, int oheight,
                                 int owidth, int bd);
-#endif  // CONFIG_HIGHBITDEPTH
-
-#if CONFIG_HIGHBITDEPTH
 void av1_resize_and_extend_frame(const YV12_BUFFER_CONFIG *src,
                                  YV12_BUFFER_CONFIG *dst, int bd);
-#else
-void av1_resize_and_extend_frame(const YV12_BUFFER_CONFIG *src,
-                                 YV12_BUFFER_CONFIG *dst);
-#endif  // CONFIG_HIGHBITDEPTH
 
 #if CONFIG_HORZONLY_FRAME_SUPERRES
-#if CONFIG_HIGHBITDEPTH
 void av1_upscale_normative_and_extend_frame(const YV12_BUFFER_CONFIG *src,
                                             YV12_BUFFER_CONFIG *dst,
                                             int superres_denom, int bd);
-#else
-void av1_upscale_normative_and_extend_frame(const YV12_BUFFER_CONFIG *src,
-                                            YV12_BUFFER_CONFIG *dst,
-                                            int superres_denom);
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 YV12_BUFFER_CONFIG *av1_scale_if_required(AV1_COMMON *cm,
diff --git a/av1/common/restoration.c b/av1/common/restoration.c
index 43d2722..7e6de03 100644
--- a/av1/common/restoration.c
+++ b/av1/common/restoration.c
@@ -167,7 +167,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void extend_frame_highbd(uint16_t *data, int width, int height,
                                 int stride, int border_horz, int border_vert) {
   uint16_t *data_p;
@@ -187,20 +186,14 @@
            (width + 2 * border_horz) * sizeof(uint16_t));
   }
 }
-#endif
 
 void extend_frame(uint8_t *data, int width, int height, int stride,
                   int border_horz, int border_vert, int highbd) {
-#if !CONFIG_HIGHBITDEPTH
-  assert(highbd == 0);
-  (void)highbd;
-#else
   if (highbd)
     extend_frame_highbd(CONVERT_TO_SHORTPTR(data), width, height, stride,
                         border_horz, border_vert);
   else
-#endif
-  extend_frame_lowbd(data, width, height, stride, border_horz, border_vert);
+    extend_frame_lowbd(data, width, height, stride, border_horz, border_vert);
 }
 
 static void copy_tile_lowbd(int width, int height, const uint8_t *src,
@@ -209,26 +202,19 @@
     memcpy(dst + i * dst_stride, src + i * src_stride, width);
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void copy_tile_highbd(int width, int height, const uint16_t *src,
                              int src_stride, uint16_t *dst, int dst_stride) {
   for (int i = 0; i < height; ++i)
     memcpy(dst + i * dst_stride, src + i * src_stride, width * sizeof(*dst));
 }
-#endif
 
 static void copy_tile(int width, int height, const uint8_t *src, int src_stride,
                       uint8_t *dst, int dst_stride, int highbd) {
-#if !CONFIG_HIGHBITDEPTH
-  assert(highbd == 0);
-  (void)highbd;
-#else
   if (highbd)
     copy_tile_highbd(width, height, CONVERT_TO_SHORTPTR(src), src_stride,
                      CONVERT_TO_SHORTPTR(dst), dst_stride);
   else
-#endif
-  copy_tile_lowbd(width, height, src, src_stride, dst, dst_stride);
+    copy_tile_lowbd(width, height, src, src_stride, dst, dst_stride);
 }
 
 #if CONFIG_STRIPED_LOOP_RESTORATION
@@ -368,8 +354,6 @@
 #endif  // CONFIG_LOOPFILTERING_ACROSS_TILES
     uint8_t *data8, int data_stride, RestorationLineBuffers *rlbs,
     int copy_above, int copy_below) {
-  assert(CONFIG_HIGHBITDEPTH || !use_highbd);
-
   // Offsets within the line buffers. The buffer logically starts at column
   // -RESTORATION_EXTRA_HORZ so the 1st column (at x0 - RESTORATION_EXTRA_HORZ)
   // has column x0 in the buffer.
@@ -504,8 +488,6 @@
 #endif  // CONFIG_LOOPFILTERING_ACROSS_TILES_EXT
 #endif  // CONFIG_LOOPFILTERING_ACROSS_TILES
     uint8_t *data8, int data_stride, int copy_above, int copy_below) {
-  assert(CONFIG_HIGHBITDEPTH || !use_highbd);
-
   const int line_width =
       (limits->h_end - limits->h_start) + 2 * RESTORATION_EXTRA_HORZ;
   const int line_size = line_width << use_highbd;
@@ -1262,7 +1244,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 #if USE_WIENER_HIGH_INTERMEDIATE_PRECISION
 #define wiener_highbd_convolve8_add_src aom_highbd_convolve8_add_src_hip
 #else
@@ -1300,7 +1281,6 @@
                                  dst8 + j, dst_stride, tmpbuf, bit_depth, 1);
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 typedef void (*stripe_filter_fun)(const RestorationUnitInfo *rui,
                                   int stripe_width, int stripe_height,
@@ -1308,19 +1288,11 @@
                                   int src_stride, uint8_t *dst, int dst_stride,
                                   int32_t *tmpbuf, int bit_depth);
 
-#if CONFIG_HIGHBITDEPTH
 #define NUM_STRIPE_FILTERS 4
-#else
-#define NUM_STRIPE_FILTERS 2
-#endif
 
 static const stripe_filter_fun stripe_filters[NUM_STRIPE_FILTERS] = {
-  wiener_filter_stripe,
-  sgrproj_filter_stripe,
-#if CONFIG_HIGHBITDEPTH
-  wiener_filter_stripe_highbd,
+  wiener_filter_stripe, sgrproj_filter_stripe, wiener_filter_stripe_highbd,
   sgrproj_filter_stripe_highbd
-#endif  // CONFIG_HIGHBITDEPTH
 };
 
 // Filter one restoration unit
@@ -1497,25 +1469,18 @@
   memset(&dst, 0, sizeof(dst));
   const int frame_width = frame->crop_widths[0];
   const int frame_height = ALIGN_POWER_OF_TWO(frame->crop_heights[0], 3);
-  if (aom_realloc_frame_buffer(
-          &dst, frame_width, frame_height, cm->subsampling_x, cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-          cm->use_highbitdepth,
-#endif
-          AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL, NULL, NULL) < 0)
+  if (aom_realloc_frame_buffer(&dst, frame_width, frame_height,
+                               cm->subsampling_x, cm->subsampling_y,
+                               cm->use_highbitdepth, AOM_BORDER_IN_PIXELS,
+                               cm->byte_alignment, NULL, NULL, NULL) < 0)
     aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
                        "Failed to allocate restoration dst buffer");
 
 #if CONFIG_STRIPED_LOOP_RESTORATION
   RestorationLineBuffers rlbs;
 #endif  // CONFIG_STRIPED_LOOP_RESTORATION
-#if CONFIG_HIGHBITDEPTH
   const int bit_depth = cm->bit_depth;
   const int highbd = cm->use_highbitdepth;
-#else
-  const int bit_depth = 8;
-  const int highbd = 0;
-#endif
 
   for (int plane = 0; plane < 3; ++plane) {
     const RestorationInfo *rsi = &cm->rst_info[plane];
@@ -1767,13 +1732,9 @@
                          int extend, int use_highbitdepth) {
   for (int i = 0; i < height; ++i) {
     if (use_highbitdepth) {
-#if CONFIG_HIGHBITDEPTH
       uint16_t *buf16 = (uint16_t *)buf;
       aom_memset16(buf16 - extend, buf16[0], extend);
       aom_memset16(buf16 + width, buf16[width - 1], extend);
-#else
-      assert(0 && "use_highbitdepth set but CONFIG_HIGHBITDEPTH not enabled");
-#endif  // CONFIG_HIGHBITDEPTH
     } else {
       memset(buf - extend, buf[0], extend);
       memset(buf + width, buf[width - 1], extend);
@@ -1814,7 +1775,6 @@
     const int ss_x = is_uv && cm->subsampling_x;
     upscaled_width = (cm->superres_upscaled_width + ss_x) >> ss_x;
     const int step = av1_get_upscale_convolve_step(src_width, upscaled_width);
-#if CONFIG_HIGHBITDEPTH
     if (use_highbd)
       av1_highbd_convolve_horiz_rs(
           (uint16_t *)src_rows, src_stride >> 1, (uint16_t *)bdry_rows,
@@ -1822,7 +1782,6 @@
           &av1_resize_filter_normative[0][0], UPSCALE_NORMATIVE_TAPS, 0, step,
           cm->bit_depth);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       av1_convolve_horiz_rs(src_rows, src_stride, bdry_rows, bdry_stride,
                             upscaled_width, RESTORATION_CTX_VERT,
                             &av1_resize_filter_normative[0][0],
@@ -1988,12 +1947,7 @@
 // lines are saved in rst_internal.stripe_boundary_lines
 void av1_loop_restoration_save_boundary_lines(const YV12_BUFFER_CONFIG *frame,
                                               AV1_COMMON *cm, int after_cdef) {
-#if CONFIG_HIGHBITDEPTH
   const int use_highbd = cm->use_highbitdepth;
-#else
-  const int use_highbd = 0;
-#endif
-
   for (int p = 0; p < MAX_MB_PLANE; ++p) {
     TileInfo tile_info;
     for (int tile_row = 0; tile_row < cm->tile_rows; ++tile_row) {
diff --git a/av1/common/scale.c b/av1/common/scale.c
index 54ad762..b19513e 100644
--- a/av1/common/scale.c
+++ b/av1/common/scale.c
@@ -62,14 +62,9 @@
   return res;
 }
 
-#if CONFIG_HIGHBITDEPTH
 void av1_setup_scale_factors_for_frame(struct scale_factors *sf, int other_w,
                                        int other_h, int this_w, int this_h,
                                        int use_highbd) {
-#else
-void av1_setup_scale_factors_for_frame(struct scale_factors *sf, int other_w,
-                                       int other_h, int this_w, int this_h) {
-#endif
   if (!valid_ref_frame_size(other_w, other_h, this_w, this_h)) {
     sf->x_scale_fp = REF_INVALID_SCALE;
     sf->y_scale_fp = REF_INVALID_SCALE;
@@ -137,7 +132,6 @@
   sf->predict[1][1][0] = aom_convolve8;
   sf->predict[1][1][1] = aom_convolve8_avg;
 
-#if CONFIG_HIGHBITDEPTH
   if (use_highbd) {
     if (sf->x_step_q4 == SCALE_SUBPEL_SHIFTS) {
       if (sf->y_step_q4 == SCALE_SUBPEL_SHIFTS) {
@@ -180,7 +174,6 @@
     sf->highbd_predict[1][1][0] = aom_highbd_convolve8;
     sf->highbd_predict[1][1][1] = aom_highbd_convolve8_avg;
   }
-#endif  // CONFIG_HIGHBITDEPTH
 
   // AV1 convolve functions
   // Special case convolve functions should produce the same result as
diff --git a/av1/common/scale.h b/av1/common/scale.h
index ed5d034..e7754c4 100644
--- a/av1/common/scale.h
+++ b/av1/common/scale.h
@@ -35,10 +35,8 @@
   int (*scale_value_x)(int val, const struct scale_factors *sf);
   int (*scale_value_y)(int val, const struct scale_factors *sf);
 
-  convolve_fn_t predict[2][2][2];  // horiz, vert, avg
-#if CONFIG_HIGHBITDEPTH
+  convolve_fn_t predict[2][2][2];                // horiz, vert, avg
   highbd_convolve_fn_t highbd_predict[2][2][2];  // horiz, vert, avg
-#endif                                           // CONFIG_HIGHBITDEPTH
 
   // convolve_fn_ptr[subpel_x != 0][subpel_y != 0][is_compound]
   aom_convolve_fn_t convolve[2][2][2];
@@ -46,14 +44,9 @@
 
 MV32 av1_scale_mv(const MV *mv, int x, int y, const struct scale_factors *sf);
 
-#if CONFIG_HIGHBITDEPTH
 void av1_setup_scale_factors_for_frame(struct scale_factors *sf, int other_w,
                                        int other_h, int this_w, int this_h,
                                        int use_high);
-#else
-void av1_setup_scale_factors_for_frame(struct scale_factors *sf, int other_w,
-                                       int other_h, int this_w, int this_h);
-#endif  // CONFIG_HIGHBITDEPTH
 
 static INLINE int av1_is_valid_scale(const struct scale_factors *sf) {
   return sf->x_scale_fp != REF_INVALID_SCALE &&
diff --git a/av1/common/warped_motion.c b/av1/common/warped_motion.c
index c232cb4..efaa4c8 100644
--- a/av1/common/warped_motion.c
+++ b/av1/common/warped_motion.c
@@ -402,7 +402,6 @@
   return 1;
 }
 
-#if CONFIG_HIGHBITDEPTH
 static INLINE int highbd_error_measure(int err, int bd) {
   const int b = bd - 8;
   const int bmask = (1 << b) - 1;
@@ -636,7 +635,6 @@
   }
   return gm_sumerr;
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 static INLINE int error_measure(int err) {
   return error_measure_lut[255 + err];
@@ -945,58 +943,42 @@
   return gm_sumerr;
 }
 
-int64_t av1_frame_error(
-#if CONFIG_HIGHBITDEPTH
-    int use_hbd, int bd,
-#endif  // CONFIG_HIGHBITDEPTH
-    const uint8_t *ref, int stride, uint8_t *dst, int p_width, int p_height,
-    int p_stride) {
-#if CONFIG_HIGHBITDEPTH
+int64_t av1_frame_error(int use_hbd, int bd, const uint8_t *ref, int stride,
+                        uint8_t *dst, int p_width, int p_height, int p_stride) {
   if (use_hbd) {
     return highbd_frame_error(CONVERT_TO_SHORTPTR(ref), stride,
                               CONVERT_TO_SHORTPTR(dst), p_width, p_height,
                               p_stride, bd);
   }
-#endif  // CONFIG_HIGHBITDEPTH
   return frame_error(ref, stride, dst, p_width, p_height, p_stride);
 }
 
-int64_t av1_warp_error(WarpedMotionParams *wm,
-#if CONFIG_HIGHBITDEPTH
-                       int use_hbd, int bd,
-#endif  // CONFIG_HIGHBITDEPTH
+int64_t av1_warp_error(WarpedMotionParams *wm, int use_hbd, int bd,
                        const uint8_t *ref, int width, int height, int stride,
                        uint8_t *dst, int p_col, int p_row, int p_width,
                        int p_height, int p_stride, int subsampling_x,
                        int subsampling_y, int64_t best_error) {
   if (wm->wmtype <= AFFINE)
     if (!get_shear_params(wm)) return 1;
-#if CONFIG_HIGHBITDEPTH
   if (use_hbd)
     return highbd_warp_error(wm, ref, width, height, stride, dst, p_col, p_row,
                              p_width, p_height, p_stride, subsampling_x,
                              subsampling_y, bd, best_error);
-#endif  // CONFIG_HIGHBITDEPTH
   return warp_error(wm, ref, width, height, stride, dst, p_col, p_row, p_width,
                     p_height, p_stride, subsampling_x, subsampling_y,
                     best_error);
 }
 
-void av1_warp_plane(WarpedMotionParams *wm,
-#if CONFIG_HIGHBITDEPTH
-                    int use_hbd, int bd,
-#endif  // CONFIG_HIGHBITDEPTH
+void av1_warp_plane(WarpedMotionParams *wm, int use_hbd, int bd,
                     const uint8_t *ref, int width, int height, int stride,
                     uint8_t *pred, int p_col, int p_row, int p_width,
                     int p_height, int p_stride, int subsampling_x,
                     int subsampling_y, ConvolveParams *conv_params) {
-#if CONFIG_HIGHBITDEPTH
   if (use_hbd)
     highbd_warp_plane(wm, ref, width, height, stride, pred, p_col, p_row,
                       p_width, p_height, p_stride, subsampling_x, subsampling_y,
                       bd, conv_params);
   else
-#endif  // CONFIG_HIGHBITDEPTH
     warp_plane(wm, ref, width, height, stride, pred, p_col, p_row, p_width,
                p_height, p_stride, subsampling_x, subsampling_y, conv_params);
 }
diff --git a/av1/common/warped_motion.h b/av1/common/warped_motion.h
index c200300..bbd1bcf 100644
--- a/av1/common/warped_motion.h
+++ b/av1/common/warped_motion.h
@@ -51,10 +51,7 @@
 
 // Returns the error between the result of applying motion 'wm' to the frame
 // described by 'ref' and the frame described by 'dst'.
-int64_t av1_warp_error(WarpedMotionParams *wm,
-#if CONFIG_HIGHBITDEPTH
-                       int use_hbd, int bd,
-#endif  // CONFIG_HIGHBITDEPTH
+int64_t av1_warp_error(WarpedMotionParams *wm, int use_hbd, int bd,
                        const uint8_t *ref, int width, int height, int stride,
                        uint8_t *dst, int p_col, int p_row, int p_width,
                        int p_height, int p_stride, int subsampling_x,
@@ -62,17 +59,10 @@
 
 // Returns the error between the frame described by 'ref' and the frame
 // described by 'dst'.
-int64_t av1_frame_error(
-#if CONFIG_HIGHBITDEPTH
-    int use_hbd, int bd,
-#endif  // CONFIG_HIGHBITDEPTH
-    const uint8_t *ref, int stride, uint8_t *dst, int p_width, int p_height,
-    int p_stride);
+int64_t av1_frame_error(int use_hbd, int bd, const uint8_t *ref, int stride,
+                        uint8_t *dst, int p_width, int p_height, int p_stride);
 
-void av1_warp_plane(WarpedMotionParams *wm,
-#if CONFIG_HIGHBITDEPTH
-                    int use_hbd, int bd,
-#endif  // CONFIG_HIGHBITDEPTH
+void av1_warp_plane(WarpedMotionParams *wm, int use_hbd, int bd,
                     const uint8_t *ref, int width, int height, int stride,
                     uint8_t *pred, int p_col, int p_row, int p_width,
                     int p_height, int p_stride, int subsampling_x,
diff --git a/av1/common/x86/av1_convolve_scale_sse4.c b/av1/common/x86/av1_convolve_scale_sse4.c
index 3c6ef51..3959b06 100644
--- a/av1/common/x86/av1_convolve_scale_sse4.c
+++ b/av1/common/x86/av1_convolve_scale_sse4.c
@@ -517,7 +517,6 @@
             filter_params_y, conv_params, 8);
 }
 
-#if CONFIG_HIGHBITDEPTH
 // An wrapper to generate the SHUFPD instruction with __m128i types (just
 // writing _mm_shuffle_pd at the callsites gets a bit ugly because of the
 // casts)
@@ -724,4 +723,3 @@
     vfilter(tmp, im_h, dst, dst_stride, w, h, subpel_y_qn, y_step_qn,
             filter_params_y, conv_params, bd);
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/av1/common/x86/convolve_avx2.c b/av1/common/x86/convolve_avx2.c
index 93e7295..d0be345 100644
--- a/av1/common/x86/convolve_avx2.c
+++ b/av1/common/x86/convolve_avx2.c
@@ -194,7 +194,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static INLINE void cal_highbd_rounding_32xn_avx2(const int32_t *src,
                                                  uint16_t *dst,
                                                  const __m256i *rnd, int shift,
@@ -337,4 +336,3 @@
     } while (h > 0);
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/av1/common/x86/selfguided_sse4.c b/av1/common/x86/selfguided_sse4.c
index 3a9df0e..1247b92 100644
--- a/av1/common/x86/selfguided_sse4.c
+++ b/av1/common/x86/selfguided_sse4.c
@@ -11,13 +11,12 @@
   return _mm_cvtepu8_epi32(xx_loadl_32(p));
 }
 
-#if CONFIG_HIGHBITDEPTH
 // Load 4 halfwords from the possibly-misaligned pointer p, extend each
 // halfword to 32-bit precision and return them in an SSE register.
 static __m128i xx_load_extend_16_32(const void *p) {
   return _mm_cvtepu16_epi32(xx_loadl_64(p));
 }
-#endif
+
 // Compute the scan of an SSE register holding 4 32-bit integers. If the
 // register holds x0..x3 then the scan will hold x0, x0+x1, x0+x1+x2,
 // x0+x1+x2+x3
@@ -73,7 +72,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 // Compute two integral images from src. B sums elements; A sums their squares
 //
 // A and B should be aligned to 16 bytes. buf_stride should be a multiple of 4.
@@ -117,7 +115,6 @@
     }
   }
 }
-#endif
 
 // Compute four values of boxsum from the given integral image. ii should point
 // at the middle of the box (for the first value). r is the box radius
@@ -328,14 +325,12 @@
       SGRPROJ_BORDER_HORZ + dgd_stride * SGRPROJ_BORDER_VERT;
   const uint8_t *dgd0 = dgd8 - dgd_diag_border;
 
-// Generate integral images from the input. C will contain sums of squares; D
-// will contain just sums
-#if CONFIG_HIGHBITDEPTH
+  // Generate integral images from the input. C will contain sums of squares; D
+  // will contain just sums
   if (highbd)
     integral_images_highbd(CONVERT_TO_SHORTPTR(dgd0), dgd_stride, width_ext,
                            height_ext, Ctl, Dtl, buf_stride);
   else
-#endif  // CONFIG_HIGHBITDEPTH
     integral_images(dgd0, dgd_stride, width_ext, height_ext, Ctl, Dtl,
                     buf_stride);
 
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 6484008..7ceee82 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -1245,11 +1245,8 @@
   lock_buffer_pool(pool);
   if (aom_realloc_frame_buffer(
           get_frame_new_buffer(cm), cm->width, cm->height, cm->subsampling_x,
-          cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-          cm->use_highbitdepth,
-#endif
-          AOM_BORDER_IN_PIXELS, cm->byte_alignment,
+          cm->subsampling_y, cm->use_highbitdepth, AOM_BORDER_IN_PIXELS,
+          cm->byte_alignment,
           &pool->frame_bufs[cm->new_fb_idx].raw_frame_buffer, pool->get_fb_cb,
           pool->cb_priv)) {
     unlock_buffer_pool(pool);
@@ -1355,11 +1352,8 @@
   lock_buffer_pool(pool);
   if (aom_realloc_frame_buffer(
           get_frame_new_buffer(cm), cm->width, cm->height, cm->subsampling_x,
-          cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-          cm->use_highbitdepth,
-#endif
-          AOM_BORDER_IN_PIXELS, cm->byte_alignment,
+          cm->subsampling_y, cm->use_highbitdepth, AOM_BORDER_IN_PIXELS,
+          cm->byte_alignment,
           &pool->frame_bufs[cm->new_fb_idx].raw_frame_buffer, pool->get_fb_cb,
           pool->cb_priv)) {
     unlock_buffer_pool(pool);
@@ -2163,11 +2157,7 @@
     cm->bit_depth = AOM_BITS_8;
   }
 
-#if CONFIG_HIGHBITDEPTH
   cm->use_highbitdepth = cm->bit_depth > AOM_BITS_8 || !allow_lowbitdepth;
-#else
-  (void)allow_lowbitdepth;
-#endif
 #if CONFIG_COLORSPACE_HEADERS
   cm->color_space = aom_rb_read_literal(rb, 5);
   cm->transfer_function = aom_rb_read_literal(rb, 5);
@@ -2485,9 +2475,7 @@
 
   cm->profile = av1_read_profile(rb);
 
-  const BITSTREAM_PROFILE MAX_SUPPORTED_PROFILE =
-      CONFIG_HIGHBITDEPTH ? MAX_PROFILES : PROFILE_2;
-
+  const BITSTREAM_PROFILE MAX_SUPPORTED_PROFILE = MAX_PROFILES;
   if (cm->profile >= MAX_SUPPORTED_PROFILE)
     aom_internal_error(&cm->error, AOM_CODEC_UNSUP_BITSTREAM,
                        "Unsupported bitstream profile");
@@ -2840,16 +2828,10 @@
 #endif
       for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
         RefBuffer *const ref_buf = &cm->frame_refs[i];
-#if CONFIG_HIGHBITDEPTH
         av1_setup_scale_factors_for_frame(
             &ref_buf->sf, ref_buf->buf->y_crop_width,
             ref_buf->buf->y_crop_height, cm->width, cm->height,
             cm->use_highbitdepth);
-#else
-        av1_setup_scale_factors_for_frame(
-            &ref_buf->sf, ref_buf->buf->y_crop_width,
-            ref_buf->buf->y_crop_height, cm->width, cm->height);
-#endif
       }
     }
   }
@@ -3305,16 +3287,10 @@
   YV12_BUFFER_CONFIG *new_fb = get_frame_new_buffer(cm);
   xd->cur_buf = new_fb;
 #if CONFIG_INTRABC
-#if CONFIG_HIGHBITDEPTH
   av1_setup_scale_factors_for_frame(
       &xd->sf_identity, xd->cur_buf->y_crop_width, xd->cur_buf->y_crop_height,
       xd->cur_buf->y_crop_width, xd->cur_buf->y_crop_height,
       cm->use_highbitdepth);
-#else
-  av1_setup_scale_factors_for_frame(
-      &xd->sf_identity, xd->cur_buf->y_crop_width, xd->cur_buf->y_crop_height,
-      xd->cur_buf->y_crop_width, xd->cur_buf->y_crop_height);
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // CONFIG_INTRABC
 
   if (cm->show_existing_frame) {
@@ -3492,11 +3468,7 @@
 #if CONFIG_MONO_VIDEO
   // If the bit stream is monochrome, set the U and V buffers to a constant.
   if (av1_num_planes(cm) < 3) {
-#if CONFIG_HIGHBITDEPTH
     const int bytes_per_sample = cm->use_highbitdepth ? 2 : 1;
-#else
-    const int bytes_per_sample = 1;
-#endif
 
     YV12_BUFFER_CONFIG *cur_buf = (YV12_BUFFER_CONFIG *)xd->cur_buf;
 
diff --git a/av1/decoder/detokenize.c b/av1/decoder/detokenize.c
index d4334ab..ced8064 100644
--- a/av1/decoder/detokenize.c
+++ b/av1/decoder/detokenize.c
@@ -42,10 +42,6 @@
 
 static int token_to_value(FRAME_COUNTS *counts, aom_reader *const r, int token,
                           TX_SIZE tx_size, int bit_depth) {
-#if !CONFIG_HIGHBITDEPTH
-  assert(bit_depth == 8);
-#endif  // !CONFIG_HIGHBITDEPTH
-
   switch (token) {
     case ZERO_TOKEN:
     case ONE_TOKEN:
diff --git a/av1/decoder/dthread.c b/av1/decoder/dthread.c
index 531ea25..231a813 100644
--- a/av1/decoder/dthread.c
+++ b/av1/decoder/dthread.c
@@ -157,9 +157,7 @@
   av1_frameworker_unlock_stats(src_worker);
 
   dst_cm->bit_depth = src_cm->bit_depth;
-#if CONFIG_HIGHBITDEPTH
   dst_cm->use_highbitdepth = src_cm->use_highbitdepth;
-#endif
   // TODO(zoeliu): To handle parallel decoding
   dst_cm->prev_frame =
       src_cm->show_existing_frame ? src_cm->prev_frame : src_cm->cur_frame;
diff --git a/av1/encoder/aq_variance.c b/av1/encoder/aq_variance.c
index da713df..384e95c 100644
--- a/av1/encoder/aq_variance.c
+++ b/av1/encoder/aq_variance.c
@@ -34,10 +34,8 @@
 #define SEGMENT_ID(i) segment_id[(i)-ENERGY_MIN]
 
 DECLARE_ALIGNED(16, static const uint8_t, av1_all_zeros[MAX_SB_SIZE]) = { 0 };
-#if CONFIG_HIGHBITDEPTH
 DECLARE_ALIGNED(16, static const uint16_t,
                 av1_highbd_all_zeros[MAX_SB_SIZE]) = { 0 };
-#endif
 
 unsigned int av1_vaq_segment_id(int energy) {
   ENERGY_IN_BOUNDS(energy);
@@ -106,7 +104,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void aq_highbd_variance64(const uint8_t *a8, int a_stride,
                                  const uint8_t *b8, int b_stride, int w, int h,
                                  uint64_t *sse, uint64_t *sum) {
@@ -137,7 +134,6 @@
   *sse = (unsigned int)sse_long;
   *sum = (int)sum_long;
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 static unsigned int block_variance(const AV1_COMP *const cpi, MACROBLOCK *x,
                                    BLOCK_SIZE bs) {
@@ -152,7 +148,6 @@
     const int bw = MI_SIZE * mi_size_wide[bs] - right_overflow;
     const int bh = MI_SIZE * mi_size_high[bs] - bottom_overflow;
     int avg;
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
       aq_highbd_8_variance(x->plane[0].src.buf, x->plane[0].src.stride,
                            CONVERT_TO_BYTEPTR(av1_highbd_all_zeros), 0, bw, bh,
@@ -163,14 +158,9 @@
       aq_variance(x->plane[0].src.buf, x->plane[0].src.stride, av1_all_zeros, 0,
                   bw, bh, &sse, &avg);
     }
-#else
-    aq_variance(x->plane[0].src.buf, x->plane[0].src.stride, av1_all_zeros, 0,
-                bw, bh, &sse, &avg);
-#endif  // CONFIG_HIGHBITDEPTH
     var = sse - (unsigned int)(((int64_t)avg * avg) / (bw * bh));
     return (unsigned int)((uint64_t)var * 256) / (bw * bh);
   } else {
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
       var =
           cpi->fn_ptr[bs].vf(x->plane[0].src.buf, x->plane[0].src.stride,
@@ -179,10 +169,6 @@
       var = cpi->fn_ptr[bs].vf(x->plane[0].src.buf, x->plane[0].src.stride,
                                av1_all_zeros, 0, &sse);
     }
-#else
-    var = cpi->fn_ptr[bs].vf(x->plane[0].src.buf, x->plane[0].src.stride,
-                             av1_all_zeros, 0, &sse);
-#endif  // CONFIG_HIGHBITDEPTH
     return (unsigned int)((uint64_t)var * 256) >> num_pels_log2_lookup[bs];
   }
 }
diff --git a/av1/encoder/av1_quantize.c b/av1/encoder/av1_quantize.c
index d0ec6ec..6b365bb 100644
--- a/av1/encoder/av1_quantize.c
+++ b/av1/encoder/av1_quantize.c
@@ -1508,7 +1508,6 @@
 
 static int get_qzbin_factor(int q, aom_bit_depth_t bit_depth) {
   const int quant = av1_dc_quant_Q3(q, 0, bit_depth);
-#if CONFIG_HIGHBITDEPTH
   switch (bit_depth) {
     case AOM_BITS_8: return q == 0 ? 64 : (quant < 148 ? 84 : 80);
     case AOM_BITS_10: return q == 0 ? 64 : (quant < 592 ? 84 : 80);
@@ -1517,10 +1516,6 @@
       assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
       return -1;
   }
-#else
-  (void)bit_depth;
-  return q == 0 ? 64 : (quant < 148 ? 84 : 80);
-#endif
 }
 
 void av1_build_quantizer(aom_bit_depth_t bit_depth, int y_dc_delta_q,
diff --git a/av1/encoder/bgsprite.c b/av1/encoder/bgsprite.c
index ed314e1..0a79f33 100644
--- a/av1/encoder/bgsprite.c
+++ b/av1/encoder/bgsprite.c
@@ -58,15 +58,9 @@
 #define BGSPRITE_MASK_BLOCK_SIZE 4
 
 typedef struct {
-#if CONFIG_HIGHBITDEPTH
   uint16_t y;
   uint16_t u;
   uint16_t v;
-#else
-  uint8_t y;
-  uint8_t u;
-  uint8_t v;
-#endif  // CONFIG_HIGHBITDEPTH
   uint8_t exists;
 } YuvPixel;
 
@@ -78,15 +72,9 @@
   double u_mean[2];
   double v_mean[2];
 
-#if CONFIG_HIGHBITDEPTH
   uint16_t y;
   uint16_t u;
   uint16_t v;
-#else
-  uint8_t y;
-  uint8_t u;
-  uint8_t v;
-#endif  // CONFIG_HIGHBITDEPTH
   double final_var;
 } YuvPixelGaussian;
 
@@ -258,11 +246,9 @@
     invert_params(params[i], transform_params);
     params_to_matrix(transform_params, transform_matrix);
 
-#if CONFIG_HIGHBITDEPTH
     const uint16_t *y_buffer16 = CONVERT_TO_SHORTPTR(frames[i]->y_buffer);
     const uint16_t *u_buffer16 = CONVERT_TO_SHORTPTR(frames[i]->u_buffer);
     const uint16_t *v_buffer16 = CONVERT_TO_SHORTPTR(frames[i]->v_buffer);
-#endif  // CONFIG_HIGHBITDEPTH
 
     for (int y = 0; y < transformed_height; ++y) {
       for (int x = 0; x < transformed_width; ++x) {
@@ -306,7 +292,6 @@
                 int uvchannel_idx = (interp_y >> frames[i]->subsampling_y) *
                                         frames[i]->uv_stride +
                                     (interp_x >> frames[i]->subsampling_x);
-#if CONFIG_HIGHBITDEPTH
                 if (frames[i]->flags & YV12_FLAG_HIGHBITDEPTH) {
                   interpolated_yvalue += (1 - fabs(u - x_decimal)) *
                                          (1 - fabs(v - y_decimal)) *
@@ -318,7 +303,6 @@
                                          (1 - fabs(v - y_decimal)) *
                                          v_buffer16[uvchannel_idx];
                 } else {
-#endif  // CONFIG_HIGHBITDEPTH
                   interpolated_yvalue += (1 - fabs(u - x_decimal)) *
                                          (1 - fabs(v - y_decimal)) *
                                          frames[i]->y_buffer[ychannel_idx];
@@ -328,9 +312,7 @@
                   interpolated_vvalue += (1 - fabs(u - x_decimal)) *
                                          (1 - fabs(v - y_decimal)) *
                                          frames[i]->v_buffer[uvchannel_idx];
-#if CONFIG_HIGHBITDEPTH
                 }
-#endif  // CONFIG_HIGHBITDEPTH
               }
             }
           }
@@ -346,21 +328,17 @@
           int pano_x = x + x_min[i] + x_offset;
           int pano_y = y + y_min[i] + y_offset;
 
-#if CONFIG_HIGHBITDEPTH
           if (frames[i]->flags & YV12_FLAG_HIGHBITDEPTH) {
             img_stack[pano_y][pano_x][i].y = (uint16_t)interpolated_yvalue;
             img_stack[pano_y][pano_x][i].u = (uint16_t)interpolated_uvalue;
             img_stack[pano_y][pano_x][i].v = (uint16_t)interpolated_vvalue;
             img_stack[pano_y][pano_x][i].exists = 1;
           } else {
-#endif  // CONFIG_HIGHBITDEPTH
             img_stack[pano_y][pano_x][i].y = (uint8_t)interpolated_yvalue;
             img_stack[pano_y][pano_x][i].u = (uint8_t)interpolated_uvalue;
             img_stack[pano_y][pano_x][i].v = (uint8_t)interpolated_vvalue;
             img_stack[pano_y][pano_x][i].exists = 1;
-#if CONFIG_HIGHBITDEPTH
           }
-#endif  // CONFIG_HIGHBITDEPTH
         } else if (image_x >= 0 && image_x < frame_width && image_y >= 0 &&
                    image_y < frame_height) {
           // Place in panorama stack.
@@ -371,21 +349,17 @@
           int uvchannel_idx =
               (image_y >> frames[i]->subsampling_y) * frames[i]->uv_stride +
               (image_x >> frames[i]->subsampling_x);
-#if CONFIG_HIGHBITDEPTH
           if (frames[i]->flags & YV12_FLAG_HIGHBITDEPTH) {
             img_stack[pano_y][pano_x][i].y = y_buffer16[ychannel_idx];
             img_stack[pano_y][pano_x][i].u = u_buffer16[uvchannel_idx];
             img_stack[pano_y][pano_x][i].v = v_buffer16[uvchannel_idx];
             img_stack[pano_y][pano_x][i].exists = 1;
           } else {
-#endif  // CONFIG_HIGHBITDEPTH
             img_stack[pano_y][pano_x][i].y = frames[i]->y_buffer[ychannel_idx];
             img_stack[pano_y][pano_x][i].u = frames[i]->u_buffer[uvchannel_idx];
             img_stack[pano_y][pano_x][i].v = frames[i]->v_buffer[uvchannel_idx];
             img_stack[pano_y][pano_x][i].exists = 1;
-#if CONFIG_HIGHBITDEPTH
           }
-#endif  // CONFIG_HIGHBITDEPTH
         }
       }
     }
@@ -528,20 +502,16 @@
 
       if (count != 0) {
         blended_img[y][x].exists = 1;
-#if CONFIG_HIGHBITDEPTH
         if (highbitdepth) {
           blended_img[y][x].y = (uint16_t)OD_DIVU(y_sum, count);
           blended_img[y][x].u = (uint16_t)OD_DIVU(u_sum, count);
           blended_img[y][x].v = (uint16_t)OD_DIVU(v_sum, count);
         } else {
-#endif  // CONFIG_HIGHBITDEPTH
           (void)highbitdepth;
           blended_img[y][x].y = (uint8_t)OD_DIVU(y_sum, count);
           blended_img[y][x].u = (uint8_t)OD_DIVU(u_sum, count);
           blended_img[y][x].v = (uint8_t)OD_DIVU(v_sum, count);
-#if CONFIG_HIGHBITDEPTH
         }
-#endif  // CONFIG_HIGHBITDEPTH
       } else {
         blended_img[y][x].exists = 0;
       }
@@ -759,7 +729,6 @@
   const int y_offset = -pano_y_min;
   const int crop_x_offset = x_min[center_idx] + x_offset;
   const int crop_y_offset = y_min[center_idx] + y_offset;
-#if CONFIG_HIGHBITDEPTH
   if (panorama->flags & YV12_FLAG_HIGHBITDEPTH) {
     // Use median Y value.
     uint16_t *pano_y_buffer16 = CONVERT_TO_SHORTPTR(panorama->y_buffer);
@@ -810,7 +779,6 @@
       }
     }
   } else {
-#endif  // CONFIG_HIGHBITDEPTH
     // Use blended Y value.
     for (int y = 0; y < panorama->y_height; ++y) {
       for (int x = 0; x < panorama->y_width; ++x) {
@@ -858,9 +826,7 @@
         }
       }
     }
-#if CONFIG_HIGHBITDEPTH
   }
-#endif  // CONFIG_HIGHBITDEPTH
 }
 
 #if BGSPRITE_ENABLE_SEGMENTATION
@@ -917,8 +883,7 @@
                 (x >> temporal_arf->subsampling_x);
 
             if (count > amount) {
-// Foreground; use temporal arf.
-#if CONFIG_HIGHBITDEPTH
+              // Foreground; use temporal arf.
               if (temporal_arf->flags & YV12_FLAG_HIGHBITDEPTH) {
                 uint16_t *pano_y_buffer16 =
                     CONVERT_TO_SHORTPTR(temporal_arf->y_buffer);
@@ -930,16 +895,12 @@
                 blended_img[y][x].u = pano_u_buffer16[uvchannel_idx];
                 blended_img[y][x].v = pano_v_buffer16[uvchannel_idx];
               } else {
-#endif  // CONFIG_HIGHBITDEPTH
                 blended_img[y][x].y = temporal_arf->y_buffer[ychannel_idx];
                 blended_img[y][x].u = temporal_arf->u_buffer[uvchannel_idx];
                 blended_img[y][x].v = temporal_arf->v_buffer[uvchannel_idx];
-#if CONFIG_HIGHBITDEPTH
               }
-#endif  // CONFIG_HIGHBITDEPTH
             } else {
-// Background; use bgsprite arf.
-#if CONFIG_HIGHBITDEPTH
+              // Background; use bgsprite arf.
               if (bgsprite->flags & YV12_FLAG_HIGHBITDEPTH) {
                 uint16_t *pano_y_buffer16 =
                     CONVERT_TO_SHORTPTR(bgsprite->y_buffer);
@@ -951,13 +912,10 @@
                 blended_img[y][x].u = pano_u_buffer16[uvchannel_idx];
                 blended_img[y][x].v = pano_v_buffer16[uvchannel_idx];
               } else {
-#endif  // CONFIG_HIGHBITDEPTH
                 blended_img[y][x].y = bgsprite->y_buffer[ychannel_idx];
                 blended_img[y][x].u = bgsprite->u_buffer[uvchannel_idx];
                 blended_img[y][x].v = bgsprite->v_buffer[uvchannel_idx];
-#if CONFIG_HIGHBITDEPTH
               }
-#endif  // CONFIG_HIGHBITDEPTH
             }
           }
         }
@@ -1024,9 +982,7 @@
   memset(&bgsprite, 0, sizeof(bgsprite));
   aom_alloc_frame_buffer(&bgsprite, frames[0]->y_width, frames[0]->y_height,
                          frames[0]->subsampling_x, frames[0]->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
                          frames[0]->flags & YV12_FLAG_HIGHBITDEPTH,
-#endif
                          frames[0]->border, 0);
   aom_yv12_copy_frame(frames[0], &bgsprite);
   bgsprite.bit_depth = frames[0]->bit_depth;
@@ -1036,13 +992,10 @@
 #if BGSPRITE_ENABLE_SEGMENTATION
   YV12_BUFFER_CONFIG temporal_bgsprite;
   memset(&temporal_bgsprite, 0, sizeof(temporal_bgsprite));
-  aom_alloc_frame_buffer(&temporal_bgsprite, frames[0]->y_width,
-                         frames[0]->y_height, frames[0]->subsampling_x,
-                         frames[0]->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-                         frames[0]->flags & YV12_FLAG_HIGHBITDEPTH,
-#endif
-                         frames[0]->border, 0);
+  aom_alloc_frame_buffer(
+      &temporal_bgsprite, frames[0]->y_width, frames[0]->y_height,
+      frames[0]->subsampling_x, frames[0]->subsampling_y,
+      frames[0]->flags & YV12_FLAG_HIGHBITDEPTH, frames[0]->border, 0);
   aom_yv12_copy_frame(frames[0], &temporal_bgsprite);
   temporal_bgsprite.bit_depth = frames[0]->bit_depth;
 
@@ -1078,9 +1031,7 @@
   memset(&temporal_arf, 0, sizeof(temporal_arf));
   aom_alloc_frame_buffer(&temporal_arf, frames[0]->y_width, frames[0]->y_height,
                          frames[0]->subsampling_x, frames[0]->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
                          frames[0]->flags & YV12_FLAG_HIGHBITDEPTH,
-#endif
                          frames[0]->border, 0);
   aom_yv12_copy_frame(frames[0], &temporal_arf);
   temporal_arf.bit_depth = frames[0]->bit_depth;
@@ -1171,10 +1122,7 @@
   int inliers_by_motion[RANSAC_NUM_MOTIONS];
   for (int frame = 0; frame < frames_to_stitch - 1; ++frame) {
     const int global_motion_ret = compute_global_motion_feature_based(
-        model, frames[frame + 1], frames[frame],
-#if CONFIG_HIGHBITDEPTH
-        cpi->common.bit_depth,
-#endif  // CONFIG_HIGHBITDEPTH
+        model, frames[frame + 1], frames[frame], cpi->common.bit_depth,
         inliers_by_motion, params[frame + 1], RANSAC_NUM_MOTIONS);
 
     // Quit if global motion had an error.
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 95e1726..0f23b64 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -85,7 +85,6 @@
 #endif  // CONFIG_EXT_PARTITION
 };
 
-#if CONFIG_HIGHBITDEPTH
 static const uint16_t AV1_HIGH_VAR_OFFS_8[MAX_SB_SIZE] = {
   128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
   128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
@@ -146,7 +145,6 @@
   128 * 16
 #endif  // CONFIG_EXT_PARTITION
 };
-#endif  // CONFIG_HIGHBITDEPTH
 
 #if CONFIG_FP_MB_STATS
 static const uint8_t num_16x16_blocks_wide_lookup[BLOCK_SIZES_ALL] = {
@@ -184,7 +182,6 @@
   return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]);
 }
 
-#if CONFIG_HIGHBITDEPTH
 unsigned int av1_high_get_sby_perpixel_variance(const AV1_COMP *cpi,
                                                 const struct buf_2d *ref,
                                                 BLOCK_SIZE bs, int bd) {
@@ -209,7 +206,6 @@
   }
   return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 static unsigned int get_sby_perpixel_diff_variance(const AV1_COMP *const cpi,
                                                    const struct buf_2d *ref,
@@ -666,7 +662,6 @@
       !is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x,
                            xd->plane[1].subsampling_y);
 
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     x->source_variance = av1_high_get_sby_perpixel_variance(
         cpi, &x->plane[0].src, bsize, xd->bd);
@@ -674,10 +669,6 @@
     x->source_variance =
         av1_get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize);
   }
-#else
-  x->source_variance =
-      av1_get_sby_perpixel_variance(cpi, &x->plane[0].src, bsize);
-#endif  // CONFIG_HIGHBITDEPTH
 
   // Save rdmult before it might be changed, so it can be restored later.
   orig_rdmult = x->rdmult;
@@ -3338,10 +3329,7 @@
 
 // Estimate if the source frame is screen content, based on the portion of
 // blocks that have no more than 4 (experimentally selected) luma colors.
-static int is_screen_content(const uint8_t *src,
-#if CONFIG_HIGHBITDEPTH
-                             int use_hbd, int bd,
-#endif  // CONFIG_HIGHBITDEPTH
+static int is_screen_content(const uint8_t *src, int use_hbd, int bd,
                              int stride, int width, int height) {
   assert(src != NULL);
   int counts = 0;
@@ -3352,13 +3340,10 @@
     for (int c = 0; c + blk_w <= width; c += blk_w) {
       int count_buf[1 << 12];  // Maximum (1 << 12) color levels.
       const int n_colors =
-#if CONFIG_HIGHBITDEPTH
           use_hbd ? av1_count_colors_highbd(src + r * stride + c, stride, blk_w,
                                             blk_h, bd, count_buf)
-                  :
-#endif  // CONFIG_HIGHBITDEPTH
-                  av1_count_colors(src + r * stride + c, stride, blk_w, blk_h,
-                                   count_buf);
+                  : av1_count_colors(src + r * stride + c, stride, blk_w, blk_h,
+                                     count_buf);
       if (n_colors > 1 && n_colors <= limit) counts++;
     }
   }
@@ -3541,9 +3526,7 @@
     cm->allow_screen_content_tools =
         cpi->oxcf.content == AOM_CONTENT_SCREEN ||
         is_screen_content(cpi->source->y_buffer,
-#if CONFIG_HIGHBITDEPTH
                           cpi->source->flags & YV12_FLAG_HIGHBITDEPTH, xd->bd,
-#endif  // CONFIG_HIGHBITDEPTH
                           cpi->source->y_stride, cpi->source->y_width,
                           cpi->source->y_height);
   }
@@ -3663,13 +3646,11 @@
                  ref_buf[frame]->y_crop_height == cpi->source->y_crop_height &&
                  do_gm_search_logic(&cpi->sf, num_refs_using_gm, frame)) {
         TransformationType model;
-        const int64_t ref_frame_error = av1_frame_error(
-#if CONFIG_HIGHBITDEPTH
-            xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH, xd->bd,
-#endif  // CONFIG_HIGHBITDEPTH
-            ref_buf[frame]->y_buffer, ref_buf[frame]->y_stride,
-            cpi->source->y_buffer, cpi->source->y_width, cpi->source->y_height,
-            cpi->source->y_stride);
+        const int64_t ref_frame_error =
+            av1_frame_error(xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH, xd->bd,
+                            ref_buf[frame]->y_buffer, ref_buf[frame]->y_stride,
+                            cpi->source->y_buffer, cpi->source->y_width,
+                            cpi->source->y_height, cpi->source->y_stride);
 
         if (ref_frame_error == 0) continue;
 
@@ -3683,10 +3664,7 @@
           }
 
           compute_global_motion_feature_based(
-              model, cpi->source, ref_buf[frame],
-#if CONFIG_HIGHBITDEPTH
-              cpi->common.bit_depth,
-#endif  // CONFIG_HIGHBITDEPTH
+              model, cpi->source, ref_buf[frame], cpi->common.bit_depth,
               inliers_by_motion, params_by_motion, RANSAC_NUM_MOTIONS);
 
           for (i = 0; i < RANSAC_NUM_MOTIONS; ++i) {
@@ -3698,9 +3676,7 @@
             if (tmp_wm_params.wmtype != IDENTITY) {
               const int64_t warp_error = refine_integerized_param(
                   &tmp_wm_params, tmp_wm_params.wmtype,
-#if CONFIG_HIGHBITDEPTH
                   xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH, xd->bd,
-#endif  // CONFIG_HIGHBITDEPTH
                   ref_buf[frame]->y_buffer, ref_buf[frame]->y_width,
                   ref_buf[frame]->y_height, ref_buf[frame]->y_stride,
                   cpi->source->y_buffer, cpi->source->y_width,
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index 4ae5efd..6eb4a39 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -50,31 +50,23 @@
                            int16_t *diff, ptrdiff_t diff_stride,
                            const uint8_t *src8, ptrdiff_t src_stride,
                            const uint8_t *pred8, ptrdiff_t pred_stride) {
-#if !CONFIG_HIGHBITDEPTH
-  (void)xd;
-#endif
-
   if (check_subtract_block_size(rows, cols)) {
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
       aom_highbd_subtract_block_c(rows, cols, diff, diff_stride, src8,
                                   src_stride, pred8, pred_stride, xd->bd);
       return;
     }
-#endif  // CONFIG_HIGHBITDEPTH
     aom_subtract_block_c(rows, cols, diff, diff_stride, src8, src_stride, pred8,
                          pred_stride);
 
     return;
   }
 
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     aom_highbd_subtract_block(rows, cols, diff, diff_stride, src8, src_stride,
                               pred8, pred_stride, xd->bd);
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
   aom_subtract_block(rows, cols, diff, diff_stride, src8, src_stride, pred8,
                      pred_stride);
 }
@@ -737,12 +729,10 @@
 #if CONFIG_DAALA_TX
     daala_inv_txfm_add(dqcoeff, dst, pd->dst.stride, &txfm_param);
 #else
-#if CONFIG_HIGHBITDEPTH
     if (txfm_param.is_hbd) {
       av1_highbd_inv_txfm_add_4x4(dqcoeff, dst, pd->dst.stride, &txfm_param);
       return;
     }
-#endif  //  CONFIG_HIGHBITDEPTH
     if (xd->lossless[xd->mi[0]->mbmi.segment_id]) {
       av1_iwht4x4_add(dqcoeff, dst, pd->dst.stride, &txfm_param);
     } else {
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index d7dde87..abca583 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -740,12 +740,9 @@
   const AV1EncoderConfig *oxcf = &cpi->oxcf;
 
   if (!cpi->lookahead)
-    cpi->lookahead = av1_lookahead_init(oxcf->width, oxcf->height,
-                                        cm->subsampling_x, cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-                                        cm->use_highbitdepth,
-#endif
-                                        oxcf->lag_in_frames);
+    cpi->lookahead = av1_lookahead_init(
+        oxcf->width, oxcf->height, cm->subsampling_x, cm->subsampling_y,
+        cm->use_highbitdepth, oxcf->lag_in_frames);
   if (!cpi->lookahead)
     aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
                        "Failed to allocate lag buffers");
@@ -753,11 +750,8 @@
   // TODO(agrange) Check if ARF is enabled and skip allocation if not.
   if (aom_realloc_frame_buffer(&cpi->alt_ref_buffer, oxcf->width, oxcf->height,
                                cm->subsampling_x, cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-                               cm->use_highbitdepth,
-#endif
-                               AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
-                               NULL, NULL))
+                               cm->use_highbitdepth, AOM_BORDER_IN_PIXELS,
+                               cm->byte_alignment, NULL, NULL, NULL))
     aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
                        "Failed to allocate altref buffer");
 }
@@ -766,11 +760,8 @@
   AV1_COMMON *const cm = &cpi->common;
   if (aom_realloc_frame_buffer(&cpi->last_frame_uf, cm->width, cm->height,
                                cm->subsampling_x, cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-                               cm->use_highbitdepth,
-#endif
-                               AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
-                               NULL, NULL))
+                               cm->use_highbitdepth, AOM_BORDER_IN_PIXELS,
+                               cm->byte_alignment, NULL, NULL, NULL))
     aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
                        "Failed to allocate last frame buffer");
 
@@ -782,10 +773,7 @@
 #else
           cm->width, cm->height,
 #endif  // CONFIG_HORZONLY_FRAME_SUPERRES
-          cm->subsampling_x, cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-          cm->use_highbitdepth,
-#endif
+          cm->subsampling_x, cm->subsampling_y, cm->use_highbitdepth,
           AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL, NULL, NULL))
     aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
                        "Failed to allocate trial restored frame buffer");
@@ -793,21 +781,15 @@
 
   if (aom_realloc_frame_buffer(&cpi->scaled_source, cm->width, cm->height,
                                cm->subsampling_x, cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-                               cm->use_highbitdepth,
-#endif
-                               AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
-                               NULL, NULL))
+                               cm->use_highbitdepth, AOM_BORDER_IN_PIXELS,
+                               cm->byte_alignment, NULL, NULL, NULL))
     aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
                        "Failed to allocate scaled source buffer");
 
   if (aom_realloc_frame_buffer(&cpi->scaled_last_source, cm->width, cm->height,
                                cm->subsampling_x, cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-                               cm->use_highbitdepth,
-#endif
-                               AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
-                               NULL, NULL))
+                               cm->use_highbitdepth, AOM_BORDER_IN_PIXELS,
+                               cm->byte_alignment, NULL, NULL, NULL))
     aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
                        "Failed to allocate scaled last source buffer");
 }
@@ -1064,9 +1046,7 @@
 
   cm->profile = oxcf->profile;
   cm->bit_depth = oxcf->bit_depth;
-#if CONFIG_HIGHBITDEPTH
   cm->use_highbitdepth = oxcf->use_highbitdepth;
-#endif
   cm->color_space = oxcf->color_space;
 #if CONFIG_COLORSPACE_HEADERS
   cm->transfer_function = oxcf->transfer_function;
@@ -1109,7 +1089,6 @@
       (maximum == 0) ? bandwidth / 8 : maximum * bandwidth / 1000;
 }
 
-#if CONFIG_HIGHBITDEPTH
 #if CONFIG_JNT_COMP
 #define HIGHBD_BFP(BT, SDF, SDAF, VF, SVF, SVAF, SDX3F, SDX8F, SDX4DF, JSDAF, \
                    JSVAF)                                                     \
@@ -3056,7 +3035,6 @@
     }
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 static void realloc_segmentation_maps(AV1_COMP *cpi) {
   AV1_COMMON *const cm = &cpi->common;
@@ -3201,9 +3179,7 @@
   cpi->ext_refresh_frame_flags_pending = 0;
   cpi->ext_refresh_frame_context_pending = 0;
 
-#if CONFIG_HIGHBITDEPTH
   highbd_set_var_fns(cpi);
-#endif
 #if CONFIG_AMVR
   cm->seq_force_integer_mv = 2;
 #endif
@@ -3392,11 +3368,7 @@
   }
 #endif
 
-#if CONFIG_HIGHBITDEPTH
   int buf_scaler = 2;
-#else
-  int buf_scaler = 1;
-#endif
   CHECK_MEM_ERROR(
       cm, cpi->td.mb.above_pred_buf,
       (uint8_t *)aom_memalign(16,
@@ -3783,9 +3755,7 @@
 #endif  // CONFIG_EXT_PARTITION
 #endif  // CONFIG_EXT_PARTITION_TYPES
 
-#if CONFIG_HIGHBITDEPTH
   highbd_set_var_fns(cpi);
-#endif
 
   /* av1_init_quantizer() is first called here. Add check in
    * av1_frame_init_quantizer() so that av1_init_quantizer is only
@@ -3989,12 +3959,8 @@
   struct aom_codec_cx_pkt pkt;
   int i;
   PSNR_STATS psnr;
-#if CONFIG_HIGHBITDEPTH
   aom_calc_highbd_psnr(cpi->source, cpi->common.frame_to_show, &psnr,
                        cpi->td.mb.e_mbd.bd, cpi->oxcf.input_bit_depth);
-#else
-  aom_calc_psnr(cpi->source, cpi->common.frame_to_show, &psnr);
-#endif
 
   for (i = 0; i < 4; ++i) {
     pkt.data.psnr.samples[i] = psnr.samples[i];
@@ -4165,7 +4131,6 @@
   uint8_t *src = s->y_buffer;
   int h = cm->height;
   if (yuv_rec_file == NULL) return;
-#if CONFIG_HIGHBITDEPTH
   if (s->flags & YV12_FLAG_HIGHBITDEPTH) {
     uint16_t *src16 = CONVERT_TO_SHORTPTR(s->y_buffer);
 
@@ -4193,7 +4158,6 @@
     fflush(yuv_rec_file);
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
 
   do {
     fwrite(src, s->y_width, 1, yuv_rec_file);
@@ -4633,7 +4597,6 @@
         new_fb_ptr = &pool->frame_bufs[new_fb];
         if (force_scaling || new_fb_ptr->buf.y_crop_width != cm->width ||
             new_fb_ptr->buf.y_crop_height != cm->height) {
-#if CONFIG_HIGHBITDEPTH
           if (aom_realloc_frame_buffer(
                   &new_fb_ptr->buf, cm->width, cm->height, cm->subsampling_x,
                   cm->subsampling_y, cm->use_highbitdepth, AOM_BORDER_IN_PIXELS,
@@ -4642,15 +4605,6 @@
                                "Failed to allocate frame buffer");
           av1_resize_and_extend_frame(ref, &new_fb_ptr->buf,
                                       (int)cm->bit_depth);
-#else
-          if (aom_realloc_frame_buffer(&new_fb_ptr->buf, cm->width, cm->height,
-                                       cm->subsampling_x, cm->subsampling_y,
-                                       AOM_BORDER_IN_PIXELS, cm->byte_alignment,
-                                       NULL, NULL, NULL))
-            aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
-                               "Failed to allocate frame buffer");
-          av1_resize_and_extend_frame(ref, &new_fb_ptr->buf);
-#endif
           cpi->scaled_ref_idx[ref_frame - 1] = new_fb;
           alloc_frame_mvs(cm, new_fb);
 #if CONFIG_SEGMENT_PRED_LAST
@@ -4905,24 +4859,16 @@
 #endif
 }
 
-static void check_initial_width(AV1_COMP *cpi,
-#if CONFIG_HIGHBITDEPTH
-                                int use_highbitdepth,
-#endif
+static void check_initial_width(AV1_COMP *cpi, int use_highbitdepth,
                                 int subsampling_x, int subsampling_y) {
   AV1_COMMON *const cm = &cpi->common;
 
-  if (!cpi->initial_width ||
-#if CONFIG_HIGHBITDEPTH
-      cm->use_highbitdepth != use_highbitdepth ||
-#endif
+  if (!cpi->initial_width || cm->use_highbitdepth != use_highbitdepth ||
       cm->subsampling_x != subsampling_x ||
       cm->subsampling_y != subsampling_y) {
     cm->subsampling_x = subsampling_x;
     cm->subsampling_y = subsampling_y;
-#if CONFIG_HIGHBITDEPTH
     cm->use_highbitdepth = use_highbitdepth;
-#endif
 
     alloc_raw_frame_buffers(cpi);
     init_ref_frame_bufs(cm);
@@ -4939,12 +4885,8 @@
 // Returns 1 if the assigned width or height was <= 0.
 static int set_size_literal(AV1_COMP *cpi, int width, int height) {
   AV1_COMMON *cm = &cpi->common;
-#if CONFIG_HIGHBITDEPTH
   check_initial_width(cpi, cm->use_highbitdepth, cm->subsampling_x,
                       cm->subsampling_y);
-#else
-  check_initial_width(cpi, cm->subsampling_x, cm->subsampling_y);
-#endif  // CONFIG_HIGHBITDEPTH
 
   if (width <= 0 || height <= 0) return 1;
 
@@ -4989,11 +4931,8 @@
   // Reset the frame pointers to the current frame size.
   if (aom_realloc_frame_buffer(get_frame_new_buffer(cm), cm->width, cm->height,
                                cm->subsampling_x, cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-                               cm->use_highbitdepth,
-#endif
-                               AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL,
-                               NULL, NULL))
+                               cm->use_highbitdepth, AOM_BORDER_IN_PIXELS,
+                               cm->byte_alignment, NULL, NULL, NULL))
     aom_internal_error(&cm->error, AOM_CODEC_MEM_ERROR,
                        "Failed to allocate frame buffer");
 
@@ -5024,15 +4963,9 @@
     if (buf_idx != INVALID_IDX) {
       YV12_BUFFER_CONFIG *const buf = &cm->buffer_pool->frame_bufs[buf_idx].buf;
       ref_buf->buf = buf;
-#if CONFIG_HIGHBITDEPTH
       av1_setup_scale_factors_for_frame(
           &ref_buf->sf, buf->y_crop_width, buf->y_crop_height, cm->width,
           cm->height, (buf->flags & YV12_FLAG_HIGHBITDEPTH) ? 1 : 0);
-#else
-      av1_setup_scale_factors_for_frame(&ref_buf->sf, buf->y_crop_width,
-                                        buf->y_crop_height, cm->width,
-                                        cm->height);
-#endif  // CONFIG_HIGHBITDEPTH
       if (av1_is_scaled(&ref_buf->sf)) aom_extend_frame_borders(buf);
     } else {
       ref_buf->buf = NULL;
@@ -5040,14 +4973,9 @@
   }
 
 #if CONFIG_INTRABC
-#if CONFIG_HIGHBITDEPTH
   av1_setup_scale_factors_for_frame(&xd->sf_identity, cm->width, cm->height,
                                     cm->width, cm->height,
                                     cm->use_highbitdepth);
-#else
-  av1_setup_scale_factors_for_frame(&xd->sf_identity, cm->width, cm->height,
-                                    cm->width, cm->height);
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // CONFIG_INTRABC
 
   set_ref_ptrs(cm, xd, LAST_FRAME, LAST_FRAME);
@@ -5253,21 +5181,15 @@
     if (aom_realloc_frame_buffer(
             &cpi->scaled_source, cm->superres_upscaled_width,
             cm->superres_upscaled_height, cm->subsampling_x, cm->subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-            cm->use_highbitdepth,
-#endif  // CONFIG_HIGHBITDEPTH
-            AOM_BORDER_IN_PIXELS, cm->byte_alignment, NULL, NULL, NULL))
+            cm->use_highbitdepth, AOM_BORDER_IN_PIXELS, cm->byte_alignment,
+            NULL, NULL, NULL))
       aom_internal_error(
           &cm->error, AOM_CODEC_MEM_ERROR,
           "Failed to reallocate scaled source buffer for superres");
     assert(cpi->scaled_source.y_crop_width == cm->superres_upscaled_width);
     assert(cpi->scaled_source.y_crop_height == cm->superres_upscaled_height);
-#if CONFIG_HIGHBITDEPTH
     av1_resize_and_extend_frame(cpi->unscaled_source, &cpi->scaled_source,
                                 (int)cm->bit_depth);
-#else
-    av1_resize_and_extend_frame(cpi->unscaled_source, &cpi->scaled_source);
-#endif  // CONFIG_HIGHBITDEPTH
     cpi->source = &cpi->scaled_source;
   }
 }
@@ -5414,10 +5336,7 @@
   if (cpi->unscaled_last_source != NULL)
     cpi->last_source = av1_scale_if_required(cm, cpi->unscaled_last_source,
                                              &cpi->scaled_last_source);
-#if CONFIG_HIGHBITDEPTH
   cpi->source->buf_8bit_valid = 0;
-#endif
-
   if (frame_is_intra_only(cm) == 0) {
     scale_references(cpi);
   }
@@ -5470,9 +5389,7 @@
 
   set_size_independent_vars(cpi);
 
-#if CONFIG_HIGHBITDEPTH
   cpi->source->buf_8bit_valid = 0;
-#endif
 
   aom_clear_system_state();
   setup_frame_size(cpi);
@@ -5572,16 +5489,11 @@
         int64_t high_err_target = cpi->ambient_err;
         int64_t low_err_target = cpi->ambient_err >> 1;
 
-#if CONFIG_HIGHBITDEPTH
         if (cm->use_highbitdepth) {
           kf_err = aom_highbd_get_y_sse(cpi->source, get_frame_new_buffer(cm));
         } else {
           kf_err = aom_get_y_sse(cpi->source, get_frame_new_buffer(cm));
         }
-#else
-        kf_err = aom_get_y_sse(cpi->source, get_frame_new_buffer(cm));
-#endif  // CONFIG_HIGHBITDEPTH
-
         // Prevent possible divide by zero error below for perfect KF
         kf_err += !kf_err;
 
@@ -6214,18 +6126,14 @@
     const int frame_id_length = FRAME_ID_LENGTH;
     if (cm->current_frame_id == -1) {
       int lsb, msb;
-/* quasi-random initialization of current_frame_id for a key frame */
-#if CONFIG_HIGHBITDEPTH
+      /* quasi-random initialization of current_frame_id for a key frame */
       if (cpi->source->flags & YV12_FLAG_HIGHBITDEPTH) {
         lsb = CONVERT_TO_SHORTPTR(cpi->source->y_buffer)[0] & 0xff;
         msb = CONVERT_TO_SHORTPTR(cpi->source->y_buffer)[1] & 0xff;
       } else {
-#endif
         lsb = cpi->source->y_buffer[0] & 0xff;
         msb = cpi->source->y_buffer[1] & 0xff;
-#if CONFIG_HIGHBITDEPTH
       }
-#endif
       cm->current_frame_id = ((msb << 8) + lsb) % (1 << frame_id_length);
     } else {
       cm->current_frame_id =
@@ -6262,16 +6170,12 @@
   // fixed interval. Note the reconstruction error if it is the frame before
   // the force key frame
   if (cpi->rc.next_key_frame_forced && cpi->rc.frames_to_key == 1) {
-#if CONFIG_HIGHBITDEPTH
     if (cm->use_highbitdepth) {
       cpi->ambient_err =
           aom_highbd_get_y_sse(cpi->source, get_frame_new_buffer(cm));
     } else {
       cpi->ambient_err = aom_get_y_sse(cpi->source, get_frame_new_buffer(cm));
     }
-#else
-    cpi->ambient_err = aom_get_y_sse(cpi->source, get_frame_new_buffer(cm));
-#endif  // CONFIG_HIGHBITDEPTH
   }
 
   // If the encoder forced a KEY_FRAME decision
@@ -6527,23 +6431,14 @@
   int res = 0;
   const int subsampling_x = sd->subsampling_x;
   const int subsampling_y = sd->subsampling_y;
-#if CONFIG_HIGHBITDEPTH
   const int use_highbitdepth = (sd->flags & YV12_FLAG_HIGHBITDEPTH) != 0;
-#endif
 
-#if CONFIG_HIGHBITDEPTH
   check_initial_width(cpi, use_highbitdepth, subsampling_x, subsampling_y);
-#else
-  check_initial_width(cpi, subsampling_x, subsampling_y);
-#endif  // CONFIG_HIGHBITDEPTH
 
   aom_usec_timer_start(&timer);
 
   if (av1_lookahead_push(cpi->lookahead, sd, time_stamp, end_time,
-#if CONFIG_HIGHBITDEPTH
-                         use_highbitdepth,
-#endif  // CONFIG_HIGHBITDEPTH
-                         frame_flags))
+                         use_highbitdepth, frame_flags))
     res = -1;
   aom_usec_timer_mark(&timer);
   cpi->time_receive_data += aom_usec_timer_elapsed(&timer);
@@ -6726,12 +6621,10 @@
 #endif
   cpi->bytes += frame_bytes;
 
-#if CONFIG_HIGHBITDEPTH
   if (cm->use_highbitdepth) {
     in_bit_depth = cpi->oxcf.input_bit_depth;
     bit_depth = cm->bit_depth;
   }
-#endif
   if (cm->show_frame) {
     const YV12_BUFFER_CONFIG *orig = cpi->source;
     const YV12_BUFFER_CONFIG *recon = cpi->common.frame_to_show;
@@ -6742,28 +6635,20 @@
       PSNR_STATS psnr;
       double frame_ssim2 = 0.0, weight = 0.0;
       aom_clear_system_state();
-// TODO(yaowu): unify these two versions into one.
-#if CONFIG_HIGHBITDEPTH
+      // TODO(yaowu): unify these two versions into one.
       aom_calc_highbd_psnr(orig, recon, &psnr, bit_depth, in_bit_depth);
-#else
-      aom_calc_psnr(orig, recon, &psnr);
-#endif  // CONFIG_HIGHBITDEPTH
 
       adjust_image_stat(psnr.psnr[1], psnr.psnr[2], psnr.psnr[3], psnr.psnr[0],
                         &cpi->psnr);
       cpi->total_sq_error += psnr.sse[0];
       cpi->total_samples += psnr.samples[0];
       samples = psnr.samples[0];
-// TODO(yaowu): unify these two versions into one.
-#if CONFIG_HIGHBITDEPTH
+      // TODO(yaowu): unify these two versions into one.
       if (cm->use_highbitdepth)
         frame_ssim2 =
             aom_highbd_calc_ssim(orig, recon, &weight, bit_depth, in_bit_depth);
       else
         frame_ssim2 = aom_calc_ssim(orig, recon, &weight);
-#else
-      frame_ssim2 = aom_calc_ssim(orig, recon, &weight);
-#endif  // CONFIG_HIGHBITDEPTH
 
       cpi->worst_ssim = AOMMIN(cpi->worst_ssim, frame_ssim2);
       cpi->summed_quality += frame_ssim2 * weight;
@@ -6784,10 +6669,7 @@
 #endif
     }
     if (cpi->b_calculate_blockiness) {
-#if CONFIG_HIGHBITDEPTH
-      if (!cm->use_highbitdepth)
-#endif
-      {
+      if (!cm->use_highbitdepth) {
         const double frame_blockiness =
             av1_get_blockiness(orig->y_buffer, orig->y_stride, recon->y_buffer,
                                recon->y_stride, orig->y_width, orig->y_height);
@@ -6796,10 +6678,7 @@
       }
 
       if (cpi->b_calculate_consistency) {
-#if CONFIG_HIGHBITDEPTH
-        if (!cm->use_highbitdepth)
-#endif
-        {
+        if (!cm->use_highbitdepth) {
           const double this_inconsistency = aom_get_ssim_metrics(
               orig->y_buffer, orig->y_stride, recon->y_buffer, recon->y_stride,
               orig->y_width, orig->y_height, cpi->ssim_vars, &cpi->metrics, 1);
@@ -7247,9 +7126,7 @@
 #endif  // CONFIG_FRAME_MARKER
 
   cm->cur_frame = &pool->frame_bufs[cm->new_fb_idx];
-#if CONFIG_HIGHBITDEPTH
   cm->cur_frame->buf.buf_8bit_valid = 0;
-#endif
 
   // Start with a 0 size frame.
   *size = 0;
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index 1761b9a..0ae4df8 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -284,9 +284,7 @@
 
   aom_tune_metric tuning;
   aom_tune_content content;
-#if CONFIG_HIGHBITDEPTH
   int use_highbitdepth;
-#endif
   aom_color_space_t color_space;
   aom_transfer_function_t transfer_function;
   aom_chroma_sample_position_t chroma_sample_position;
diff --git a/av1/encoder/ethread.c b/av1/encoder/ethread.c
index e104383..69781b7 100644
--- a/av1/encoder/ethread.c
+++ b/av1/encoder/ethread.c
@@ -88,11 +88,7 @@
         thread_data->td->pc_tree = NULL;
         av1_setup_pc_tree(cm, thread_data->td);
 
-#if CONFIG_HIGHBITDEPTH
         int buf_scaler = 2;
-#else
-        int buf_scaler = 1;
-#endif
         CHECK_MEM_ERROR(cm, thread_data->td->above_pred_buf,
                         (uint8_t *)aom_memalign(
                             16,
diff --git a/av1/encoder/extend.c b/av1/encoder/extend.c
index 007694a..e9621a5 100644
--- a/av1/encoder/extend.c
+++ b/av1/encoder/extend.c
@@ -57,7 +57,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void highbd_copy_and_extend_plane(const uint8_t *src8, int src_pitch,
                                          uint8_t *dst8, int dst_pitch, int w,
                                          int h, int extend_top, int extend_left,
@@ -100,7 +99,6 @@
     dst_ptr2 += dst_pitch;
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 void av1_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src,
                                YV12_BUFFER_CONFIG *dst) {
@@ -124,7 +122,6 @@
   const int eb_uv = eb_y >> uv_height_subsampling;
   const int er_uv = er_y >> uv_width_subsampling;
 
-#if CONFIG_HIGHBITDEPTH
   if (src->flags & YV12_FLAG_HIGHBITDEPTH) {
     highbd_copy_and_extend_plane(src->y_buffer, src->y_stride, dst->y_buffer,
                                  dst->y_stride, src->y_crop_width,
@@ -139,7 +136,6 @@
         src->uv_crop_width, src->uv_crop_height, et_uv, el_uv, eb_uv, er_uv);
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
 
   copy_and_extend_plane(src->y_buffer, src->y_stride, dst->y_buffer,
                         dst->y_stride, src->y_crop_width, src->y_crop_height,
diff --git a/av1/encoder/firstpass.c b/av1/encoder/firstpass.c
index 0572901..c137311 100644
--- a/av1/encoder/firstpass.c
+++ b/av1/encoder/firstpass.c
@@ -305,7 +305,6 @@
   return sse;
 }
 
-#if CONFIG_HIGHBITDEPTH
 static aom_variance_fn_t highbd_get_block_variance_fn(BLOCK_SIZE bsize,
                                                       int bd) {
   switch (bd) {
@@ -345,7 +344,6 @@
   fn(src->buf, src->stride, ref->buf, ref->stride, &sse);
   return sse;
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 // Refine the motion search range according to the frame dimension
 // for first pass test.
@@ -376,11 +374,9 @@
 
   // Override the default variance function to use MSE.
   v_fn_ptr.vf = get_block_variance_fn(bsize);
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     v_fn_ptr.vf = highbd_get_block_variance_fn(bsize, xd->bd);
   }
-#endif  // CONFIG_HIGHBITDEPTH
 
   // Center the initial step/diamond search on best mv.
   tmp_err = cpi->diamond_search_sad(x, &cpi->ss_cfg, &ref_mv_full, &tmp_mv,
@@ -660,7 +656,6 @@
         image_data_start_row = mb_row;
       }
 
-#if CONFIG_HIGHBITDEPTH
       if (cm->use_highbitdepth) {
         switch (cm->bit_depth) {
           case AOM_BITS_8: break;
@@ -673,7 +668,6 @@
             return;
         }
       }
-#endif  // CONFIG_HIGHBITDEPTH
 
       aom_clear_system_state();
       log_intra = log(this_error + 1.0);
@@ -682,14 +676,10 @@
       else
         intra_factor += 1.0;
 
-#if CONFIG_HIGHBITDEPTH
       if (cm->use_highbitdepth)
         level_sample = CONVERT_TO_SHORTPTR(x->plane[0].src.buf)[0];
       else
         level_sample = x->plane[0].src.buf[0];
-#else
-      level_sample = x->plane[0].src.buf[0];
-#endif
       if ((level_sample < DARK_THRESH) && (log_intra < 9.0))
         brightness_factor += 1.0 + (0.01 * (DARK_THRESH - level_sample));
       else
@@ -727,7 +717,6 @@
         struct buf_2d unscaled_last_source_buf_2d;
 
         xd->plane[0].pre[0].buf = first_ref_buf->y_buffer + recon_yoffset;
-#if CONFIG_HIGHBITDEPTH
         if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
           motion_error = highbd_get_prediction_error(
               bsize, &x->plane[0].src, &xd->plane[0].pre[0], xd->bd);
@@ -735,10 +724,6 @@
           motion_error = get_prediction_error(bsize, &x->plane[0].src,
                                               &xd->plane[0].pre[0]);
         }
-#else
-        motion_error =
-            get_prediction_error(bsize, &x->plane[0].src, &xd->plane[0].pre[0]);
-#endif  // CONFIG_HIGHBITDEPTH
 
         // Compute the motion error of the 0,0 motion using the last source
         // frame as the reference. Skip the further motion search on
@@ -747,7 +732,6 @@
             cpi->unscaled_last_source->y_buffer + recon_yoffset;
         unscaled_last_source_buf_2d.stride =
             cpi->unscaled_last_source->y_stride;
-#if CONFIG_HIGHBITDEPTH
         if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
           raw_motion_error = highbd_get_prediction_error(
               bsize, &x->plane[0].src, &unscaled_last_source_buf_2d, xd->bd);
@@ -755,10 +739,6 @@
           raw_motion_error = get_prediction_error(bsize, &x->plane[0].src,
                                                   &unscaled_last_source_buf_2d);
         }
-#else
-        raw_motion_error = get_prediction_error(bsize, &x->plane[0].src,
-                                                &unscaled_last_source_buf_2d);
-#endif  // CONFIG_HIGHBITDEPTH
 
         // TODO(pengchong): Replace the hard-coded threshold
         if (raw_motion_error > 25) {
@@ -784,7 +764,6 @@
             int gf_motion_error;
 
             xd->plane[0].pre[0].buf = gld_yv12->y_buffer + recon_yoffset;
-#if CONFIG_HIGHBITDEPTH
             if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
               gf_motion_error = highbd_get_prediction_error(
                   bsize, &x->plane[0].src, &xd->plane[0].pre[0], xd->bd);
@@ -792,10 +771,6 @@
               gf_motion_error = get_prediction_error(bsize, &x->plane[0].src,
                                                      &xd->plane[0].pre[0]);
             }
-#else
-            gf_motion_error = get_prediction_error(bsize, &x->plane[0].src,
-                                                   &xd->plane[0].pre[0]);
-#endif  // CONFIG_HIGHBITDEPTH
 
             first_pass_motion_search(cpi, x, &zero_mv, &tmp_mv,
                                      &gf_motion_error);
diff --git a/av1/encoder/global_motion.c b/av1/encoder/global_motion.c
index 91de406..ec583e3 100644
--- a/av1/encoder/global_motion.c
+++ b/av1/encoder/global_motion.c
@@ -129,10 +129,7 @@
 }
 
 int64_t refine_integerized_param(WarpedMotionParams *wm,
-                                 TransformationType wmtype,
-#if CONFIG_HIGHBITDEPTH
-                                 int use_hbd, int bd,
-#endif  // CONFIG_HIGHBITDEPTH
+                                 TransformationType wmtype, int use_hbd, int bd,
                                  uint8_t *ref, int r_width, int r_height,
                                  int r_stride, uint8_t *dst, int d_width,
                                  int d_height, int d_stride, int n_refinements,
@@ -151,11 +148,7 @@
   int32_t best_param;
 
   force_wmtype(wm, wmtype);
-  best_error = av1_warp_error(wm,
-#if CONFIG_HIGHBITDEPTH
-                              use_hbd, bd,
-#endif  // CONFIG_HIGHBITDEPTH
-                              ref, r_width, r_height, r_stride,
+  best_error = av1_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride,
                               dst + border * d_stride + border, border, border,
                               d_width - 2 * border, d_height - 2 * border,
                               d_stride, 0, 0, best_frame_error);
@@ -170,14 +163,11 @@
       best_param = curr_param;
       // look to the left
       *param = add_param_offset(p, curr_param, -step);
-      step_error = av1_warp_error(
-          wm,
-#if CONFIG_HIGHBITDEPTH
-          use_hbd, bd,
-#endif  // CONFIG_HIGHBITDEPTH
-          ref, r_width, r_height, r_stride, dst + border * d_stride + border,
-          border, border, d_width - 2 * border, d_height - 2 * border, d_stride,
-          0, 0, best_error);
+      step_error =
+          av1_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride,
+                         dst + border * d_stride + border, border, border,
+                         d_width - 2 * border, d_height - 2 * border, d_stride,
+                         0, 0, best_error);
       if (step_error < best_error) {
         best_error = step_error;
         best_param = *param;
@@ -186,14 +176,11 @@
 
       // look to the right
       *param = add_param_offset(p, curr_param, step);
-      step_error = av1_warp_error(
-          wm,
-#if CONFIG_HIGHBITDEPTH
-          use_hbd, bd,
-#endif  // CONFIG_HIGHBITDEPTH
-          ref, r_width, r_height, r_stride, dst + border * d_stride + border,
-          border, border, d_width - 2 * border, d_height - 2 * border, d_stride,
-          0, 0, best_error);
+      step_error =
+          av1_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride,
+                         dst + border * d_stride + border, border, border,
+                         d_width - 2 * border, d_height - 2 * border, d_stride,
+                         0, 0, best_error);
       if (step_error < best_error) {
         best_error = step_error;
         best_param = *param;
@@ -205,14 +192,11 @@
       // for the biggest step size
       while (step_dir) {
         *param = add_param_offset(p, best_param, step * step_dir);
-        step_error = av1_warp_error(
-            wm,
-#if CONFIG_HIGHBITDEPTH
-            use_hbd, bd,
-#endif  // CONFIG_HIGHBITDEPTH
-            ref, r_width, r_height, r_stride, dst + border * d_stride + border,
-            border, border, d_width - 2 * border, d_height - 2 * border,
-            d_stride, 0, 0, best_error);
+        step_error =
+            av1_warp_error(wm, use_hbd, bd, ref, r_width, r_height, r_stride,
+                           dst + border * d_stride + border, border, border,
+                           d_width - 2 * border, d_height - 2 * border,
+                           d_stride, 0, 0, best_error);
         if (step_error < best_error) {
           best_error = step_error;
           best_param = *param;
@@ -237,7 +221,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static unsigned char *downconvert_frame(YV12_BUFFER_CONFIG *frm,
                                         int bit_depth) {
   int i, j;
@@ -255,14 +238,13 @@
   }
   return buf_8bit;
 }
-#endif
 
-int compute_global_motion_feature_based(
-    TransformationType type, YV12_BUFFER_CONFIG *frm, YV12_BUFFER_CONFIG *ref,
-#if CONFIG_HIGHBITDEPTH
-    int bit_depth,
-#endif
-    int *num_inliers_by_motion, double *params_by_motion, int num_motions) {
+int compute_global_motion_feature_based(TransformationType type,
+                                        YV12_BUFFER_CONFIG *frm,
+                                        YV12_BUFFER_CONFIG *ref, int bit_depth,
+                                        int *num_inliers_by_motion,
+                                        double *params_by_motion,
+                                        int num_motions) {
   int i;
   int num_frm_corners, num_ref_corners;
   int num_correspondences;
@@ -272,7 +254,6 @@
   unsigned char *ref_buffer = ref->y_buffer;
   RansacFunc ransac = get_ransac_type(type);
 
-#if CONFIG_HIGHBITDEPTH
   if (frm->flags & YV12_FLAG_HIGHBITDEPTH) {
     // The frame buffer is 16-bit, so we need to convert to 8 bits for the
     // following code. We cache the result until the frame is released.
@@ -281,7 +262,6 @@
   if (ref->flags & YV12_FLAG_HIGHBITDEPTH) {
     ref_buffer = downconvert_frame(ref, bit_depth);
   }
-#endif
 
   // compute interest points in images using FAST features
   num_frm_corners = fast_corner_detect(frm_buffer, frm->y_width, frm->y_height,
diff --git a/av1/encoder/global_motion.h b/av1/encoder/global_motion.h
index 7fca532..59419cd 100644
--- a/av1/encoder/global_motion.h
+++ b/av1/encoder/global_motion.h
@@ -30,10 +30,7 @@
 // motion params that result from fine-tuning "wm" to "ref". Note that "wm" is
 // modified in place.
 int64_t refine_integerized_param(WarpedMotionParams *wm,
-                                 TransformationType wmtype,
-#if CONFIG_HIGHBITDEPTH
-                                 int use_hbd, int bd,
-#endif  // CONFIG_HIGHBITDEPTH
+                                 TransformationType wmtype, int use_hbd, int bd,
                                  uint8_t *ref, int r_width, int r_height,
                                  int r_stride, uint8_t *dst, int d_width,
                                  int d_height, int d_stride, int n_refinements,
@@ -54,12 +51,12 @@
   number of inlier feature points for each motion. Params for which the
   num_inliers entry is 0 should be ignored by the caller.
 */
-int compute_global_motion_feature_based(
-    TransformationType type, YV12_BUFFER_CONFIG *frm, YV12_BUFFER_CONFIG *ref,
-#if CONFIG_HIGHBITDEPTH
-    int bit_depth,
-#endif
-    int *num_inliers_by_motion, double *params_by_motion, int num_motions);
+int compute_global_motion_feature_based(TransformationType type,
+                                        YV12_BUFFER_CONFIG *frm,
+                                        YV12_BUFFER_CONFIG *ref, int bit_depth,
+                                        int *num_inliers_by_motion,
+                                        double *params_by_motion,
+                                        int num_motions);
 #ifdef __cplusplus
 }  // extern "C"
 #endif
diff --git a/av1/encoder/lookahead.c b/av1/encoder/lookahead.c
index 591ca61..2dd631a 100644
--- a/av1/encoder/lookahead.c
+++ b/av1/encoder/lookahead.c
@@ -42,14 +42,9 @@
   }
 }
 
-struct lookahead_ctx *av1_lookahead_init(unsigned int width,
-                                         unsigned int height,
-                                         unsigned int subsampling_x,
-                                         unsigned int subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-                                         int use_highbitdepth,
-#endif
-                                         unsigned int depth) {
+struct lookahead_ctx *av1_lookahead_init(
+    unsigned int width, unsigned int height, unsigned int subsampling_x,
+    unsigned int subsampling_y, int use_highbitdepth, unsigned int depth) {
   struct lookahead_ctx *ctx = NULL;
 
   // Clamp the lookahead queue depth
@@ -68,10 +63,7 @@
     if (!ctx->buf) goto bail;
     for (i = 0; i < depth; i++)
       if (aom_alloc_frame_buffer(&ctx->buf[i].img, width, height, subsampling_x,
-                                 subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-                                 use_highbitdepth,
-#endif
+                                 subsampling_y, use_highbitdepth,
                                  AOM_BORDER_IN_PIXELS, legacy_byte_alignment))
         goto bail;
   }
@@ -84,10 +76,7 @@
 #define USE_PARTIAL_COPY 0
 
 int av1_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src,
-                       int64_t ts_start, int64_t ts_end,
-#if CONFIG_HIGHBITDEPTH
-                       int use_highbitdepth,
-#endif
+                       int64_t ts_start, int64_t ts_end, int use_highbitdepth,
                        aom_enc_frame_flags_t flags) {
   struct lookahead_entry *buf;
 #if USE_PARTIAL_COPY
@@ -160,10 +149,7 @@
       YV12_BUFFER_CONFIG new_img;
       memset(&new_img, 0, sizeof(new_img));
       if (aom_alloc_frame_buffer(&new_img, width, height, subsampling_x,
-                                 subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-                                 use_highbitdepth,
-#endif
+                                 subsampling_y, use_highbitdepth,
                                  AOM_BORDER_IN_PIXELS, 0))
         return 1;
       aom_free_frame_buffer(&buf->img);
diff --git a/av1/encoder/lookahead.h b/av1/encoder/lookahead.h
index 19f75d7..3897c2a 100644
--- a/av1/encoder/lookahead.h
+++ b/av1/encoder/lookahead.h
@@ -44,14 +44,9 @@
  * The lookahead stage is a queue of frame buffers on which some analysis
  * may be done when buffers are enqueued.
  */
-struct lookahead_ctx *av1_lookahead_init(unsigned int width,
-                                         unsigned int height,
-                                         unsigned int subsampling_x,
-                                         unsigned int subsampling_y,
-#if CONFIG_HIGHBITDEPTH
-                                         int use_highbitdepth,
-#endif
-                                         unsigned int depth);
+struct lookahead_ctx *av1_lookahead_init(
+    unsigned int width, unsigned int height, unsigned int subsampling_x,
+    unsigned int subsampling_y, int use_highbitdepth, unsigned int depth);
 
 /**\brief Destroys the lookahead stage
  */
@@ -73,10 +68,7 @@
  * \param[in] active_map  Map that specifies which macroblock is active
  */
 int av1_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src,
-                       int64_t ts_start, int64_t ts_end,
-#if CONFIG_HIGHBITDEPTH
-                       int use_highbitdepth,
-#endif
+                       int64_t ts_start, int64_t ts_end, int use_highbitdepth,
                        aom_enc_frame_flags_t flags);
 
 /**\brief Get the next source buffer to encode
diff --git a/av1/encoder/mcomp.c b/av1/encoder/mcomp.c
index 5ad7127..126d004 100644
--- a/av1/encoder/mcomp.c
+++ b/av1/encoder/mcomp.c
@@ -365,7 +365,6 @@
     int mask_stride, int invert_mask, int w, int h, int offset, int *mvjcost,
     int *mvcost[2], unsigned int *sse1, int *distortion) {
   unsigned int besterr;
-#if CONFIG_HIGHBITDEPTH
   if (second_pred != NULL) {
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
       DECLARE_ALIGNED(16, uint16_t, comp_pred16[MAX_SB_SQUARE]);
@@ -405,29 +404,6 @@
   }
   *distortion = besterr;
   besterr += mv_err_cost(bestmv, ref_mv, mvjcost, mvcost, error_per_bit);
-#else
-  (void)xd;
-  if (second_pred != NULL) {
-    DECLARE_ALIGNED(16, uint8_t, comp_pred[MAX_SB_SQUARE]);
-    if (mask) {
-      aom_comp_mask_pred(comp_pred, second_pred, w, h, y + offset, y_stride,
-                         mask, mask_stride, invert_mask);
-    } else {
-#if CONFIG_JNT_COMP
-      if (xd->jcp_param.use_jnt_comp_avg)
-        aom_jnt_comp_avg_pred(comp_pred, second_pred, w, h, y + offset,
-                              y_stride, &xd->jcp_param);
-      else
-#endif  // CONFIG_JNT_COMP
-        aom_comp_avg_pred(comp_pred, second_pred, w, h, y + offset, y_stride);
-    }
-    besterr = vfp->vf(comp_pred, w, src, src_stride, sse1);
-  } else {
-    besterr = vfp->vf(y + offset, y_stride, src, src_stride, sse1);
-  }
-  *distortion = besterr;
-  besterr += mv_err_cost(bestmv, ref_mv, mvjcost, mvcost, error_per_bit);
-#endif  // CONFIG_HIGHBITDEPTH
   return besterr;
 }
 
@@ -688,7 +664,6 @@
                                 int mask_stride, int invert_mask, int w, int h,
                                 unsigned int *sse) {
   unsigned int besterr;
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     DECLARE_ALIGNED(16, uint16_t, pred16[MAX_SB_SQUARE]);
     if (second_pred != NULL) {
@@ -716,10 +691,6 @@
     besterr = vfp->vf(CONVERT_TO_BYTEPTR(pred16), w, src, src_stride, sse);
   } else {
     DECLARE_ALIGNED(16, uint8_t, pred[MAX_SB_SQUARE]);
-#else
-  DECLARE_ALIGNED(16, uint8_t, pred[MAX_SB_SQUARE]);
-  (void)xd;
-#endif  // CONFIG_HIGHBITDEPTH
     if (second_pred != NULL) {
       if (mask) {
         aom_comp_mask_upsampled_pred(pred, second_pred, w, h, subpel_x_q3,
@@ -741,9 +712,7 @@
     }
 
     besterr = vfp->vf(pred, w, src, src_stride, sse);
-#if CONFIG_HIGHBITDEPTH
   }
-#endif
   return besterr;
 }
 
@@ -1978,7 +1947,6 @@
     av1_setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL);
   }
 
-#if CONFIG_HIGHBITDEPTH
   {
     unsigned int this_sad;
     tmp_mv->row = 0;
@@ -1992,7 +1960,6 @@
     }
     return this_sad;
   }
-#endif
 
   const int bw = 4 << b_width_log2_lookup[bsize];
   const int bh = 4 << b_height_log2_lookup[bsize];
@@ -2791,7 +2758,6 @@
                                      int subpel_x_q3, int subpel_y_q3, int w,
                                      int h, unsigned int *sse) {
   unsigned int besterr;
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     DECLARE_ALIGNED(16, uint16_t, pred16[MAX_SB_SQUARE]);
     aom_highbd_upsampled_pred(pred16, w, h, subpel_x_q3, subpel_y_q3, y,
@@ -2800,16 +2766,10 @@
     besterr = vfp->ovf(CONVERT_TO_BYTEPTR(pred16), w, wsrc, mask, sse);
   } else {
     DECLARE_ALIGNED(16, uint8_t, pred[MAX_SB_SQUARE]);
-#else
-  DECLARE_ALIGNED(16, uint8_t, pred[MAX_SB_SQUARE]);
-  (void)xd;
-#endif  // CONFIG_HIGHBITDEPTH
     aom_upsampled_pred(pred, w, h, subpel_x_q3, subpel_y_q3, y, y_stride);
 
     besterr = vfp->ovf(pred, w, wsrc, mask, sse);
-#if CONFIG_HIGHBITDEPTH
   }
-#endif
   return besterr;
 }
 
diff --git a/av1/encoder/pickcdef.c b/av1/encoder/pickcdef.c
index be97b65..7821617 100644
--- a/av1/encoder/pickcdef.c
+++ b/av1/encoder/pickcdef.c
@@ -364,20 +364,16 @@
 
     for (r = 0; r < frame_height; ++r) {
       for (c = 0; c < frame_width; ++c) {
-#if CONFIG_HIGHBITDEPTH
         if (cm->use_highbitdepth) {
           src[pli][r * stride[pli] + c] = CONVERT_TO_SHORTPTR(
               xd->plane[pli].dst.buf)[r * xd->plane[pli].dst.stride + c];
           ref_coeff[pli][r * stride[pli] + c] =
               CONVERT_TO_SHORTPTR(ref_buffer)[r * ref_stride + c];
         } else {
-#endif
           src[pli][r * stride[pli] + c] =
               xd->plane[pli].dst.buf[r * xd->plane[pli].dst.stride + c];
           ref_coeff[pli][r * stride[pli] + c] = ref_buffer[r * ref_stride + c];
-#if CONFIG_HIGHBITDEPTH
         }
-#endif
       }
     }
   }
diff --git a/av1/encoder/picklpf.c b/av1/encoder/picklpf.c
index 1aea028..89c102b 100644
--- a/av1/encoder/picklpf.c
+++ b/av1/encoder/picklpf.c
@@ -71,9 +71,7 @@
 #endif  // CONFIG_LOOPFILTER_LEVEL
 
   int highbd = 0;
-#if CONFIG_HIGHBITDEPTH
   highbd = cm->use_highbitdepth;
-#endif  // CONFIG_HIGHBITDEPTH
 
 #if CONFIG_LOOPFILTER_LEVEL
   filt_err = aom_get_sse_plane(sd, cm->frame_to_show, plane, highbd);
@@ -230,14 +228,13 @@
     const int min_filter_level = 0;
     const int max_filter_level = av1_get_max_filter_level(cpi);
     const int q = av1_ac_quant_Q3(cm->base_qindex, 0, cm->bit_depth);
-// These values were determined by linear fitting the result of the
-// searched level for 8 bit depth:
-// Keyframes: filt_guess = q * 0.06699 - 1.60817
-// Other frames: filt_guess = q * 0.02295 + 2.48225
-//
-// And high bit depth separately:
-// filt_guess = q * 0.316206 + 3.87252
-#if CONFIG_HIGHBITDEPTH
+    // These values were determined by linear fitting the result of the
+    // searched level for 8 bit depth:
+    // Keyframes: filt_guess = q * 0.06699 - 1.60817
+    // Other frames: filt_guess = q * 0.02295 + 2.48225
+    //
+    // And high bit depth separately:
+    // filt_guess = q * 0.316206 + 3.87252
     int filt_guess;
     switch (cm->bit_depth) {
       case AOM_BITS_8:
@@ -257,11 +254,6 @@
                "or AOM_BITS_12");
         return;
     }
-#else
-    int filt_guess = (cm->frame_type == KEY_FRAME)
-                         ? ROUND_POWER_OF_TWO(q * 17563 - 421574, 18)
-                         : ROUND_POWER_OF_TWO(q * 6017 + 650707, 18);
-#endif  // CONFIG_HIGHBITDEPTH
     if (cm->bit_depth != AOM_BITS_8 && cm->frame_type == KEY_FRAME)
       filt_guess -= 4;
 #if CONFIG_LOOPFILTER_LEVEL
diff --git a/av1/encoder/pickrst.c b/av1/encoder/pickrst.c
index 2a643c3..e28ae02 100644
--- a/av1/encoder/pickrst.c
+++ b/av1/encoder/pickrst.c
@@ -49,22 +49,18 @@
                                            int hstart, int width, int vstart,
                                            int height);
 
-#define NUM_EXTRACTORS (3 * (1 + CONFIG_HIGHBITDEPTH))
+#define NUM_EXTRACTORS (3 * (1 + 1))
 
 static const sse_part_extractor_type sse_part_extractors[NUM_EXTRACTORS] = {
   aom_get_y_sse_part,        aom_get_u_sse_part,
-  aom_get_v_sse_part,
-#if CONFIG_HIGHBITDEPTH
-  aom_highbd_get_y_sse_part, aom_highbd_get_u_sse_part,
-  aom_highbd_get_v_sse_part,
-#endif  // CONFIG_HIGHBITDEPTH
+  aom_get_v_sse_part,        aom_highbd_get_y_sse_part,
+  aom_highbd_get_u_sse_part, aom_highbd_get_v_sse_part,
 };
 
 static int64_t sse_restoration_tile(const RestorationTileLimits *limits,
                                     const YV12_BUFFER_CONFIG *src,
                                     const YV12_BUFFER_CONFIG *dst, int plane,
                                     int highbd) {
-  assert(CONFIG_HIGHBITDEPTH || !highbd);
   return sse_part_extractors[3 * highbd + plane](
       src, dst, limits->h_start, limits->h_end - limits->h_start,
       limits->v_start, limits->v_end - limits->v_start);
@@ -169,13 +165,8 @@
 #else
   (void)tile_rect;
 #endif
-#if CONFIG_HIGHBITDEPTH
   const int bit_depth = cm->bit_depth;
   const int highbd = cm->use_highbitdepth;
-#else
-  const int bit_depth = 8;
-  const int highbd = 0;
-#endif
 
   const YV12_BUFFER_CONFIG *fts = cm->frame_to_show;
 
@@ -467,13 +458,8 @@
 
   const MACROBLOCK *const x = rsc->x;
   const AV1_COMMON *const cm = rsc->cm;
-#if CONFIG_HIGHBITDEPTH
   const int highbd = cm->use_highbitdepth;
   const int bit_depth = cm->bit_depth;
-#else
-  const int highbd = 0;
-  const int bit_depth = 8;
-#endif  // CONFIG_HIGHBITDEPTH
 
   uint8_t *dgd_start =
       rsc->dgd_buffer + limits->v_start * rsc->dgd_stride + limits->h_start;
@@ -572,7 +558,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static double find_average_highbd(const uint16_t *src, int h_start, int h_end,
                                   int v_start, int v_end, int stride) {
   uint64_t sum = 0;
@@ -629,7 +614,6 @@
     }
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 static INLINE int wrap_index(int i, int wiener_win) {
   const int wiener_halfwin1 = (wiener_win >> 1) + 1;
@@ -993,14 +977,12 @@
   double H[WIENER_WIN2 * WIENER_WIN2];
   double vfilterd[WIENER_WIN], hfilterd[WIENER_WIN];
 
-#if CONFIG_HIGHBITDEPTH
   const AV1_COMMON *const cm = rsc->cm;
   if (cm->use_highbitdepth)
     compute_stats_highbd(wiener_win, rsc->dgd_buffer, rsc->src_buffer,
                          limits->h_start, limits->h_end, limits->v_start,
                          limits->v_end, rsc->dgd_stride, rsc->src_stride, M, H);
   else
-#endif  // CONFIG_HIGHBITDEPTH
     compute_stats(wiener_win, rsc->dgd_buffer, rsc->src_buffer, limits->h_start,
                   limits->h_end, limits->v_start, limits->v_end,
                   rsc->dgd_stride, rsc->src_stride, M, H);
@@ -1074,12 +1056,7 @@
   RestSearchCtxt *rsc = (RestSearchCtxt *)priv;
   RestUnitSearchInfo *rusi = &rsc->rusi[rest_unit_idx];
 
-#if CONFIG_HIGHBITDEPTH
   const int highbd = rsc->cm->use_highbitdepth;
-#else
-  const int highbd = 0;
-#endif  // CONFIG_HIGHBITDEPTH
-
   rusi->sse[RESTORE_NONE] = sse_restoration_tile(
       limits, rsc->src, rsc->cm->frame_to_show, rsc->plane, highbd);
 
@@ -1193,11 +1170,7 @@
     double best_cost = 0;
     RestorationType best_rtype = RESTORE_NONE;
 
-#if CONFIG_HIGHBITDEPTH
     const int highbd = rsc.cm->use_highbitdepth;
-#else
-    const int highbd = 0;
-#endif
     extend_frame(rsc.dgd_buffer, rsc.plane_width, rsc.plane_height,
                  rsc.dgd_stride, RESTORATION_BORDER, RESTORATION_BORDER,
                  highbd);
diff --git a/av1/encoder/ratectrl.c b/av1/encoder/ratectrl.c
index 0e5b4a4..622c235 100644
--- a/av1/encoder/ratectrl.c
+++ b/av1/encoder/ratectrl.c
@@ -44,7 +44,6 @@
 #define MAX_BPB_FACTOR 50
 
 #define FRAME_OVERHEAD_BITS 200
-#if CONFIG_HIGHBITDEPTH
 #define ASSIGN_MINQ_TABLE(bit_depth, name)                   \
   do {                                                       \
     switch (bit_depth) {                                     \
@@ -58,13 +57,6 @@
         name = NULL;                                         \
     }                                                        \
   } while (0)
-#else
-#define ASSIGN_MINQ_TABLE(bit_depth, name) \
-  do {                                     \
-    (void)bit_depth;                       \
-    name = name##_8;                       \
-  } while (0)
-#endif
 
 // Tables relating active max Q to active min Q
 static int kf_low_motion_minq_8[QINDEX_RANGE];
@@ -74,7 +66,6 @@
 static int inter_minq_8[QINDEX_RANGE];
 static int rtc_minq_8[QINDEX_RANGE];
 
-#if CONFIG_HIGHBITDEPTH
 static int kf_low_motion_minq_10[QINDEX_RANGE];
 static int kf_high_motion_minq_10[QINDEX_RANGE];
 static int arfgf_low_motion_minq_10[QINDEX_RANGE];
@@ -87,7 +78,6 @@
 static int arfgf_high_motion_minq_12[QINDEX_RANGE];
 static int inter_minq_12[QINDEX_RANGE];
 static int rtc_minq_12[QINDEX_RANGE];
-#endif
 
 static int gf_high = 2000;
 static int gf_low = 400;
@@ -140,22 +130,19 @@
   init_minq_luts(kf_low_motion_minq_8, kf_high_motion_minq_8,
                  arfgf_low_motion_minq_8, arfgf_high_motion_minq_8,
                  inter_minq_8, rtc_minq_8, AOM_BITS_8);
-#if CONFIG_HIGHBITDEPTH
   init_minq_luts(kf_low_motion_minq_10, kf_high_motion_minq_10,
                  arfgf_low_motion_minq_10, arfgf_high_motion_minq_10,
                  inter_minq_10, rtc_minq_10, AOM_BITS_10);
   init_minq_luts(kf_low_motion_minq_12, kf_high_motion_minq_12,
                  arfgf_low_motion_minq_12, arfgf_high_motion_minq_12,
                  inter_minq_12, rtc_minq_12, AOM_BITS_12);
-#endif
 }
 
 // These functions use formulaic calculations to make playing with the
 // quantizer tables easier. If necessary they can be replaced by lookup
 // tables if and when things settle down in the experimental bitstream
 double av1_convert_qindex_to_q(int qindex, aom_bit_depth_t bit_depth) {
-// Convert the index to a real Q value (scaled down to match old Q values)
-#if CONFIG_HIGHBITDEPTH
+  // Convert the index to a real Q value (scaled down to match old Q values)
   switch (bit_depth) {
     case AOM_BITS_8: return av1_ac_quant_Q3(qindex, 0, bit_depth) / 4.0;
     case AOM_BITS_10: return av1_ac_quant_Q3(qindex, 0, bit_depth) / 16.0;
@@ -164,9 +151,6 @@
       assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
       return -1.0;
   }
-#else
-  return av1_ac_quant_Q3(qindex, 0, bit_depth) / 4.0;
-#endif
 }
 
 int av1_rc_bits_per_mb(FRAME_TYPE frame_type, int qindex,
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 7580bd0..d58c8a3 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -285,13 +285,10 @@
 // Values are now correlated to quantizer.
 static int sad_per_bit16lut_8[QINDEX_RANGE];
 static int sad_per_bit4lut_8[QINDEX_RANGE];
-
-#if CONFIG_HIGHBITDEPTH
 static int sad_per_bit16lut_10[QINDEX_RANGE];
 static int sad_per_bit4lut_10[QINDEX_RANGE];
 static int sad_per_bit16lut_12[QINDEX_RANGE];
 static int sad_per_bit4lut_12[QINDEX_RANGE];
-#endif
 
 static void init_me_luts_bd(int *bit16lut, int *bit4lut, int range,
                             aom_bit_depth_t bit_depth) {
@@ -309,12 +306,10 @@
 void av1_init_me_luts(void) {
   init_me_luts_bd(sad_per_bit16lut_8, sad_per_bit4lut_8, QINDEX_RANGE,
                   AOM_BITS_8);
-#if CONFIG_HIGHBITDEPTH
   init_me_luts_bd(sad_per_bit16lut_10, sad_per_bit4lut_10, QINDEX_RANGE,
                   AOM_BITS_10);
   init_me_luts_bd(sad_per_bit16lut_12, sad_per_bit4lut_12, QINDEX_RANGE,
                   AOM_BITS_12);
-#endif
 }
 
 static const int rd_boost_factor[16] = { 64, 32, 32, 32, 24, 16, 12, 12,
@@ -331,7 +326,6 @@
 
 int av1_compute_rd_mult(const AV1_COMP *cpi, int qindex) {
   const int64_t q = av1_dc_quant_Q3(qindex, 0, cpi->common.bit_depth);
-#if CONFIG_HIGHBITDEPTH
   int64_t rdmult = 0;
   switch (cpi->common.bit_depth) {
     case AOM_BITS_8: rdmult = 88 * q * q / 24; break;
@@ -341,9 +335,6 @@
       assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
       return -1;
   }
-#else
-  int64_t rdmult = 88 * q * q / 24;
-#endif  // CONFIG_HIGHBITDEPTH
   if (cpi->oxcf.pass == 2 && (cpi->common.frame_type != KEY_FRAME)) {
     const GF_GROUP *const gf_group = &cpi->twopass.gf_group;
     const FRAME_UPDATE_TYPE frame_type = gf_group->update_type[gf_group->index];
@@ -358,7 +349,6 @@
 
 static int compute_rd_thresh_factor(int qindex, aom_bit_depth_t bit_depth) {
   double q;
-#if CONFIG_HIGHBITDEPTH
   switch (bit_depth) {
     case AOM_BITS_8: q = av1_dc_quant_Q3(qindex, 0, AOM_BITS_8) / 4.0; break;
     case AOM_BITS_10: q = av1_dc_quant_Q3(qindex, 0, AOM_BITS_10) / 16.0; break;
@@ -367,16 +357,11 @@
       assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
       return -1;
   }
-#else
-  (void)bit_depth;
-  q = av1_dc_quant_Q3(qindex, 0, AOM_BITS_8) / 4.0;
-#endif  // CONFIG_HIGHBITDEPTH
   // TODO(debargha): Adjust the function below.
   return AOMMAX((int)(pow(q, RD_THRESH_POW) * 5.12), 8);
 }
 
 void av1_initialize_me_consts(const AV1_COMP *cpi, MACROBLOCK *x, int qindex) {
-#if CONFIG_HIGHBITDEPTH
   switch (cpi->common.bit_depth) {
     case AOM_BITS_8:
       x->sadperbit16 = sad_per_bit16lut_8[qindex];
@@ -393,11 +378,6 @@
     default:
       assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
   }
-#else
-  (void)cpi;
-  x->sadperbit16 = sad_per_bit16lut_8[qindex];
-  x->sadperbit4 = sad_per_bit4lut_8[qindex];
-#endif  // CONFIG_HIGHBITDEPTH
 }
 
 static void set_block_thresholds(const AV1_COMMON *cm, RD_OPT *rd) {
@@ -1282,7 +1262,6 @@
 int av1_get_intra_cost_penalty(int qindex, int qdelta,
                                aom_bit_depth_t bit_depth) {
   const int q = av1_dc_quant_Q3(qindex, qdelta, bit_depth);
-#if CONFIG_HIGHBITDEPTH
   switch (bit_depth) {
     case AOM_BITS_8: return 20 * q;
     case AOM_BITS_10: return 5 * q;
@@ -1291,7 +1270,4 @@
       assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
       return -1;
   }
-#else
-  return 20 * q;
-#endif  // CONFIG_HIGHBITDEPTH
 }
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 7586342..cf3f118 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -435,7 +435,6 @@
     cpi->fn_ptr[tx_bsize].vf(src, src_stride, dst, dst_stride, &sse);
     return sse;
   }
-#if CONFIG_HIGHBITDEPTH
   const MACROBLOCKD *xd = &x->e_mbd;
 
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
@@ -443,9 +442,6 @@
                                              visible_cols, visible_rows);
     return (unsigned int)ROUND_POWER_OF_TWO(sse64, (xd->bd - 8) * 2);
   }
-#else
-  (void)x;
-#endif  // CONFIG_HIGHBITDEPTH
   sse = aom_sse_odd_size(src, src_stride, dst, dst_stride, visible_cols,
                          visible_rows);
   return sse;
@@ -698,7 +694,6 @@
 
   if (x->tune_metric == AOM_TUNE_CDEF_DIST ||
       x->tune_metric == AOM_TUNE_DAALA_DIST) {
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
       for (j = 0; j < bsh; j++)
         for (i = 0; i < bsw; i++)
@@ -726,7 +721,6 @@
         }
       }
     } else {
-#endif
       for (j = 0; j < bsh; j++)
         for (i = 0; i < bsw; i++) orig[j * bsw + i] = src[j * src_stride + i];
 
@@ -750,9 +744,7 @@
               rec[j * bsw + i] = src[j * src_stride + i];
         }
       }
-#if CONFIG_HIGHBITDEPTH
     }
-#endif  // CONFIG_HIGHBITDEPTH
   }
 
   if (x->tune_metric == AOM_TUNE_DAALA_DIST) {
@@ -766,10 +758,8 @@
                                  bsw, coeff_shift);
       }
     }
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
       d = ((uint64_t)d) >> 2 * coeff_shift;
-#endif
   } else {
     // Otherwise, MSE by default
     d = pixel_dist_visible_only(cpi, x, src, src_stride, dst, dst_stride,
@@ -797,18 +787,14 @@
 
   if (x->tune_metric == AOM_TUNE_CDEF_DIST ||
       x->tune_metric == AOM_TUNE_DAALA_DIST) {
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
       for (j = 0; j < bsh; j++)
         for (i = 0; i < bsw; i++)
           orig[j * bsw + i] = CONVERT_TO_SHORTPTR(src)[j * src_stride + i];
     } else {
-#endif
       for (j = 0; j < bsh; j++)
         for (i = 0; i < bsw; i++) orig[j * bsw + i] = src[j * src_stride + i];
-#if CONFIG_HIGHBITDEPTH
     }
-#endif  // CONFIG_HIGHBITDEPTH
 
     if ((bsw == visible_w) && (bsh == visible_h)) {
       for (j = 0; j < bsh; j++)
@@ -872,7 +858,6 @@
   if (f_index < 0) {
     const int w_shift = bw == 8 ? 1 : 2;
     const int h_shift = bh == 8 ? 1 : 2;
-#if CONFIG_HIGHBITDEPTH
     if (cpi->common.use_highbitdepth) {
       const uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
       const uint16_t *dst16 = CONVERT_TO_SHORTPTR(dst);
@@ -884,17 +869,13 @@
               (src16[j + i * src_stride] - dst16[j + i * dst_stride]);
         }
     } else {
-#endif  // CONFIG_HIGHBITDEPTH
-
       for (int i = 0; i < bh; ++i)
         for (int j = 0; j < bw; ++j) {
           const int index = (j >> w_shift) + ((i >> h_shift) << 2);
           esq[index] += (src[j + i * src_stride] - dst[j + i * dst_stride]) *
                         (src[j + i * src_stride] - dst[j + i * dst_stride]);
         }
-#if CONFIG_HIGHBITDEPTH
     }
-#endif  // CONFIG_HIGHBITDEPTH
   } else {
     cpi->fn_ptr[f_index].vf(src, src_stride, dst, dst_stride, &esq[0]);
     cpi->fn_ptr[f_index].vf(src + bw / 4, src_stride, dst + bw / 4, dst_stride,
@@ -1470,10 +1451,7 @@
                               int64_t *dist) {
   const struct macroblockd_plane *const pd = &xd->plane[plane];
   const int dequant_shift =
-#if CONFIG_HIGHBITDEPTH
-      (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? xd->bd - 5 :
-#endif  // CONFIG_HIGHBITDEPTH
-                                                    3;
+      (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? xd->bd - 5 : 3;
 
   // Fast approximate the modelling function.
   if (cpi->sf.simple_model_rd_from_var) {
@@ -1571,7 +1549,6 @@
   return error;
 }
 
-#if CONFIG_HIGHBITDEPTH
 int64_t av1_highbd_block_error_c(const tran_low_t *coeff,
                                  const tran_low_t *dqcoeff, intptr_t block_size,
                                  int64_t *ssz, int bd) {
@@ -1597,7 +1574,6 @@
   *ssz = sqcoeff;
   return error;
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 #if !CONFIG_LV_MAP
 static int cost_coeffs(const AV1_COMMON *const cm, MACROBLOCK *x, int plane,
@@ -1625,13 +1601,7 @@
       x->token_tail_costs[tx_size_ctx][type][ref];
   const int seg_eob = av1_get_tx_eob(&cm->seg, mbmi->segment_id, tx_size);
   int8_t eob_val;
-
-#if CONFIG_HIGHBITDEPTH
   const int cat6_bits = av1_get_cat6_extrabits_size(tx_size, xd->bd);
-#else
-  const int cat6_bits = av1_get_cat6_extrabits_size(tx_size, 8);
-#endif  // CONFIG_HIGHBITDEPTH
-
   (void)cm;
 
   if (eob == 0) {
@@ -1867,7 +1837,6 @@
   return n;
 }
 
-#if CONFIG_HIGHBITDEPTH
 int av1_count_colors_highbd(const uint8_t *src8, int stride, int rows, int cols,
                             int bit_depth, int *val_count) {
   assert(bit_depth <= 12);
@@ -1887,7 +1856,6 @@
   }
   return n;
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 void av1_inverse_transform_block_facade(MACROBLOCKD *xd, int plane, int block,
                                         int blk_row, int blk_col, int eob,
@@ -1946,12 +1914,10 @@
     *out_dist = av1_highbd_block_error(coeff, dqcoeff, buffer_length, &this_sse,
                                        xd->bd);
 #else
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
       *out_dist = av1_highbd_block_error(coeff, dqcoeff, buffer_length,
                                          &this_sse, xd->bd);
     else
-#endif
       *out_dist = av1_block_error(coeff, dqcoeff, buffer_length, &this_sse);
 #endif
 
@@ -1983,10 +1949,8 @@
       const int16_t *diff = &p->src_diff[diff_idx];
       *out_sse = pixel_diff_dist(x, plane, diff, diff_stride, blk_row, blk_col,
                                  plane_bsize, tx_bsize);
-#if CONFIG_HIGHBITDEPTH
       if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
         *out_sse = ROUND_POWER_OF_TWO(*out_sse, (xd->bd - 8) * 2);
-#endif  // CONFIG_HIGHBITDEPTH
     }
     *out_sse *= 16;
 
@@ -1995,7 +1959,6 @@
         *out_dist = pixel_dist(cpi, x, plane, src, src_stride, dst, dst_stride,
                                blk_row, blk_col, plane_bsize, tx_bsize);
       } else {
-#if CONFIG_HIGHBITDEPTH
         uint8_t *recon;
         DECLARE_ALIGNED(16, uint16_t, recon16[MAX_TX_SQUARE]);
 
@@ -2003,21 +1966,14 @@
           recon = CONVERT_TO_BYTEPTR(recon16);
         else
           recon = (uint8_t *)recon16;
-#else
-        DECLARE_ALIGNED(16, uint8_t, recon[MAX_TX_SQUARE]);
-#endif  // CONFIG_HIGHBITDEPTH
 
-#if CONFIG_HIGHBITDEPTH
         if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
           aom_highbd_convolve_copy(dst, dst_stride, recon, MAX_TX_SIZE, NULL, 0,
                                    NULL, 0, bsw, bsh, xd->bd);
         } else {
-#endif  // CONFIG_HIGHBITDEPTH
           aom_convolve_copy(dst, dst_stride, recon, MAX_TX_SIZE, NULL, 0, NULL,
                             0, bsw, bsh);
-#if CONFIG_HIGHBITDEPTH
         }
-#endif  // CONFIG_HIGHBITDEPTH
 
         const PLANE_TYPE plane_type = get_plane_type(plane);
         TX_TYPE tx_type =
@@ -2037,20 +1993,16 @@
           int16_t *pred = &pd->pred[pred_idx];
           int i, j;
 
-#if CONFIG_HIGHBITDEPTH
           if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
             for (j = 0; j < bsh; j++)
               for (i = 0; i < bsw; i++)
                 pred[j * pred_stride + i] =
                     CONVERT_TO_SHORTPTR(recon)[j * MAX_TX_SIZE + i];
           } else {
-#endif
             for (j = 0; j < bsh; j++)
               for (i = 0; i < bsw; i++)
                 pred[j * pred_stride + i] = recon[j * MAX_TX_SIZE + i];
-#if CONFIG_HIGHBITDEPTH
           }
-#endif  // CONFIG_HIGHBITDEPTH
         }
 #endif  // CONFIG_DIST_8X8
         *out_dist =
@@ -2126,12 +2078,10 @@
     tmp_dist =
         av1_highbd_block_error(coeff, dqcoeff, buffer_length, &tmp, xd->bd);
 #else
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
       tmp_dist =
           av1_highbd_block_error(coeff, dqcoeff, buffer_length, &tmp, xd->bd);
     else
-#endif
       tmp_dist = av1_block_error(coeff, dqcoeff, buffer_length, &tmp);
 #endif
     tmp_dist = RIGHT_SIGNED_SHIFT(tmp_dist, shift);
@@ -2254,9 +2204,8 @@
                         visible_w, visible_h, qindex);
     dist *= 16;
   } else {
-// For inter mode, the decoded pixels are provided in pd->pred,
-// while the predicted pixels are in dst.
-#if CONFIG_HIGHBITDEPTH
+    // For inter mode, the decoded pixels are provided in pd->pred,
+    // while the predicted pixels are in dst.
     uint8_t *pred8;
     DECLARE_ALIGNED(16, uint16_t, pred16[MAX_SB_SQUARE]);
 
@@ -2264,22 +2213,15 @@
       pred8 = CONVERT_TO_BYTEPTR(pred16);
     else
       pred8 = (uint8_t *)pred16;
-#else
-    DECLARE_ALIGNED(16, uint8_t, pred8[MAX_SB_SQUARE]);
-#endif  // CONFIG_HIGHBITDEPTH
 
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
       for (j = 0; j < bh; j++)
         for (i = 0; i < bw; i++)
           CONVERT_TO_SHORTPTR(pred8)[j * bw + i] = pred[j * bw + i];
     } else {
-#endif
       for (j = 0; j < bh; j++)
         for (i = 0; i < bw; i++) pred8[j * bw + i] = (uint8_t)pred[j * bw + i];
-#if CONFIG_HIGHBITDEPTH
     }
-#endif  // CONFIG_HIGHBITDEPTH
 
     dist = av1_dist_8x8(cpi, x, src, src_stride, pred8, bw, bsize, bw, bh,
                         visible_w, visible_h, qindex);
@@ -2877,13 +2819,11 @@
     return;
   }
   PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
-#if CONFIG_HIGHBITDEPTH
   if (cpi->common.use_highbitdepth)
     for (int i = 0; i < k; ++i)
       pmi->palette_colors[i] =
           clip_pixel_highbd((int)centroids[i], cpi->common.bit_depth);
   else
-#endif  // CONFIG_HIGHBITDEPTH
     for (int i = 0; i < k; ++i)
       pmi->palette_colors[i] = clip_pixel(centroids[i]);
   pmi->palette_size[0] = k;
@@ -2952,12 +2892,10 @@
                            &cols);
 
   int count_buf[1 << 12];  // Maximum (1 << 12) color levels.
-#if CONFIG_HIGHBITDEPTH
   if (cpi->common.use_highbitdepth)
     colors = av1_count_colors_highbd(src, src_stride, rows, cols,
                                      cpi->common.bit_depth, count_buf);
   else
-#endif  // CONFIG_HIGHBITDEPTH
     colors = av1_count_colors(src, src_stride, rows, cols, count_buf);
 #if CONFIG_FILTER_INTRA
   mbmi->filter_intra_mode_info.use_filter_intra = 0;
@@ -2969,15 +2907,12 @@
     int *const data = x->palette_buffer->kmeans_data_buf;
     int centroids[PALETTE_MAX_SIZE];
     int lb, ub, val;
-#if CONFIG_HIGHBITDEPTH
     uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
     if (cpi->common.use_highbitdepth)
       lb = ub = src16[0];
     else
-#endif  // CONFIG_HIGHBITDEPTH
       lb = ub = src[0];
 
-#if CONFIG_HIGHBITDEPTH
     if (cpi->common.use_highbitdepth) {
       for (r = 0; r < rows; ++r) {
         for (c = 0; c < cols; ++c) {
@@ -2990,7 +2925,6 @@
         }
       }
     } else {
-#endif  // CONFIG_HIGHBITDEPTH
       for (r = 0; r < rows; ++r) {
         for (c = 0; c < cols; ++c) {
           val = src[r * src_stride + c];
@@ -3001,9 +2935,7 @@
             ub = val;
         }
       }
-#if CONFIG_HIGHBITDEPTH
     }
-#endif  // CONFIG_HIGHBITDEPTH
 
     mbmi->mode = DC_PRED;
 #if CONFIG_FILTER_INTRA
@@ -3341,7 +3273,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 static void highbd_angle_estimation(const uint8_t *src8, int src_stride,
                                     int rows, int cols, BLOCK_SIZE bsize,
                                     uint8_t *directional_mode_skip_mask) {
@@ -3396,7 +3327,6 @@
     }
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // CONFIG_EXT_INTRA
 
 // This function is used only for intra_only frames
@@ -3444,12 +3374,10 @@
 
 #if CONFIG_EXT_INTRA
   mbmi->angle_delta[0] = 0;
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
     highbd_angle_estimation(src, src_stride, rows, cols, bsize,
                             directional_mode_skip_mask);
   else
-#endif  // CONFIG_HIGHBITDEPTH
     angle_estimation(src, src_stride, rows, cols, bsize,
                      directional_mode_skip_mask);
 #endif  // CONFIG_EXT_INTRA
@@ -3668,12 +3596,8 @@
   uint8_t *dst =
       &pd->dst
            .buf[(blk_row * pd->dst.stride + blk_col) << tx_size_wide_log2[0]];
-#if CONFIG_HIGHBITDEPTH
   DECLARE_ALIGNED(16, uint16_t, rec_buffer16[MAX_TX_SQUARE]);
   uint8_t *rec_buffer;
-#else
-  DECLARE_ALIGNED(16, uint8_t, rec_buffer[MAX_TX_SQUARE]);
-#endif  // CONFIG_HIGHBITDEPTH
   const int diff_stride = block_size_wide[plane_bsize];
   const int16_t *diff =
       &p->src_diff[(blk_row * diff_stride + blk_col) << tx_size_wide_log2[0]];
@@ -3695,10 +3619,8 @@
   tmp = pixel_diff_dist(x, plane, diff, diff_stride, blk_row, blk_col,
                         plane_bsize, txm_bsize);
 
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
     tmp = ROUND_POWER_OF_TWO(tmp, (xd->bd - 8) * 2);
-#endif  // CONFIG_HIGHBITDEPTH
 
   rd_stats->sse += tmp << 4;
 
@@ -3728,8 +3650,7 @@
   int cur_rate = 0;
   uint8_t cur_skip = 1;
 
-// TODO(any): Use av1_dist_block to compute distortion
-#if CONFIG_HIGHBITDEPTH
+  // TODO(any): Use av1_dist_block to compute distortion
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     rec_buffer = CONVERT_TO_BYTEPTR(rec_buffer16);
     aom_highbd_convolve_copy(dst, pd->dst.stride, rec_buffer, MAX_TX_SIZE, NULL,
@@ -3739,10 +3660,6 @@
     aom_convolve_copy(dst, pd->dst.stride, rec_buffer, MAX_TX_SIZE, NULL, 0,
                       NULL, 0, bw, bh);
   }
-#else
-  aom_convolve_copy(dst, pd->dst.stride, rec_buffer, MAX_TX_SIZE, NULL, 0, NULL,
-                    0, bw, bh);
-#endif  // CONFIG_HIGHBITDEPTH
 
   if (cpi->sf.optimize_coefficients == FINAL_PASS_TRELLIS_OPT) {
     av1_xform_quant(cm, x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
@@ -3775,12 +3692,10 @@
     tmp_dist =
         av1_highbd_block_error(coeff, dqcoeff, buffer_length, &tmp_sse, xd->bd);
 #else
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
       tmp_dist = av1_highbd_block_error(coeff, dqcoeff, buffer_length, &tmp_sse,
                                         xd->bd);
     else
-#endif
       tmp_dist = av1_block_error(coeff, dqcoeff, buffer_length, &tmp_sse);
 #endif
 
@@ -3818,20 +3733,16 @@
       int16_t *decoded = &pd->pred[pred_idx];
       int i, j;
 
-#if CONFIG_HIGHBITDEPTH
       if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
         for (j = 0; j < bh; j++)
           for (i = 0; i < bw; i++)
             decoded[j * pred_stride + i] =
                 CONVERT_TO_SHORTPTR(rec_buffer)[j * MAX_TX_SIZE + i];
       } else {
-#endif
         for (j = 0; j < bh; j++)
           for (i = 0; i < bw; i++)
             decoded[j * pred_stride + i] = rec_buffer[j * MAX_TX_SIZE + i];
-#if CONFIG_HIGHBITDEPTH
       }
-#endif  // CONFIG_HIGHBITDEPTH
     }
 #endif  // CONFIG_DIST_8X8
     tmp = pixel_dist(cpi, x, plane, src, src_stride, rec_buffer, MAX_TX_SIZE,
@@ -4043,12 +3954,8 @@
       int i, j;
       int row, col;
 
-#if CONFIG_HIGHBITDEPTH
       uint8_t *pred8;
       DECLARE_ALIGNED(16, uint16_t, pred8_16[8 * 8]);
-#else
-      DECLARE_ALIGNED(16, uint8_t, pred8[8 * 8]);
-#endif  // CONFIG_HIGHBITDEPTH
 
       dist_8x8 = av1_dist_8x8(cpi, x, src, src_stride, dst, dst_stride,
                               BLOCK_8X8, 8, 8, 8, 8, qindex) *
@@ -4057,14 +3964,11 @@
         assert(sum_rd_stats.sse == dist_8x8);
       sum_rd_stats.sse = dist_8x8;
 
-#if CONFIG_HIGHBITDEPTH
       if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
         pred8 = CONVERT_TO_BYTEPTR(pred8_16);
       else
         pred8 = (uint8_t *)pred8_16;
-#endif
 
-#if CONFIG_HIGHBITDEPTH
       if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
         for (row = 0; row < 2; ++row) {
           for (col = 0; col < 2; ++col) {
@@ -4087,7 +3991,6 @@
           }
         }
       } else {
-#endif
         for (row = 0; row < 2; ++row) {
           for (col = 0; col < 2; ++col) {
             int idx = row * 2 + col;
@@ -4106,9 +4009,7 @@
             }
           }
         }
-#if CONFIG_HIGHBITDEPTH
       }
-#endif  // CONFIG_HIGHBITDEPTH
       dist_8x8 = av1_dist_8x8(cpi, x, src, src_stride, pred8, 8, BLOCK_8X8, 8,
                               8, 8, 8, qindex) *
                  16;
@@ -4842,10 +4743,8 @@
   }
 #endif  // CONFIG_TXK_SEL
   rd_stats->rate = rate;
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
     dist = ROUND_POWER_OF_TWO(dist, (xd->bd - 8) * 2);
-#endif  // CONFIG_HIGHBITDEPTH
   rd_stats->dist = rd_stats->sse = (dist << 4);
 }
 
@@ -5159,19 +5058,15 @@
   mbmi->uv_mode = UV_DC_PRED;
 
   int count_buf[1 << 12];  // Maximum (1 << 12) color levels.
-#if CONFIG_HIGHBITDEPTH
   if (cpi->common.use_highbitdepth) {
     colors_u = av1_count_colors_highbd(src_u, src_stride, rows, cols,
                                        cpi->common.bit_depth, count_buf);
     colors_v = av1_count_colors_highbd(src_v, src_stride, rows, cols,
                                        cpi->common.bit_depth, count_buf);
   } else {
-#endif  // CONFIG_HIGHBITDEPTH
     colors_u = av1_count_colors(src_u, src_stride, rows, cols, count_buf);
     colors_v = av1_count_colors(src_v, src_stride, rows, cols, count_buf);
-#if CONFIG_HIGHBITDEPTH
   }
-#endif  // CONFIG_HIGHBITDEPTH
 
   uint16_t color_cache[2 * PALETTE_MAX_SIZE];
   const int n_cache = av1_get_palette_cache(xd, 1, color_cache);
@@ -5185,7 +5080,6 @@
     int *const data = x->palette_buffer->kmeans_data_buf;
     int centroids[2 * PALETTE_MAX_SIZE];
 
-#if CONFIG_HIGHBITDEPTH
     uint16_t *src_u16 = CONVERT_TO_SHORTPTR(src_u);
     uint16_t *src_v16 = CONVERT_TO_SHORTPTR(src_v);
     if (cpi->common.use_highbitdepth) {
@@ -5194,32 +5088,25 @@
       lb_v = src_v16[0];
       ub_v = src_v16[0];
     } else {
-#endif  // CONFIG_HIGHBITDEPTH
       lb_u = src_u[0];
       ub_u = src_u[0];
       lb_v = src_v[0];
       ub_v = src_v[0];
-#if CONFIG_HIGHBITDEPTH
     }
-#endif  // CONFIG_HIGHBITDEPTH
 
     for (r = 0; r < rows; ++r) {
       for (c = 0; c < cols; ++c) {
-#if CONFIG_HIGHBITDEPTH
         if (cpi->common.use_highbitdepth) {
           val_u = src_u16[r * src_stride + c];
           val_v = src_v16[r * src_stride + c];
           data[(r * cols + c) * 2] = val_u;
           data[(r * cols + c) * 2 + 1] = val_v;
         } else {
-#endif  // CONFIG_HIGHBITDEPTH
           val_u = src_u[r * src_stride + c];
           val_v = src_v[r * src_stride + c];
           data[(r * cols + c) * 2] = val_u;
           data[(r * cols + c) * 2 + 1] = val_v;
-#if CONFIG_HIGHBITDEPTH
         }
-#endif  // CONFIG_HIGHBITDEPTH
         if (val_u < lb_u)
           lb_u = val_u;
         else if (val_u > ub_u)
@@ -5258,12 +5145,10 @@
       pmi->palette_size[1] = n;
       for (i = 1; i < 3; ++i) {
         for (j = 0; j < n; ++j) {
-#if CONFIG_HIGHBITDEPTH
           if (cpi->common.use_highbitdepth)
             pmi->palette_colors[i * PALETTE_MAX_SIZE + j] = clip_pixel_highbd(
                 (int)centroids[j * 2 + i - 1], cpi->common.bit_depth);
           else
-#endif  // CONFIG_HIGHBITDEPTH
             pmi->palette_colors[i * PALETTE_MAX_SIZE + j] =
                 clip_pixel((int)centroids[j * 2 + i - 1]);
         }
@@ -5867,13 +5752,9 @@
     av1_get_scaled_ref_frame(cpi, refs[1])
   };
 
-// Prediction buffer from second frame.
-#if CONFIG_HIGHBITDEPTH
+  // Prediction buffer from second frame.
   DECLARE_ALIGNED(16, uint16_t, second_pred_alloc_16[MAX_SB_SQUARE]);
   uint8_t *second_pred;
-#else   // CONFIG_HIGHBITDEPTH
-  DECLARE_ALIGNED(16, uint8_t, second_pred[MAX_SB_SQUARE]);
-#endif  // CONFIG_HIGHBITDEPTH
   (void)ref_mv_sub8x8;
 
   for (ref = 0; ref < 2; ++ref) {
@@ -5891,15 +5772,10 @@
     }
   }
 
-// Since we have scaled the reference frames to match the size of the current
-// frame we must use a unit scaling factor during mode selection.
-#if CONFIG_HIGHBITDEPTH
+  // Since we have scaled the reference frames to match the size of the current
+  // frame we must use a unit scaling factor during mode selection.
   av1_setup_scale_factors_for_frame(&sf, cm->width, cm->height, cm->width,
                                     cm->height, cm->use_highbitdepth);
-#else
-  av1_setup_scale_factors_for_frame(&sf, cm->width, cm->height, cm->width,
-                                    cm->height);
-#endif  // CONFIG_HIGHBITDEPTH
 
   // Allow joint search multiple times iteratively for each reference frame
   // and break out of the search loop if it couldn't find a better mv.
@@ -5932,7 +5808,6 @@
     InterpFilters interp_filters = EIGHTTAP_REGULAR;
 #endif  // CONFIG_JNT_COMP
 
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
       second_pred = CONVERT_TO_BYTEPTR(second_pred_alloc_16);
       av1_highbd_build_inter_predictor(
@@ -5947,20 +5822,17 @@
           mi_row * MI_SIZE, xd);
     } else {
       second_pred = (uint8_t *)second_pred_alloc_16;
-#endif  // CONFIG_HIGHBITDEPTH
       av1_build_inter_predictor(ref_yv12[!id].buf, ref_yv12[!id].stride,
                                 second_pred, pw, &frame_mv[refs[!id]].as_mv,
 #if CONFIG_JNT_COMP
                                 &sf, pw, ph, &conv_params, interp_filters,
 #else
-                              &sf, pw, ph, &conv_params, mbmi->interp_filters,
+                                &sf, pw, ph, &conv_params, mbmi->interp_filters,
 #endif  // CONFIG_JNT_COMP
                                 &warp_types, p_col, p_row, plane, !id,
                                 MV_PRECISION_Q3, mi_col * MI_SIZE,
                                 mi_row * MI_SIZE, xd);
-#if CONFIG_HIGHBITDEPTH
     }
-#endif  // CONFIG_HIGHBITDEPTH
 
 #if CONFIG_JNT_COMP
     const int order_idx = id != 0;
@@ -6577,15 +6449,10 @@
     av1_setup_pre_planes(xd, !ref_idx, scaled_ref_frame, mi_row, mi_col, NULL);
   }
 
-// Since we have scaled the reference frames to match the size of the current
-// frame we must use a unit scaling factor during mode selection.
-#if CONFIG_HIGHBITDEPTH
+  // Since we have scaled the reference frames to match the size of the current
+  // frame we must use a unit scaling factor during mode selection.
   av1_setup_scale_factors_for_frame(&sf, cm->width, cm->height, cm->width,
                                     cm->height, cm->use_highbitdepth);
-#else
-  av1_setup_scale_factors_for_frame(&sf, cm->width, cm->height, cm->width,
-                                    cm->height);
-#endif  // CONFIG_HIGHBITDEPTH
 
   struct buf_2d ref_yv12;
 
@@ -6598,22 +6465,18 @@
   // Initialized here because of compiler problem in Visual Studio.
   ref_yv12 = xd->plane[plane].pre[!ref_idx];
 
-// Get the prediction block from the 'other' reference frame.
-#if CONFIG_HIGHBITDEPTH
+  // Get the prediction block from the 'other' reference frame.
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     av1_highbd_build_inter_predictor(
         ref_yv12.buf, ref_yv12.stride, second_pred, pw, other_mv, &sf, pw, ph,
         0, mbmi->interp_filters, &warp_types, p_col, p_row, plane,
         MV_PRECISION_Q3, mi_col * MI_SIZE, mi_row * MI_SIZE, xd);
   } else {
-#endif  // CONFIG_HIGHBITDEPTH
     av1_build_inter_predictor(
         ref_yv12.buf, ref_yv12.stride, second_pred, pw, other_mv, &sf, pw, ph,
         &conv_params, mbmi->interp_filters, &warp_types, p_col, p_row, plane,
         !ref_idx, MV_PRECISION_Q3, mi_col * MI_SIZE, mi_row * MI_SIZE, xd);
-#if CONFIG_HIGHBITDEPTH
   }
-#endif  // CONFIG_HIGHBITDEPTH
 
 #if CONFIG_JNT_COMP
   av1_jnt_comp_weight_assign(cm, mbmi, 0, &xd->jcp_param.fwd_offset,
@@ -6759,17 +6622,13 @@
   // This function should only ever be called for compound modes
   assert(has_second_ref(mbmi));
 
-// Prediction buffer from second frame.
-#if CONFIG_HIGHBITDEPTH
+  // Prediction buffer from second frame.
   DECLARE_ALIGNED(16, uint16_t, second_pred_alloc_16[MAX_SB_SQUARE]);
   uint8_t *second_pred;
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
     second_pred = CONVERT_TO_BYTEPTR(second_pred_alloc_16);
   else
     second_pred = (uint8_t *)second_pred_alloc_16;
-#else
-  DECLARE_ALIGNED(16, uint8_t, second_pred[MAX_SB_SQUARE]);
-#endif  // CONFIG_HIGHBITDEPTH
 
   MV *this_mv = &frame_mv[mbmi->ref_frame[ref_idx]].as_mv;
   const MV *other_mv = &frame_mv[mbmi->ref_frame[!ref_idx]].as_mv;
@@ -6854,12 +6713,10 @@
   uint32_t esq[2][4];
   int64_t tl, br;
 
-#if CONFIG_HIGHBITDEPTH
   if (x->e_mbd.cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     pred0 = CONVERT_TO_BYTEPTR(pred0);
     pred1 = CONVERT_TO_BYTEPTR(pred1);
   }
-#endif  // CONFIG_HIGHBITDEPTH
 
   cpi->fn_ptr[f_index].vf(src, src_stride, pred0, stride0, &esq[0][0]);
   cpi->fn_ptr[f_index].vf(src + bw / 2, src_stride, pred0 + bw / 2, stride0,
@@ -6988,12 +6845,8 @@
   int wedge_types = (1 << get_wedge_bits_lookup(bsize));
   const uint8_t *mask;
   uint64_t sse;
-#if CONFIG_HIGHBITDEPTH
   const int hbd = xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH;
   const int bd_round = hbd ? (xd->bd - 8) * 2 : 0;
-#else
-  const int bd_round = 0;
-#endif  // CONFIG_HIGHBITDEPTH
 
   DECLARE_ALIGNED(32, int16_t, r0[MAX_SB_SQUARE]);
   DECLARE_ALIGNED(32, int16_t, r1[MAX_SB_SQUARE]);
@@ -7002,7 +6855,6 @@
 
   int64_t sign_limit;
 
-#if CONFIG_HIGHBITDEPTH
   if (hbd) {
     aom_highbd_subtract_block(bh, bw, r0, bw, src->buf, src->stride,
                               CONVERT_TO_BYTEPTR(p0), bw, xd->bd);
@@ -7010,9 +6862,7 @@
                               CONVERT_TO_BYTEPTR(p1), bw, xd->bd);
     aom_highbd_subtract_block(bh, bw, d10, bw, CONVERT_TO_BYTEPTR(p1), bw,
                               CONVERT_TO_BYTEPTR(p0), bw, xd->bd);
-  } else  // NOLINT
-#endif    // CONFIG_HIGHBITDEPTH
-  {
+  } else {
     aom_subtract_block(bh, bw, r0, bw, src->buf, src->stride, p0, bw);
     aom_subtract_block(bh, bw, r1, bw, src->buf, src->stride, p1, bw);
     aom_subtract_block(bh, bw, d10, bw, p1, bw, p0, bw);
@@ -7073,25 +6923,18 @@
   int wedge_types = (1 << get_wedge_bits_lookup(bsize));
   const uint8_t *mask;
   uint64_t sse;
-#if CONFIG_HIGHBITDEPTH
   const int hbd = xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH;
   const int bd_round = hbd ? (xd->bd - 8) * 2 : 0;
-#else
-  const int bd_round = 0;
-#endif  // CONFIG_HIGHBITDEPTH
 
   DECLARE_ALIGNED(32, int16_t, r1[MAX_SB_SQUARE]);
   DECLARE_ALIGNED(32, int16_t, d10[MAX_SB_SQUARE]);
 
-#if CONFIG_HIGHBITDEPTH
   if (hbd) {
     aom_highbd_subtract_block(bh, bw, r1, bw, src->buf, src->stride,
                               CONVERT_TO_BYTEPTR(p1), bw, xd->bd);
     aom_highbd_subtract_block(bh, bw, d10, bw, CONVERT_TO_BYTEPTR(p1), bw,
                               CONVERT_TO_BYTEPTR(p0), bw, xd->bd);
-  } else  // NOLINT
-#endif    // CONFIG_HIGHBITDEPTH
-  {
+  } else {
     aom_subtract_block(bh, bw, r1, bw, src->buf, src->stride, p1, bw);
     aom_subtract_block(bh, bw, d10, bw, p1, bw, p0, bw);
   }
@@ -7161,17 +7004,12 @@
   SEG_MASK_TYPE cur_mask_type;
   int64_t best_rd = INT64_MAX;
   SEG_MASK_TYPE best_mask_type = 0;
-#if CONFIG_HIGHBITDEPTH
   const int hbd = xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH;
   const int bd_round = hbd ? (xd->bd - 8) * 2 : 0;
-#else
-  const int bd_round = 0;
-#endif  // CONFIG_HIGHBITDEPTH
   DECLARE_ALIGNED(32, int16_t, r0[MAX_SB_SQUARE]);
   DECLARE_ALIGNED(32, int16_t, r1[MAX_SB_SQUARE]);
   DECLARE_ALIGNED(32, int16_t, d10[MAX_SB_SQUARE]);
 
-#if CONFIG_HIGHBITDEPTH
   if (hbd) {
     aom_highbd_subtract_block(bh, bw, r0, bw, src->buf, src->stride,
                               CONVERT_TO_BYTEPTR(p0), bw, xd->bd);
@@ -7179,9 +7017,7 @@
                               CONVERT_TO_BYTEPTR(p1), bw, xd->bd);
     aom_highbd_subtract_block(bh, bw, d10, bw, CONVERT_TO_BYTEPTR(p1), bw,
                               CONVERT_TO_BYTEPTR(p0), bw, xd->bd);
-  } else  // NOLINT
-#endif    // CONFIG_HIGHBITDEPTH
-  {
+  } else {
     aom_subtract_block(bh, bw, r0, bw, src->buf, src->stride, p0, bw);
     aom_subtract_block(bh, bw, r1, bw, src->buf, src->stride, p1, bw);
     aom_subtract_block(bh, bw, d10, bw, p1, bw, p0, bw);
@@ -7189,14 +7025,12 @@
 
   // try each mask type and its inverse
   for (cur_mask_type = 0; cur_mask_type < SEG_MASK_TYPES; cur_mask_type++) {
-// build mask and inverse
-#if CONFIG_HIGHBITDEPTH
+    // build mask and inverse
     if (hbd)
       build_compound_seg_mask_highbd(
           xd->seg_mask, cur_mask_type, CONVERT_TO_BYTEPTR(p0), bw,
           CONVERT_TO_BYTEPTR(p1), bw, bsize, bh, bw, xd->bd);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       build_compound_seg_mask(xd->seg_mask, cur_mask_type, p0, bw, p1, bw,
                               bsize, bh, bw);
 
@@ -7215,13 +7049,11 @@
 
   // make final mask
   mbmi->mask_type = best_mask_type;
-#if CONFIG_HIGHBITDEPTH
   if (hbd)
     build_compound_seg_mask_highbd(
         xd->seg_mask, mbmi->mask_type, CONVERT_TO_BYTEPTR(p0), bw,
         CONVERT_TO_BYTEPTR(p1), bw, bsize, bh, bw, xd->bd);
   else
-#endif  // CONFIG_HIGHBITDEPTH
     build_compound_seg_mask(xd->seg_mask, mbmi->mask_type, p0, bw, p1, bw,
                             bsize, bh, bw);
 
@@ -8042,11 +7874,7 @@
       x->interintra_mode_cost[size_group_lookup[bsize]];
   const int is_comp_interintra_pred = (mbmi->ref_frame[1] == INTRA_FRAME);
   uint8_t ref_frame_type = av1_ref_frame_type(mbmi->ref_frame);
-#if CONFIG_HIGHBITDEPTH
   DECLARE_ALIGNED(16, uint8_t, tmp_buf_[2 * MAX_MB_PLANE * MAX_SB_SQUARE]);
-#else
-  DECLARE_ALIGNED(16, uint8_t, tmp_buf_[MAX_MB_PLANE * MAX_SB_SQUARE]);
-#endif  // CONFIG_HIGHBITDEPTH
   uint8_t *tmp_buf;
 
   int rate2_bmc_nocoeff;
@@ -8079,11 +7907,9 @@
     mode_ctx =
         av1_mode_context_analyzer(mbmi_ext->mode_context, mbmi->ref_frame);
 
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
     tmp_buf = CONVERT_TO_BYTEPTR(tmp_buf_);
   else
-#endif  // CONFIG_HIGHBITDEPTH
     tmp_buf = tmp_buf_;
   // Make sure that we didn't leave the plane destination buffers set
   // to tmp_buf at the end of the last iteration
@@ -8425,11 +8251,9 @@
     DECLARE_ALIGNED(16, uint8_t, intrapred_[2 * MAX_SB_SQUARE]);
     uint8_t *intrapred;
 
-#if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
       intrapred = CONVERT_TO_BYTEPTR(intrapred_);
     else
-#endif  // CONFIG_HIGHBITDEPTH
       intrapred = intrapred_;
 
     mbmi->ref_frame[1] = NONE_FRAME;
@@ -8953,10 +8777,8 @@
   int centroids[2 * PALETTE_MAX_SIZE];
   uint8_t *const color_map = xd->plane[1].color_index_map;
   int r, c;
-#if CONFIG_HIGHBITDEPTH
   const uint16_t *const src_u16 = CONVERT_TO_SHORTPTR(src_u);
   const uint16_t *const src_v16 = CONVERT_TO_SHORTPTR(src_v);
-#endif  // CONFIG_HIGHBITDEPTH
   int plane_block_width, plane_block_height, rows, cols;
   av1_get_block_dimensions(bsize, 1, xd, &plane_block_width,
                            &plane_block_height, &rows, &cols);
@@ -8964,17 +8786,13 @@
 
   for (r = 0; r < rows; ++r) {
     for (c = 0; c < cols; ++c) {
-#if CONFIG_HIGHBITDEPTH
       if (cpi->common.use_highbitdepth) {
         data[(r * cols + c) * 2] = src_u16[r * src_stride + c];
         data[(r * cols + c) * 2 + 1] = src_v16[r * src_stride + c];
       } else {
-#endif  // CONFIG_HIGHBITDEPTH
         data[(r * cols + c) * 2] = src_u[r * src_stride + c];
         data[(r * cols + c) * 2 + 1] = src_v[r * src_stride + c];
-#if CONFIG_HIGHBITDEPTH
       }
-#endif  // CONFIG_HIGHBITDEPTH
     }
   }
 
@@ -9219,7 +9037,6 @@
   memset(dist_refs, -1, sizeof(dist_refs));
   memset(dist_order_refs, -1, sizeof(dist_order_refs));
 
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     int len = sizeof(uint16_t);
     args.above_pred_buf[0] = CONVERT_TO_BYTEPTR(x->above_pred_buf);
@@ -9233,16 +9050,13 @@
     args.left_pred_buf[2] =
         CONVERT_TO_BYTEPTR(x->left_pred_buf + 2 * MAX_SB_SQUARE * len);
   } else {
-#endif  // CONFIG_HIGHBITDEPTH
     args.above_pred_buf[0] = x->above_pred_buf;
     args.above_pred_buf[1] = x->above_pred_buf + MAX_SB_SQUARE;
     args.above_pred_buf[2] = x->above_pred_buf + 2 * MAX_SB_SQUARE;
     args.left_pred_buf[0] = x->left_pred_buf;
     args.left_pred_buf[1] = x->left_pred_buf + MAX_SB_SQUARE;
     args.left_pred_buf[2] = x->left_pred_buf + 2 * MAX_SB_SQUARE;
-#if CONFIG_HIGHBITDEPTH
   }
-#endif  // CONFIG_HIGHBITDEPTH
 
   av1_zero(best_mbmode);
 
@@ -9712,12 +9526,10 @@
         if (!angle_stats_ready) {
           const int src_stride = x->plane[0].src.stride;
           const uint8_t *src = x->plane[0].src.buf;
-#if CONFIG_HIGHBITDEPTH
           if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
             highbd_angle_estimation(src, src_stride, rows, cols, bsize,
                                     directional_mode_skip_mask);
           else
-#endif  // CONFIG_HIGHBITDEPTH
             angle_estimation(src, src_stride, rows, cols, bsize,
                              directional_mode_skip_mask);
           angle_stats_ready = 1;
@@ -11014,11 +10826,7 @@
   struct calc_target_weighted_pred_ctxt *ctxt =
       (struct calc_target_weighted_pred_ctxt *)fun_ctxt;
 
-#if CONFIG_HIGHBITDEPTH
   const int is_hbd = (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? 1 : 0;
-#else
-  const int is_hbd = 0;
-#endif  // CONFIG_HIGHBITDEPTH
 
   const int bw = xd->n8_w << MI_SIZE_LOG2;
   const uint8_t *const mask1d = av1_get_obmc_mask(ctxt->overlap);
@@ -11039,7 +10847,6 @@
       mask += bw;
       tmp += ctxt->tmp_stride;
     }
-#if CONFIG_HIGHBITDEPTH
   } else {
     const uint16_t *tmp16 = CONVERT_TO_SHORTPTR(tmp);
 
@@ -11054,7 +10861,6 @@
       mask += bw;
       tmp16 += ctxt->tmp_stride;
     }
-#endif  // CONFIG_HIGHBITDEPTH
   }
 }
 
@@ -11068,11 +10874,7 @@
   struct calc_target_weighted_pred_ctxt *ctxt =
       (struct calc_target_weighted_pred_ctxt *)fun_ctxt;
 
-#if CONFIG_HIGHBITDEPTH
   const int is_hbd = (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? 1 : 0;
-#else
-  const int is_hbd = 0;
-#endif  // CONFIG_HIGHBITDEPTH
 
   const int bw = xd->n8_w << MI_SIZE_LOG2;
   const uint8_t *const mask1d = av1_get_obmc_mask(ctxt->overlap);
@@ -11094,7 +10896,6 @@
       mask += bw;
       tmp += ctxt->tmp_stride;
     }
-#if CONFIG_HIGHBITDEPTH
   } else {
     const uint16_t *tmp16 = CONVERT_TO_SHORTPTR(tmp);
 
@@ -11110,7 +10911,6 @@
       mask += bw;
       tmp16 += ctxt->tmp_stride;
     }
-#endif  // CONFIG_HIGHBITDEPTH
   }
 }
 
@@ -11164,11 +10964,7 @@
   int32_t *wsrc_buf = x->wsrc_buf;
 
   const int src_scale = AOM_BLEND_A64_MAX_ALPHA * AOM_BLEND_A64_MAX_ALPHA;
-#if CONFIG_HIGHBITDEPTH
   const int is_hbd = (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? 1 : 0;
-#else
-  const int is_hbd = 0;
-#endif  // CONFIG_HIGHBITDEPTH
 
   // plane 0 should not be subsampled
   assert(xd->plane[0].subsampling_x == 0);
@@ -11214,7 +11010,6 @@
       wsrc_buf += bw;
       src += x->plane[0].src.stride;
     }
-#if CONFIG_HIGHBITDEPTH
   } else {
     const uint16_t *src = CONVERT_TO_SHORTPTR(x->plane[0].src.buf);
 
@@ -11225,6 +11020,5 @@
       wsrc_buf += bw;
       src += x->plane[0].src.stride;
     }
-#endif  // CONFIG_HIGHBITDEPTH
   }
 }
diff --git a/av1/encoder/rdopt.h b/av1/encoder/rdopt.h
index 5a54855..69a9025 100644
--- a/av1/encoder/rdopt.h
+++ b/av1/encoder/rdopt.h
@@ -65,11 +65,9 @@
 // Returns the number of colors in 'src'.
 int av1_count_colors(const uint8_t *src, int stride, int rows, int cols,
                      int *val_count);
-#if CONFIG_HIGHBITDEPTH
 // Same as av1_count_colors(), but for high-bitdepth mode.
 int av1_count_colors_highbd(const uint8_t *src8, int stride, int rows, int cols,
                             int bit_depth, int *val_count);
-#endif  // CONFIG_HIGHBITDEPTH
 
 void av1_dist_block(const struct AV1_COMP *cpi, MACROBLOCK *x, int plane,
                     BLOCK_SIZE plane_bsize, int block, int blk_row, int blk_col,
@@ -95,11 +93,9 @@
 unsigned int av1_get_sby_perpixel_variance(const struct AV1_COMP *cpi,
                                            const struct buf_2d *ref,
                                            BLOCK_SIZE bs);
-#if CONFIG_HIGHBITDEPTH
 unsigned int av1_high_get_sby_perpixel_variance(const struct AV1_COMP *cpi,
                                                 const struct buf_2d *ref,
                                                 BLOCK_SIZE bs, int bd);
-#endif
 
 void av1_rd_pick_inter_mode_sb(const struct AV1_COMP *cpi,
                                struct TileDataEnc *tile_data,
diff --git a/av1/encoder/temporal_filter.c b/av1/encoder/temporal_filter.c
index 30453e3..94ad0ab 100644
--- a/av1/encoder/temporal_filter.c
+++ b/av1/encoder/temporal_filter.c
@@ -62,7 +62,6 @@
     mv_precision_uv = MV_PRECISION_Q3;
   }
 
-#if CONFIG_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     av1_highbd_build_inter_predictor(
         y_mb_ptr, stride, &pred[0], 16, &mv, scale, 16, 16, which_mv,
@@ -79,7 +78,6 @@
         x, y, 2, mv_precision_uv, x, y, xd);
     return;
   }
-#endif  // CONFIG_HIGHBITDEPTH
   av1_build_inter_predictor(y_mb_ptr, stride, &pred[0], 16, &mv, scale, 16, 16,
                             &conv_params, interp_filters, &warp_types, x, y, 0,
                             0, MV_PRECISION_Q3, x, y, xd);
@@ -156,7 +154,6 @@
   }
 }
 
-#if CONFIG_HIGHBITDEPTH
 void av1_highbd_temporal_filter_apply_c(
     uint8_t *frame1_8, unsigned int stride, uint8_t *frame2_8,
     unsigned int block_width, unsigned int block_height, int strength,
@@ -218,7 +215,6 @@
     byte += stride - block_width;
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 static int temporal_filter_find_matching_mb_c(AV1_COMP *cpi,
                                               uint8_t *arf_frame_buf,
@@ -321,26 +317,20 @@
   MACROBLOCKD *mbd = &cpi->td.mb.e_mbd;
   YV12_BUFFER_CONFIG *f = frames[alt_ref_index];
   uint8_t *dst1, *dst2;
-#if CONFIG_HIGHBITDEPTH
   DECLARE_ALIGNED(16, uint16_t, predictor16[16 * 16 * 3]);
   DECLARE_ALIGNED(16, uint8_t, predictor8[16 * 16 * 3]);
   uint8_t *predictor;
-#else
-  DECLARE_ALIGNED(16, uint8_t, predictor[16 * 16 * 3]);
-#endif
   const int mb_uv_height = 16 >> mbd->plane[1].subsampling_y;
   const int mb_uv_width = 16 >> mbd->plane[1].subsampling_x;
 
   // Save input state
   uint8_t *input_buffer[MAX_MB_PLANE];
   int i;
-#if CONFIG_HIGHBITDEPTH
   if (mbd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     predictor = CONVERT_TO_BYTEPTR(predictor16);
   } else {
     predictor = predictor8;
   }
-#endif
 
   for (i = 0; i < MAX_MB_PLANE; i++) input_buffer[i] = mbd->plane[i].pre[0].buf;
 
@@ -406,8 +396,7 @@
               mbd->mi[0]->mbmi.mv[0].as_mv.col, predictor, scale, mb_col * 16,
               mb_row * 16);
 
-// Apply the filter (YUV)
-#if CONFIG_HIGHBITDEPTH
+          // Apply the filter (YUV)
           if (mbd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
             int adj_strength = strength + 2 * (mbd->bd - 8);
             av1_highbd_temporal_filter_apply(
@@ -422,7 +411,6 @@
                 mb_uv_width, mb_uv_height, adj_strength, filter_weight,
                 accumulator + 512, count + 512);
           } else {
-#endif  // CONFIG_HIGHBITDEPTH
             av1_temporal_filter_apply_c(f->y_buffer + mb_y_offset, f->y_stride,
                                         predictor, 16, 16, strength,
                                         filter_weight, accumulator, count);
@@ -434,14 +422,11 @@
                 f->v_buffer + mb_uv_offset, f->uv_stride, predictor + 512,
                 mb_uv_width, mb_uv_height, strength, filter_weight,
                 accumulator + 512, count + 512);
-#if CONFIG_HIGHBITDEPTH
           }
-#endif  // CONFIG_HIGHBITDEPTH
         }
       }
 
-// Normalize filter output to produce AltRef frame
-#if CONFIG_HIGHBITDEPTH
+      // Normalize filter output to produce AltRef frame
       if (mbd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
         uint16_t *dst1_16;
         uint16_t *dst2_16;
@@ -494,13 +479,12 @@
           byte += stride - mb_uv_width;
         }
       } else {
-#endif  // CONFIG_HIGHBITDEPTH
 #if CONFIG_BGSPRITE
         dst1 = target->y_buffer;
         stride = target->y_stride;
 #else
-      dst1 = cpi->alt_ref_buffer.y_buffer;
-      stride = cpi->alt_ref_buffer.y_stride;
+        dst1 = cpi->alt_ref_buffer.y_buffer;
+        stride = cpi->alt_ref_buffer.y_stride;
 #endif  // CONFIG_BGSPRITE
         byte = mb_y_offset;
         for (i = 0, k = 0; i < 16; i++) {
@@ -518,9 +502,9 @@
         dst2 = target->v_buffer;
         stride = target->uv_stride;
 #else
-      dst1 = cpi->alt_ref_buffer.u_buffer;
-      dst2 = cpi->alt_ref_buffer.v_buffer;
-      stride = cpi->alt_ref_buffer.uv_stride;
+        dst1 = cpi->alt_ref_buffer.u_buffer;
+        dst2 = cpi->alt_ref_buffer.v_buffer;
+        stride = cpi->alt_ref_buffer.uv_stride;
 #endif  // CONFIG_BGSPRITE
         byte = mb_uv_offset;
         for (i = 0, k = 256; i < mb_uv_height; i++) {
@@ -540,9 +524,7 @@
           }
           byte += stride - mb_uv_width;
         }
-#if CONFIG_HIGHBITDEPTH
       }
-#endif  // CONFIG_HIGHBITDEPTH
       mb_y_offset += 16;
       mb_uv_offset += mb_uv_width;
     }
@@ -685,19 +667,13 @@
   }
 
   if (frames_to_blur > 0) {
-// Setup scaling factors. Scaling on each of the arnr frames is not
-// supported.
-// ARF is produced at the native frame size and resized when coded.
-#if CONFIG_HIGHBITDEPTH
+    // Setup scaling factors. Scaling on each of the arnr frames is not
+    // supported.
+    // ARF is produced at the native frame size and resized when coded.
     av1_setup_scale_factors_for_frame(
         &sf, frames[0]->y_crop_width, frames[0]->y_crop_height,
         frames[0]->y_crop_width, frames[0]->y_crop_height,
         cpi->common.use_highbitdepth);
-#else
-    av1_setup_scale_factors_for_frame(
-        &sf, frames[0]->y_crop_width, frames[0]->y_crop_height,
-        frames[0]->y_crop_width, frames[0]->y_crop_height);
-#endif  // CONFIG_HIGHBITDEPTH
   }
 
   temporal_filter_iterate_c(cpi,
diff --git a/av1/encoder/tokenize.c b/av1/encoder/tokenize.c
index 6861a13..e93e4d0 100644
--- a/av1/encoder/tokenize.c
+++ b/av1/encoder/tokenize.c
@@ -118,97 +118,95 @@
   9377,  11540, 7256,  9419,  9895,  12058, 10316, 12479, 12955, 15118, 3678,
   5841,  6317,  8480,  6738,  8901,  9377,  11540, 7256,  9419,  9895,  12058,
   10316, 12479, 12955, 15118, 7256,  9419,  9895,  12058, 10316, 12479, 12955,
-  15118, 10834, 12997, 13473, 15636, 13894, 16057, 16533, 18696,
-#if CONFIG_HIGHBITDEPTH
-  4193,  6356,  6832,  8995,  7253,  9416,  9892,  12055, 7771,  9934,  10410,
-  12573, 10831, 12994, 13470, 15633, 7771,  9934,  10410, 12573, 10831, 12994,
-  13470, 15633, 11349, 13512, 13988, 16151, 14409, 16572, 17048, 19211, 7771,
-  9934,  10410, 12573, 10831, 12994, 13470, 15633, 11349, 13512, 13988, 16151,
-  14409, 16572, 17048, 19211, 11349, 13512, 13988, 16151, 14409, 16572, 17048,
-  19211, 14927, 17090, 17566, 19729, 17987, 20150, 20626, 22789, 4193,  6356,
+  15118, 10834, 12997, 13473, 15636, 13894, 16057, 16533, 18696, 4193,  6356,
   6832,  8995,  7253,  9416,  9892,  12055, 7771,  9934,  10410, 12573, 10831,
   12994, 13470, 15633, 7771,  9934,  10410, 12573, 10831, 12994, 13470, 15633,
   11349, 13512, 13988, 16151, 14409, 16572, 17048, 19211, 7771,  9934,  10410,
   12573, 10831, 12994, 13470, 15633, 11349, 13512, 13988, 16151, 14409, 16572,
   17048, 19211, 11349, 13512, 13988, 16151, 14409, 16572, 17048, 19211, 14927,
-  17090, 17566, 19729, 17987, 20150, 20626, 22789, 8286,  10449, 10925, 13088,
-  11346, 13509, 13985, 16148, 11864, 14027, 14503, 16666, 14924, 17087, 17563,
-  19726, 11864, 14027, 14503, 16666, 14924, 17087, 17563, 19726, 15442, 17605,
-  18081, 20244, 18502, 20665, 21141, 23304, 11864, 14027, 14503, 16666, 14924,
-  17087, 17563, 19726, 15442, 17605, 18081, 20244, 18502, 20665, 21141, 23304,
-  15442, 17605, 18081, 20244, 18502, 20665, 21141, 23304, 19020, 21183, 21659,
-  23822, 22080, 24243, 24719, 26882, 4193,  6356,  6832,  8995,  7253,  9416,
-  9892,  12055, 7771,  9934,  10410, 12573, 10831, 12994, 13470, 15633, 7771,
-  9934,  10410, 12573, 10831, 12994, 13470, 15633, 11349, 13512, 13988, 16151,
-  14409, 16572, 17048, 19211, 7771,  9934,  10410, 12573, 10831, 12994, 13470,
-  15633, 11349, 13512, 13988, 16151, 14409, 16572, 17048, 19211, 11349, 13512,
-  13988, 16151, 14409, 16572, 17048, 19211, 14927, 17090, 17566, 19729, 17987,
-  20150, 20626, 22789, 8286,  10449, 10925, 13088, 11346, 13509, 13985, 16148,
-  11864, 14027, 14503, 16666, 14924, 17087, 17563, 19726, 11864, 14027, 14503,
-  16666, 14924, 17087, 17563, 19726, 15442, 17605, 18081, 20244, 18502, 20665,
-  21141, 23304, 11864, 14027, 14503, 16666, 14924, 17087, 17563, 19726, 15442,
-  17605, 18081, 20244, 18502, 20665, 21141, 23304, 15442, 17605, 18081, 20244,
-  18502, 20665, 21141, 23304, 19020, 21183, 21659, 23822, 22080, 24243, 24719,
-  26882, 8286,  10449, 10925, 13088, 11346, 13509, 13985, 16148, 11864, 14027,
+  17090, 17566, 19729, 17987, 20150, 20626, 22789, 4193,  6356,  6832,  8995,
+  7253,  9416,  9892,  12055, 7771,  9934,  10410, 12573, 10831, 12994, 13470,
+  15633, 7771,  9934,  10410, 12573, 10831, 12994, 13470, 15633, 11349, 13512,
+  13988, 16151, 14409, 16572, 17048, 19211, 7771,  9934,  10410, 12573, 10831,
+  12994, 13470, 15633, 11349, 13512, 13988, 16151, 14409, 16572, 17048, 19211,
+  11349, 13512, 13988, 16151, 14409, 16572, 17048, 19211, 14927, 17090, 17566,
+  19729, 17987, 20150, 20626, 22789, 8286,  10449, 10925, 13088, 11346, 13509,
+  13985, 16148, 11864, 14027, 14503, 16666, 14924, 17087, 17563, 19726, 11864,
+  14027, 14503, 16666, 14924, 17087, 17563, 19726, 15442, 17605, 18081, 20244,
+  18502, 20665, 21141, 23304, 11864, 14027, 14503, 16666, 14924, 17087, 17563,
+  19726, 15442, 17605, 18081, 20244, 18502, 20665, 21141, 23304, 15442, 17605,
+  18081, 20244, 18502, 20665, 21141, 23304, 19020, 21183, 21659, 23822, 22080,
+  24243, 24719, 26882, 4193,  6356,  6832,  8995,  7253,  9416,  9892,  12055,
+  7771,  9934,  10410, 12573, 10831, 12994, 13470, 15633, 7771,  9934,  10410,
+  12573, 10831, 12994, 13470, 15633, 11349, 13512, 13988, 16151, 14409, 16572,
+  17048, 19211, 7771,  9934,  10410, 12573, 10831, 12994, 13470, 15633, 11349,
+  13512, 13988, 16151, 14409, 16572, 17048, 19211, 11349, 13512, 13988, 16151,
+  14409, 16572, 17048, 19211, 14927, 17090, 17566, 19729, 17987, 20150, 20626,
+  22789, 8286,  10449, 10925, 13088, 11346, 13509, 13985, 16148, 11864, 14027,
   14503, 16666, 14924, 17087, 17563, 19726, 11864, 14027, 14503, 16666, 14924,
   17087, 17563, 19726, 15442, 17605, 18081, 20244, 18502, 20665, 21141, 23304,
   11864, 14027, 14503, 16666, 14924, 17087, 17563, 19726, 15442, 17605, 18081,
   20244, 18502, 20665, 21141, 23304, 15442, 17605, 18081, 20244, 18502, 20665,
-  21141, 23304, 19020, 21183, 21659, 23822, 22080, 24243, 24719, 26882, 12379,
-  14542, 15018, 17181, 15439, 17602, 18078, 20241, 15957, 18120, 18596, 20759,
-  19017, 21180, 21656, 23819, 15957, 18120, 18596, 20759, 19017, 21180, 21656,
-  23819, 19535, 21698, 22174, 24337, 22595, 24758, 25234, 27397, 15957, 18120,
-  18596, 20759, 19017, 21180, 21656, 23819, 19535, 21698, 22174, 24337, 22595,
-  24758, 25234, 27397, 19535, 21698, 22174, 24337, 22595, 24758, 25234, 27397,
-  23113, 25276, 25752, 27915, 26173, 28336, 28812, 30975, 4193,  6356,  6832,
-  8995,  7253,  9416,  9892,  12055, 7771,  9934,  10410, 12573, 10831, 12994,
-  13470, 15633, 7771,  9934,  10410, 12573, 10831, 12994, 13470, 15633, 11349,
-  13512, 13988, 16151, 14409, 16572, 17048, 19211, 7771,  9934,  10410, 12573,
-  10831, 12994, 13470, 15633, 11349, 13512, 13988, 16151, 14409, 16572, 17048,
-  19211, 11349, 13512, 13988, 16151, 14409, 16572, 17048, 19211, 14927, 17090,
-  17566, 19729, 17987, 20150, 20626, 22789, 8286,  10449, 10925, 13088, 11346,
-  13509, 13985, 16148, 11864, 14027, 14503, 16666, 14924, 17087, 17563, 19726,
-  11864, 14027, 14503, 16666, 14924, 17087, 17563, 19726, 15442, 17605, 18081,
-  20244, 18502, 20665, 21141, 23304, 11864, 14027, 14503, 16666, 14924, 17087,
-  17563, 19726, 15442, 17605, 18081, 20244, 18502, 20665, 21141, 23304, 15442,
-  17605, 18081, 20244, 18502, 20665, 21141, 23304, 19020, 21183, 21659, 23822,
-  22080, 24243, 24719, 26882, 8286,  10449, 10925, 13088, 11346, 13509, 13985,
+  21141, 23304, 19020, 21183, 21659, 23822, 22080, 24243, 24719, 26882, 8286,
+  10449, 10925, 13088, 11346, 13509, 13985, 16148, 11864, 14027, 14503, 16666,
+  14924, 17087, 17563, 19726, 11864, 14027, 14503, 16666, 14924, 17087, 17563,
+  19726, 15442, 17605, 18081, 20244, 18502, 20665, 21141, 23304, 11864, 14027,
+  14503, 16666, 14924, 17087, 17563, 19726, 15442, 17605, 18081, 20244, 18502,
+  20665, 21141, 23304, 15442, 17605, 18081, 20244, 18502, 20665, 21141, 23304,
+  19020, 21183, 21659, 23822, 22080, 24243, 24719, 26882, 12379, 14542, 15018,
+  17181, 15439, 17602, 18078, 20241, 15957, 18120, 18596, 20759, 19017, 21180,
+  21656, 23819, 15957, 18120, 18596, 20759, 19017, 21180, 21656, 23819, 19535,
+  21698, 22174, 24337, 22595, 24758, 25234, 27397, 15957, 18120, 18596, 20759,
+  19017, 21180, 21656, 23819, 19535, 21698, 22174, 24337, 22595, 24758, 25234,
+  27397, 19535, 21698, 22174, 24337, 22595, 24758, 25234, 27397, 23113, 25276,
+  25752, 27915, 26173, 28336, 28812, 30975, 4193,  6356,  6832,  8995,  7253,
+  9416,  9892,  12055, 7771,  9934,  10410, 12573, 10831, 12994, 13470, 15633,
+  7771,  9934,  10410, 12573, 10831, 12994, 13470, 15633, 11349, 13512, 13988,
+  16151, 14409, 16572, 17048, 19211, 7771,  9934,  10410, 12573, 10831, 12994,
+  13470, 15633, 11349, 13512, 13988, 16151, 14409, 16572, 17048, 19211, 11349,
+  13512, 13988, 16151, 14409, 16572, 17048, 19211, 14927, 17090, 17566, 19729,
+  17987, 20150, 20626, 22789, 8286,  10449, 10925, 13088, 11346, 13509, 13985,
   16148, 11864, 14027, 14503, 16666, 14924, 17087, 17563, 19726, 11864, 14027,
   14503, 16666, 14924, 17087, 17563, 19726, 15442, 17605, 18081, 20244, 18502,
   20665, 21141, 23304, 11864, 14027, 14503, 16666, 14924, 17087, 17563, 19726,
   15442, 17605, 18081, 20244, 18502, 20665, 21141, 23304, 15442, 17605, 18081,
   20244, 18502, 20665, 21141, 23304, 19020, 21183, 21659, 23822, 22080, 24243,
-  24719, 26882, 12379, 14542, 15018, 17181, 15439, 17602, 18078, 20241, 15957,
-  18120, 18596, 20759, 19017, 21180, 21656, 23819, 15957, 18120, 18596, 20759,
-  19017, 21180, 21656, 23819, 19535, 21698, 22174, 24337, 22595, 24758, 25234,
-  27397, 15957, 18120, 18596, 20759, 19017, 21180, 21656, 23819, 19535, 21698,
-  22174, 24337, 22595, 24758, 25234, 27397, 19535, 21698, 22174, 24337, 22595,
-  24758, 25234, 27397, 23113, 25276, 25752, 27915, 26173, 28336, 28812, 30975,
-  8286,  10449, 10925, 13088, 11346, 13509, 13985, 16148, 11864, 14027, 14503,
-  16666, 14924, 17087, 17563, 19726, 11864, 14027, 14503, 16666, 14924, 17087,
-  17563, 19726, 15442, 17605, 18081, 20244, 18502, 20665, 21141, 23304, 11864,
-  14027, 14503, 16666, 14924, 17087, 17563, 19726, 15442, 17605, 18081, 20244,
-  18502, 20665, 21141, 23304, 15442, 17605, 18081, 20244, 18502, 20665, 21141,
-  23304, 19020, 21183, 21659, 23822, 22080, 24243, 24719, 26882, 12379, 14542,
-  15018, 17181, 15439, 17602, 18078, 20241, 15957, 18120, 18596, 20759, 19017,
-  21180, 21656, 23819, 15957, 18120, 18596, 20759, 19017, 21180, 21656, 23819,
-  19535, 21698, 22174, 24337, 22595, 24758, 25234, 27397, 15957, 18120, 18596,
-  20759, 19017, 21180, 21656, 23819, 19535, 21698, 22174, 24337, 22595, 24758,
-  25234, 27397, 19535, 21698, 22174, 24337, 22595, 24758, 25234, 27397, 23113,
-  25276, 25752, 27915, 26173, 28336, 28812, 30975, 12379, 14542, 15018, 17181,
+  24719, 26882, 8286,  10449, 10925, 13088, 11346, 13509, 13985, 16148, 11864,
+  14027, 14503, 16666, 14924, 17087, 17563, 19726, 11864, 14027, 14503, 16666,
+  14924, 17087, 17563, 19726, 15442, 17605, 18081, 20244, 18502, 20665, 21141,
+  23304, 11864, 14027, 14503, 16666, 14924, 17087, 17563, 19726, 15442, 17605,
+  18081, 20244, 18502, 20665, 21141, 23304, 15442, 17605, 18081, 20244, 18502,
+  20665, 21141, 23304, 19020, 21183, 21659, 23822, 22080, 24243, 24719, 26882,
+  12379, 14542, 15018, 17181, 15439, 17602, 18078, 20241, 15957, 18120, 18596,
+  20759, 19017, 21180, 21656, 23819, 15957, 18120, 18596, 20759, 19017, 21180,
+  21656, 23819, 19535, 21698, 22174, 24337, 22595, 24758, 25234, 27397, 15957,
+  18120, 18596, 20759, 19017, 21180, 21656, 23819, 19535, 21698, 22174, 24337,
+  22595, 24758, 25234, 27397, 19535, 21698, 22174, 24337, 22595, 24758, 25234,
+  27397, 23113, 25276, 25752, 27915, 26173, 28336, 28812, 30975, 8286,  10449,
+  10925, 13088, 11346, 13509, 13985, 16148, 11864, 14027, 14503, 16666, 14924,
+  17087, 17563, 19726, 11864, 14027, 14503, 16666, 14924, 17087, 17563, 19726,
+  15442, 17605, 18081, 20244, 18502, 20665, 21141, 23304, 11864, 14027, 14503,
+  16666, 14924, 17087, 17563, 19726, 15442, 17605, 18081, 20244, 18502, 20665,
+  21141, 23304, 15442, 17605, 18081, 20244, 18502, 20665, 21141, 23304, 19020,
+  21183, 21659, 23822, 22080, 24243, 24719, 26882, 12379, 14542, 15018, 17181,
   15439, 17602, 18078, 20241, 15957, 18120, 18596, 20759, 19017, 21180, 21656,
   23819, 15957, 18120, 18596, 20759, 19017, 21180, 21656, 23819, 19535, 21698,
   22174, 24337, 22595, 24758, 25234, 27397, 15957, 18120, 18596, 20759, 19017,
   21180, 21656, 23819, 19535, 21698, 22174, 24337, 22595, 24758, 25234, 27397,
   19535, 21698, 22174, 24337, 22595, 24758, 25234, 27397, 23113, 25276, 25752,
-  27915, 26173, 28336, 28812, 30975, 16472, 18635, 19111, 21274, 19532, 21695,
-  22171, 24334, 20050, 22213, 22689, 24852, 23110, 25273, 25749, 27912, 20050,
-  22213, 22689, 24852, 23110, 25273, 25749, 27912, 23628, 25791, 26267, 28430,
-  26688, 28851, 29327, 31490, 20050, 22213, 22689, 24852, 23110, 25273, 25749,
-  27912, 23628, 25791, 26267, 28430, 26688, 28851, 29327, 31490, 23628, 25791,
-  26267, 28430, 26688, 28851, 29327, 31490, 27206, 29369, 29845, 32008, 30266,
-  32429, 32905, 35068
-#endif
+  27915, 26173, 28336, 28812, 30975, 12379, 14542, 15018, 17181, 15439, 17602,
+  18078, 20241, 15957, 18120, 18596, 20759, 19017, 21180, 21656, 23819, 15957,
+  18120, 18596, 20759, 19017, 21180, 21656, 23819, 19535, 21698, 22174, 24337,
+  22595, 24758, 25234, 27397, 15957, 18120, 18596, 20759, 19017, 21180, 21656,
+  23819, 19535, 21698, 22174, 24337, 22595, 24758, 25234, 27397, 19535, 21698,
+  22174, 24337, 22595, 24758, 25234, 27397, 23113, 25276, 25752, 27915, 26173,
+  28336, 28812, 30975, 16472, 18635, 19111, 21274, 19532, 21695, 22171, 24334,
+  20050, 22213, 22689, 24852, 23110, 25273, 25749, 27912, 20050, 22213, 22689,
+  24852, 23110, 25273, 25749, 27912, 23628, 25791, 26267, 28430, 26688, 28851,
+  29327, 31490, 20050, 22213, 22689, 24852, 23110, 25273, 25749, 27912, 23628,
+  25791, 26267, 28430, 26688, 28851, 29327, 31490, 23628, 25791, 26267, 28430,
+  26688, 28851, 29327, 31490, 27206, 29369, 29845, 32008, 30266, 32429, 32905,
+  35068
 };
 
 const uint8_t av1_cat6_skipped_bits_discount[8] = {
diff --git a/av1/encoder/tokenize.h b/av1/encoder/tokenize.h
index a3736fc..cc650d9 100644
--- a/av1/encoder/tokenize.h
+++ b/av1/encoder/tokenize.h
@@ -22,11 +22,7 @@
 
 #define EOSB_TOKEN 127  // Not signalled, encoder only
 
-#if CONFIG_HIGHBITDEPTH
 typedef int32_t EXTRABIT;
-#else
-typedef int16_t EXTRABIT;
-#endif
 
 typedef struct {
   int16_t token;
@@ -93,11 +89,7 @@
 extern const TOKENVALUE *av1_dct_cat_lt_10_value_tokens;
 extern const int *av1_dct_cat_lt_10_value_cost;
 extern const int16_t av1_cat6_low_cost[256];
-#if CONFIG_HIGHBITDEPTH
 #define CAT6_HIGH_COST_ENTRIES 1024
-#else
-#define CAT6_HIGH_COST_ENTRIES 64
-#endif
 extern const int av1_cat6_high_cost[CAT6_HIGH_COST_ENTRIES];
 extern const uint8_t av1_cat6_skipped_bits_discount[8];
 
diff --git a/av1/encoder/x86/dct_sse2.asm b/av1/encoder/x86/dct_sse2.asm
index a99db3d..b185548 100644
--- a/av1/encoder/x86/dct_sse2.asm
+++ b/av1/encoder/x86/dct_sse2.asm
@@ -63,7 +63,6 @@
   psllw           m0,        2
   psllw           m1,        2
 
-%if CONFIG_HIGHBITDEPTH
   ; sign extension
   mova            m2,             m0
   mova            m3,             m1
@@ -79,9 +78,5 @@
   mova            [outputq + 16], m2
   mova            [outputq + 32], m1
   mova            [outputq + 48], m3
-%else
-  mova            [outputq],      m0
-  mova            [outputq + 16], m1
-%endif
 
   RET
diff --git a/build/cmake/aom_experiment_deps.cmake b/build/cmake/aom_experiment_deps.cmake
index cdf6d3a..0fd10a0 100644
--- a/build/cmake/aom_experiment_deps.cmake
+++ b/build/cmake/aom_experiment_deps.cmake
@@ -39,7 +39,6 @@
   endif ()
 
   if (CONFIG_DAALA_TX)
-     set(CONFIG_HIGHBITDEPTH 1)
      set(CONFIG_DAALA_TX4 1)
      set(CONFIG_DAALA_TX8 1)
      set(CONFIG_DAALA_TX16 1)
@@ -149,13 +148,6 @@
       change_config_and_warn(CONFIG_LV_MAP 1 CONFIG_TXK_SEL)
     endif ()
   endif ()
-
-  if (CONFIG_TXMG)
-    if (NOT CONFIG_HIGHBITDEPTH)
-      change_config_and_warn(CONFIG_HIGHBITDEPTH 1 CONFIG_TXMG)
-    endif ()
-  endif ()
-
 endmacro ()
 
 endif ()  # AOM_BUILD_CMAKE_AOM_EXPERIMENT_DEPS_CMAKE_
diff --git a/examples/encoder_util.c b/examples/encoder_util.c
index 32acf0a..b634100 100644
--- a/examples/encoder_util.c
+++ b/examples/encoder_util.c
@@ -79,21 +79,16 @@
                                  const aom_image_t *const img2,
                                  int use_highbitdepth, int yloc[4], int uloc[4],
                                  int vloc[4]) {
-#if !CONFIG_HIGHBITDEPTH
-  assert(!use_highbitdepth);
-#endif  // !CONFIG_HIGHBITDEPTH
   find_mismatch_plane(img1, img2, AOM_PLANE_Y, use_highbitdepth, yloc);
   find_mismatch_plane(img1, img2, AOM_PLANE_U, use_highbitdepth, uloc);
   find_mismatch_plane(img1, img2, AOM_PLANE_V, use_highbitdepth, vloc);
 }
 
-#if CONFIG_HIGHBITDEPTH
 void aom_find_mismatch_high(const aom_image_t *const img1,
                             const aom_image_t *const img2, int yloc[4],
                             int uloc[4], int vloc[4]) {
   find_mismatch_helper(img1, img2, 1, yloc, uloc, vloc);
 }
-#endif
 
 void aom_find_mismatch(const aom_image_t *const img1,
                        const aom_image_t *const img2, int yloc[4], int uloc[4],
@@ -115,12 +110,10 @@
   match &= (img1->fmt == img2->fmt);
   match &= (img1->d_w == img2->d_w);
   match &= (img1->d_h == img2->d_h);
-#if CONFIG_HIGHBITDEPTH
   if (img1->fmt & AOM_IMG_FMT_HIGHBITDEPTH) {
     l_w *= 2;
     c_w *= 2;
   }
-#endif
 
   for (int plane = 0; plane < num_planes; ++plane) {
     uint32_t height = plane ? c_h : img1->d_h;
diff --git a/examples/encoder_util.h b/examples/encoder_util.h
index 38deef0..a467bb1 100644
--- a/examples/encoder_util.h
+++ b/examples/encoder_util.h
@@ -19,11 +19,9 @@
 
 // Returns mismatch location (?loc[0],?loc[1]) and the values at that location
 // in img1 (?loc[2]) and img2 (?loc[3]).
-#if CONFIG_HIGHBITDEPTH
 void aom_find_mismatch_high(const aom_image_t *const img1,
                             const aom_image_t *const img2, int yloc[4],
                             int uloc[4], int vloc[4]);
-#endif  // CONFIG_HIGHBITDEPTH
 
 void aom_find_mismatch(const aom_image_t *const img1,
                        const aom_image_t *const img2, int yloc[4], int uloc[4],
diff --git a/test/arf_freq_test.cc b/test/arf_freq_test.cc
index 4e0a62a..f3cbceb 100644
--- a/test/arf_freq_test.cc
+++ b/test/arf_freq_test.cc
@@ -50,9 +50,7 @@
   { "hantro_collage_w352h288.yuv", 352, 288, 30, 1, 8, AOM_IMG_FMT_I420,
     AOM_BITS_8, 0 },
   { "rush_hour_444.y4m", 352, 288, 30, 1, 8, AOM_IMG_FMT_I444, AOM_BITS_8, 1 },
-#if CONFIG_HIGHBITDEPTH
-// Add list of profile 2/3 test videos here ...
-#endif  // CONFIG_HIGHBITDEPTH
+  // Add list of profile 2/3 test videos here ...
 };
 
 const TestEncodeParam kEncodeVectors[] = {
diff --git a/test/av1_convolve_2d_test.cc b/test/av1_convolve_2d_test.cc
index 1416f04..05840fe 100644
--- a/test/av1_convolve_2d_test.cc
+++ b/test/av1_convolve_2d_test.cc
@@ -19,12 +19,10 @@
 #if CONFIG_JNT_COMP
 using libaom_test::AV1Convolve2D::AV1JntConvolve2DTest;
 #endif
-#if CONFIG_HIGHBITDEPTH
 using libaom_test::AV1HighbdConvolve2D::AV1HighbdConvolve2DTest;
 #if CONFIG_JNT_COMP
 using libaom_test::AV1HighbdConvolve2D::AV1HighbdJntConvolve2DTest;
 #endif
-#endif
 
 namespace {
 
@@ -80,7 +78,7 @@
                             av1_jnt_convolve_2d_sse4_1, 1, 1, 1));
 #endif
 
-#if CONFIG_HIGHBITDEPTH && HAVE_SSSE3
+#if HAVE_SSSE3
 TEST_P(AV1HighbdConvolve2DTest, CheckOutput) { RunCheckOutput(GET_PARAM(3)); }
 
 INSTANTIATE_TEST_CASE_P(SSSE3, AV1HighbdConvolve2DTest,
diff --git a/test/av1_convolve_2d_test_util.cc b/test/av1_convolve_2d_test_util.cc
index dca373c..e4dbbf7 100644
--- a/test/av1_convolve_2d_test_util.cc
+++ b/test/av1_convolve_2d_test_util.cc
@@ -235,7 +235,6 @@
 #endif  // CONFIG_JNT_COMP
 }  // namespace AV1Convolve2D
 
-#if CONFIG_HIGHBITDEPTH
 namespace AV1HighbdConvolve2D {
 
 ::testing::internal::ParamGenerator<HighbdConvolve2DParam> BuildParams(
@@ -446,5 +445,4 @@
 }
 #endif  // CONFIG_JNT_COMP
 }  // namespace AV1HighbdConvolve2D
-#endif  // CONFIG_HIGHBITDEPTH
 }  // namespace libaom_test
diff --git a/test/av1_convolve_2d_test_util.h b/test/av1_convolve_2d_test_util.h
index 7eea6ef..aa4014f 100644
--- a/test/av1_convolve_2d_test_util.h
+++ b/test/av1_convolve_2d_test_util.h
@@ -67,7 +67,6 @@
 
 }  // namespace AV1Convolve2D
 
-#if CONFIG_HIGHBITDEPTH
 namespace AV1HighbdConvolve2D {
 typedef void (*highbd_convolve_2d_func)(
     const uint16_t *src, int src_stride, CONV_BUF_TYPE *dst, int dst_stride,
@@ -112,7 +111,6 @@
 #endif  // CONFIG_JNT_COMP
 
 }  // namespace AV1HighbdConvolve2D
-#endif  // CONFIG_HIGHBITDEPTH
 
 }  // namespace libaom_test
 
diff --git a/test/av1_convolve_optimz_test.cc b/test/av1_convolve_optimz_test.cc
index 95bf63f..0d1f30f 100644
--- a/test/av1_convolve_optimz_test.cc
+++ b/test/av1_convolve_optimz_test.cc
@@ -26,12 +26,9 @@
 typedef void (*conv_filter_t)(const uint8_t *, int, uint8_t *, int, int, int,
                               const InterpFilterParams, int, int,
                               ConvolveParams *);
-#if CONFIG_HIGHBITDEPTH
 typedef void (*hbd_conv_filter_t)(const uint16_t *, int, uint16_t *, int, int,
                                   int, const InterpFilterParams, int, int, int,
                                   int);
-#endif
-
 // Test parameter list:
 //  <convolve_horiz_func, convolve_vert_func,
 //  <width, height>, filter_params, subpel_x_q4, avg>
@@ -39,14 +36,12 @@
 typedef tuple<ConvInit, conv_filter_t, conv_filter_t, BlockDimension,
               InterpFilter, int, int>
     ConvParams;
-#if CONFIG_HIGHBITDEPTH
 // Test parameter list:
 //  <convolve_horiz_func, convolve_vert_func,
 //  <width, height>, filter_params, subpel_x_q4, avg, bit_dpeth>
 typedef tuple<ConvInit, hbd_conv_filter_t, hbd_conv_filter_t, BlockDimension,
               InterpFilter, int, int, int>
     HbdConvParams;
-#endif
 
 // Note:
 //  src_ and src_ref_ have special boundary requirement
@@ -237,7 +232,6 @@
                        ::testing::ValuesIn(kAvg)));
 #endif  // HAVE_SSSE3 && CONFIG_DUAL_FILTER
 
-#if CONFIG_HIGHBITDEPTH
 typedef ::testing::TestWithParam<HbdConvParams> TestWithHbdConvParams;
 class AV1HbdConvolveOptimzTest : public TestWithHbdConvParams {
  public:
@@ -401,5 +395,4 @@
                        ::testing::ValuesIn(kAvg),
                        ::testing::ValuesIn(kBitdepth)));
 #endif  // HAVE_SSE4_1 && CONFIG_DUAL_FILTER
-#endif  // CONFIG_HIGHBITDEPTH
 }  // namespace
diff --git a/test/av1_convolve_scale_test.cc b/test/av1_convolve_scale_test.cc
index 568d159..78ec988 100644
--- a/test/av1_convolve_scale_test.cc
+++ b/test/av1_convolve_scale_test.cc
@@ -434,7 +434,6 @@
                        ::testing::ValuesIn(kNTaps), ::testing::ValuesIn(kNTaps),
                        ::testing::Bool()));
 
-#if CONFIG_HIGHBITDEPTH
 typedef void (*HighbdConvolveFunc)(const uint16_t *src, int src_stride,
                                    int32_t *dst, int dst_stride, int w, int h,
                                    InterpFilterParams *filter_params_x,
@@ -499,6 +498,4 @@
                        ::testing::ValuesIn(kBlockDim),
                        ::testing::ValuesIn(kNTaps), ::testing::ValuesIn(kNTaps),
                        ::testing::Bool(), ::testing::ValuesIn(kBDs)));
-
-#endif  // CONFIG_HIGHBITDEPTH
 }  // namespace
diff --git a/test/av1_convolve_test.cc b/test/av1_convolve_test.cc
index e776274..9ccd7ea 100644
--- a/test/av1_convolve_test.cc
+++ b/test/av1_convolve_test.cc
@@ -265,7 +265,6 @@
                        ::testing::ValuesIn(filter_ls),
                        ::testing::ValuesIn(filter_ls)));
 
-#if CONFIG_HIGHBITDEPTH
 #ifndef __clang_analyzer__
 TEST(AV1ConvolveTest, av1_highbd_convolve) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
@@ -387,7 +386,6 @@
     }
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 #define CONVOLVE_SPEED_TEST 0
 #if CONVOLVE_SPEED_TEST
diff --git a/test/av1_fht16x16_test.cc b/test/av1_fht16x16_test.cc
index d428332..810abba 100644
--- a/test/av1_fht16x16_test.cc
+++ b/test/av1_fht16x16_test.cc
@@ -41,7 +41,6 @@
   av1_iht16x16_256_add_c(in, dest, stride, txfm_param);
 }
 
-#if CONFIG_HIGHBITDEPTH
 typedef void (*IHbdHtFunc)(const tran_low_t *in, uint8_t *out, int stride,
                            TX_TYPE tx_type, int bd);
 typedef void (*HbdHtFunc)(const int16_t *input, int32_t *output, int stride,
@@ -54,7 +53,6 @@
                          TX_TYPE tx_type, int bd) {
   av1_fwd_txfm2d_16x16_c(in, out, stride, tx_type, bd);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 class AV1Trans16x16HT : public libaom_test::TransformTestBase,
                         public ::testing::TestWithParam<Ht16x16Param> {
@@ -94,7 +92,6 @@
 TEST_P(AV1Trans16x16HT, CoeffCheck) { RunCoeffCheck(); }
 TEST_P(AV1Trans16x16HT, InvCoeffCheck) { RunInvCoeffCheck(); }
 
-#if CONFIG_HIGHBITDEPTH
 class AV1HighbdTrans16x16HT
     : public ::testing::TestWithParam<HighbdHt16x16Param> {
  public:
@@ -161,7 +158,6 @@
 }
 
 TEST_P(AV1HighbdTrans16x16HT, HighbdCoeffCheck) { RunBitexactCheck(); }
-#endif  // CONFIG_HIGHBITDEPTH
 
 using std::tr1::make_tuple;
 
@@ -243,7 +239,7 @@
                         ::testing::ValuesIn(kArrayHt16x16Param_avx2));
 #endif  // HAVE_AVX2
 
-#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_TX16
+#if HAVE_SSE4_1 && !CONFIG_DAALA_TX16
 const HighbdHt16x16Param kArrayHBDHt16x16Param_sse4_1[] = {
   make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, DCT_DCT, 10),
   make_tuple(&av1_fwd_txfm2d_16x16_sse4_1, DCT_DCT, 12),
@@ -266,7 +262,7 @@
 };
 INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdTrans16x16HT,
                         ::testing::ValuesIn(kArrayHBDHt16x16Param_sse4_1));
-#endif  // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_TX16
+#endif  // HAVE_SSE4_1 && !CONFIG_DAALA_TX16
 
 }  // namespace
 #endif  // !CONFIG_DAALA_TX
diff --git a/test/av1_fht32x32_test.cc b/test/av1_fht32x32_test.cc
index c47b056..2f65495 100644
--- a/test/av1_fht32x32_test.cc
+++ b/test/av1_fht32x32_test.cc
@@ -35,7 +35,6 @@
   av1_fht32x32_c(in, out, stride, txfm_param);
 }
 
-#if CONFIG_HIGHBITDEPTH
 typedef void (*IHbdHtFunc)(const tran_low_t *in, uint8_t *out, int stride,
                            TX_TYPE tx_type, int bd);
 typedef void (*HbdHtFunc)(const int16_t *input, int32_t *output, int stride,
@@ -48,7 +47,6 @@
                          TX_TYPE tx_type, int bd) {
   av1_fwd_txfm2d_32x32_c(in, out, stride, tx_type, bd);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 #if (HAVE_SSE2 || HAVE_AVX2) && !CONFIG_DAALA_TX32
 void dummy_inv_txfm(const tran_low_t *in, uint8_t *out, int stride,
@@ -94,7 +92,6 @@
 TEST_P(AV1Trans32x32HT, CoeffCheck) { RunCoeffCheck(); }
 TEST_P(AV1Trans32x32HT, MemCheck) { RunMemCheck(); }
 
-#if CONFIG_HIGHBITDEPTH
 class AV1HighbdTrans32x32HT
     : public ::testing::TestWithParam<HighbdHt32x32Param> {
  public:
@@ -161,7 +158,6 @@
 }
 
 TEST_P(AV1HighbdTrans32x32HT, HighbdCoeffCheck) { RunBitexactCheck(); }
-#endif  // CONFIG_HIGHBITDEPTH
 
 using std::tr1::make_tuple;
 
diff --git a/test/av1_fht4x4_test.cc b/test/av1_fht4x4_test.cc
index f11bfe5..80750c9 100644
--- a/test/av1_fht4x4_test.cc
+++ b/test/av1_fht4x4_test.cc
@@ -41,7 +41,6 @@
   av1_iht4x4_16_add_c(in, out, stride, txfm_param);
 }
 
-#if CONFIG_HIGHBITDEPTH
 typedef void (*IhighbdHtFunc)(const tran_low_t *in, uint8_t *out, int stride,
                               TX_TYPE tx_type, int bd);
 typedef void (*HBDFhtFunc)(const int16_t *input, int32_t *output, int stride,
@@ -55,7 +54,6 @@
                        TX_TYPE tx_type, int bd) {
   av1_fwd_txfm2d_4x4_c(in, out, stride, tx_type, bd);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 class AV1Trans4x4HT : public libaom_test::TransformTestBase,
                       public ::testing::TestWithParam<Ht4x4Param> {
@@ -98,7 +96,6 @@
 // TEST_P(AV1Trans4x4HT, InvAccuracyCheck) { RunInvAccuracyCheck(0); }
 // TEST_P(AV1Trans4x4HT, InvCoeffCheck) { RunInvCoeffCheck(); }
 
-#if CONFIG_HIGHBITDEPTH
 class AV1HighbdTrans4x4HT : public ::testing::TestWithParam<HighbdHt4x4Param> {
  public:
   virtual ~AV1HighbdTrans4x4HT() {}
@@ -164,7 +161,6 @@
 }
 
 TEST_P(AV1HighbdTrans4x4HT, HighbdCoeffCheck) { RunBitexactCheck(); }
-#endif  // CONFIG_HIGHBITDEPTH
 
 using std::tr1::make_tuple;
 
@@ -202,7 +198,7 @@
                         ::testing::ValuesIn(kArrayHt4x4Param_sse2));
 #endif  // HAVE_SSE2
 
-#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_TX4
+#if HAVE_SSE4_1 && !CONFIG_DAALA_TX4
 const HighbdHt4x4Param kArrayHighbdHt4x4Param[] = {
   make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, DCT_DCT, 10),
   make_tuple(&av1_fwd_txfm2d_4x4_sse4_1, DCT_DCT, 12),
@@ -227,7 +223,7 @@
 INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdTrans4x4HT,
                         ::testing::ValuesIn(kArrayHighbdHt4x4Param));
 
-#endif  // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_TX4
+#endif  // HAVE_SSE4_1 && !CONFIG_DAALA_TX4
 
 }  // namespace
 #endif  // !CONFIG_DAALA_TX
diff --git a/test/av1_fht8x8_test.cc b/test/av1_fht8x8_test.cc
index ec8baac..a73053f 100644
--- a/test/av1_fht8x8_test.cc
+++ b/test/av1_fht8x8_test.cc
@@ -42,7 +42,6 @@
   av1_iht8x8_64_add_c(in, out, stride, txfm_param);
 }
 
-#if CONFIG_HIGHBITDEPTH
 typedef void (*IHbdHtFunc)(const tran_low_t *in, uint8_t *out, int stride,
                            TX_TYPE tx_type, int bd);
 typedef void (*HbdHtFunc)(const int16_t *input, int32_t *output, int stride,
@@ -54,7 +53,6 @@
                        TX_TYPE tx_type, int bd) {
   av1_fwd_txfm2d_8x8_c(in, out, stride, tx_type, bd);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 class AV1Trans8x8HT : public libaom_test::TransformTestBase,
                       public ::testing::TestWithParam<Ht8x8Param> {
@@ -97,7 +95,6 @@
 // TEST_P(AV1Trans8x8HT, InvAccuracyCheck) { RunInvAccuracyCheck(0); }
 // TEST_P(AV1Trans8x8HT, InvCoeffCheck) { RunInvCoeffCheck(); }
 
-#if CONFIG_HIGHBITDEPTH
 class AV1HighbdTrans8x8HT : public ::testing::TestWithParam<HighbdHt8x8Param> {
  public:
   virtual ~AV1HighbdTrans8x8HT() {}
@@ -164,7 +161,6 @@
 }
 
 TEST_P(AV1HighbdTrans8x8HT, HighbdCoeffCheck) { RunBitexactCheck(); }
-#endif  // CONFIG_HIGHBITDEPTH
 
 using std::tr1::make_tuple;
 
@@ -202,7 +198,7 @@
                         ::testing::ValuesIn(kArrayHt8x8Param_sse2));
 #endif  // HAVE_SSE2
 
-#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_TX8
+#if HAVE_SSE4_1 && !CONFIG_DAALA_TX8
 const HighbdHt8x8Param kArrayHBDHt8x8Param_sse4_1[] = {
   make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, DCT_DCT, 10),
   make_tuple(&av1_fwd_txfm2d_8x8_sse4_1, DCT_DCT, 12),
@@ -225,7 +221,7 @@
 };
 INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdTrans8x8HT,
                         ::testing::ValuesIn(kArrayHBDHt8x8Param_sse4_1));
-#endif  // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_TX8
+#endif  // HAVE_SSE4_1 && !CONFIG_DAALA_TX8
 
 }  // namespace
 #endif  // !CONFIG_DAALA_TX
diff --git a/test/av1_fwd_txfm2d_test.cc b/test/av1_fwd_txfm2d_test.cc
index be353ef..ead6dbb 100644
--- a/test/av1_fwd_txfm2d_test.cc
+++ b/test/av1_fwd_txfm2d_test.cc
@@ -30,7 +30,6 @@
 using std::vector;
 
 namespace {
-#if CONFIG_HIGHBITDEPTH
 // tx_type_, tx_size_, max_error_, max_avg_error_
 typedef std::tr1::tuple<TX_TYPE, TX_SIZE, double, double> AV1FwdTxfm2dParam;
 
@@ -206,5 +205,4 @@
   }
 }
 
-#endif  // CONFIG_HIGHBITDEPTH
 }  // namespace
diff --git a/test/av1_highbd_iht_test.cc b/test/av1_highbd_iht_test.cc
index 7619796..b0358a4 100644
--- a/test/av1_highbd_iht_test.cc
+++ b/test/av1_highbd_iht_test.cc
@@ -135,8 +135,7 @@
 
 using std::tr1::make_tuple;
 
-#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH && \
-    !(CONFIG_DAALA_TX4 && CONFIG_DAALA_TX8 && CONFIG_DAALA_TX16)
+#if HAVE_SSE4_1 && !(CONFIG_DAALA_TX4 && CONFIG_DAALA_TX8 && CONFIG_DAALA_TX16)
 #if !CONFIG_DAALA_TX4
 #define PARAM_LIST_4X4                                   \
   &av1_fwd_txfm2d_4x4_c, &av1_inv_txfm2d_add_4x4_sse4_1, \
@@ -220,10 +219,10 @@
 
 INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdInvHTNxN,
                         ::testing::ValuesIn(kArrayIhtParam));
-#endif  // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH &&
+#endif  // HAVE_SSE4_1 &&
         //  !(CONFIG_DAALA_TX4 && CONFIG_DAALA_TX8 && CONFIG_DAALA_TX16)
 
-#if HAVE_AVX2 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_TX32
+#if HAVE_AVX2 && !CONFIG_DAALA_TX32
 #define PARAM_LIST_32X32                                   \
   &av1_fwd_txfm2d_32x32_c, &av1_inv_txfm2d_add_32x32_avx2, \
       &av1_inv_txfm2d_add_32x32_c, 1024
@@ -237,5 +236,5 @@
 INSTANTIATE_TEST_CASE_P(AVX2, AV1HighbdInvHTNxN,
                         ::testing::ValuesIn(kArrayIhtParam32x32));
 
-#endif  // HAVE_AVX2 && CONFIG_HIGHBITDEPTH
+#endif  // HAVE_AVX2
 }  // namespace
diff --git a/test/av1_inv_txfm2d_test.cc b/test/av1_inv_txfm2d_test.cc
index ca52cbd..f7ce6b8 100644
--- a/test/av1_inv_txfm2d_test.cc
+++ b/test/av1_inv_txfm2d_test.cc
@@ -31,7 +31,6 @@
 
 namespace {
 
-#if CONFIG_HIGHBITDEPTH
 // AV1InvTxfm2dParam argument list:
 // tx_type_, tx_size_, max_error_, max_avg_error_
 typedef std::tr1::tuple<TX_TYPE, TX_SIZE, int, double> AV1InvTxfm2dParam;
@@ -213,6 +212,4 @@
     }
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
-
 }  // namespace
diff --git a/test/av1_txfm_test.h b/test/av1_txfm_test.h
index 1426f7c..a68ca41 100644
--- a/test/av1_txfm_test.h
+++ b/test/av1_txfm_test.h
@@ -79,7 +79,6 @@
 static const int bd = 10;
 static const int input_base = (1 << bd);
 
-#if CONFIG_HIGHBITDEPTH
 #if CONFIG_AV1_ENCODER
 
 static const Fwd_Txfm2d_Func fwd_txfm_func_ls[TX_SIZES_ALL] = {
@@ -119,7 +118,6 @@
   av1_inv_txfm2d_add_16x64_c, av1_inv_txfm2d_add_64x16_c,
 #endif  // CONFIG_TX64X64
 };
-#endif  // CONFIG_HIGHBITDEPTH
 
 #define BD_NUM 3
 
diff --git a/test/blend_a64_mask_1d_test.cc b/test/blend_a64_mask_1d_test.cc
index 66e741a..e8e9556 100644
--- a/test/blend_a64_mask_1d_test.cc
+++ b/test/blend_a64_mask_1d_test.cc
@@ -207,7 +207,6 @@
         TestFuncs(blend_a64_vmask_ref, aom_blend_a64_vmask_sse4_1)));
 #endif  // HAVE_SSE4_1
 
-#if CONFIG_HIGHBITDEPTH
 //////////////////////////////////////////////////////////////////////////////
 // High bit-depth version
 //////////////////////////////////////////////////////////////////////////////
@@ -329,6 +328,4 @@
                       TestFuncsHBD(highbd_blend_a64_vmask_ref,
                                    aom_highbd_blend_a64_vmask_sse4_1)));
 #endif  // HAVE_SSE4_1
-
-#endif  // CONFIG_HIGHBITDEPTH
 }  // namespace
diff --git a/test/blend_a64_mask_test.cc b/test/blend_a64_mask_test.cc
index fef124d..519f854 100644
--- a/test/blend_a64_mask_test.cc
+++ b/test/blend_a64_mask_test.cc
@@ -182,7 +182,6 @@
                             aom_blend_a64_mask_c, aom_blend_a64_mask_sse4_1)));
 #endif  // HAVE_SSE4_1
 
-#if CONFIG_HIGHBITDEPTH
 //////////////////////////////////////////////////////////////////////////////
 // High bit-depth version
 //////////////////////////////////////////////////////////////////////////////
@@ -266,5 +265,4 @@
     ::testing::Values(TestFuncsHBD(aom_highbd_blend_a64_mask_c,
                                    aom_highbd_blend_a64_mask_sse4_1)));
 #endif  // HAVE_SSE4_1
-#endif  // CONFIG_HIGHBITDEPTH
 }  // namespace
diff --git a/test/block_error_test.cc b/test/block_error_test.cc
index def2c9d..8c5caaa 100644
--- a/test/block_error_test.cc
+++ b/test/block_error_test.cc
@@ -25,11 +25,9 @@
 typedef int64_t (*BlockErrorFunc)(const tran_low_t *coeff,
                                   const tran_low_t *dqcoeff, intptr_t size,
                                   int64_t *ssz);
-#if CONFIG_HIGHBITDEPTH
 typedef int64_t (*HbdBlockErrorFunc)(const tran_low_t *coeff,
                                      const tran_low_t *dqcoeff, intptr_t size,
                                      int64_t *ssz, int bd);
-#endif
 
 typedef std::tr1::tuple<BlockErrorFunc, BlockErrorFunc, TX_SIZE,
                         aom_bit_depth_t>
@@ -120,13 +118,6 @@
 
 using std::tr1::make_tuple;
 
-#if !CONFIG_HIGHBITDEPTH && HAVE_SSE2
-const BlockErrorParam kBlkErrParamArraySse2[] = { make_tuple(
-    &av1_block_error_c, &av1_block_error_sse2, TX_32X32, AOM_BITS_8) };
-INSTANTIATE_TEST_CASE_P(SSE2, BlockErrorTest,
-                        ::testing::ValuesIn(kBlkErrParamArraySse2));
-#endif
-
 #if HAVE_AVX2
 const BlockErrorParam kBlkErrParamArrayAvx2[] = { make_tuple(
     &av1_block_error_c, &av1_block_error_avx2, TX_32X32, AOM_BITS_8) };
diff --git a/test/convolve_round_test.cc b/test/convolve_round_test.cc
index 4976b03..9741739 100644
--- a/test/convolve_round_test.cc
+++ b/test/convolve_round_test.cc
@@ -92,11 +92,9 @@
     if (data_path_ == LOWBITDEPTH_TEST) {
       dst = reinterpret_cast<uint8_t *>(dst_);
       dst_ref = reinterpret_cast<uint8_t *>(dst_ref_);
-#if CONFIG_HIGHBITDEPTH
     } else if (data_path_ == HIGHBITDEPTH_TEST) {
       dst = CONVERT_TO_BYTEPTR(dst_);
       dst_ref = CONVERT_TO_BYTEPTR(dst_ref_);
-#endif
     } else {
       assert(0);
     }
@@ -166,7 +164,6 @@
 using std::tr1::make_tuple;
 
 #if HAVE_AVX2
-#if CONFIG_HIGHBITDEPTH
 const ConvolveRoundParam kConvRndParamArray[] = {
   make_tuple(&av1_convolve_rounding_c, &av1_convolve_rounding_avx2,
              LOWBITDEPTH_TEST),
@@ -180,11 +177,6 @@
              &highbd_convolve_rounding_12<av1_highbd_convolve_rounding_avx2>,
              HIGHBITDEPTH_TEST)
 };
-#else
-const ConvolveRoundParam kConvRndParamArray[] = { make_tuple(
-    &av1_convolve_rounding_c, &av1_convolve_rounding_avx2, LOWBITDEPTH_TEST) };
-#endif
-
 INSTANTIATE_TEST_CASE_P(AVX2, ConvolveRoundTest,
                         ::testing::ValuesIn(kConvRndParamArray));
 #endif  // HAVE_AVX2
diff --git a/test/convolve_test.cc b/test/convolve_test.cc
index ffe0b87..0462e13 100644
--- a/test/convolve_test.cc
+++ b/test/convolve_test.cc
@@ -186,7 +186,6 @@
                     output_height);
 }
 
-#if CONFIG_HIGHBITDEPTH
 void highbd_filter_block2d_8_c(const uint16_t *src_ptr,
                                const unsigned int src_stride,
                                const int16_t *HFilter, const int16_t *VFilter,
@@ -288,7 +287,6 @@
   highbd_block2d_average_c(tmp, kMaxDimension, dst_ptr, dst_stride,
                            output_width, output_height);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
  public:
@@ -301,7 +299,6 @@
         aom_memalign(kDataAlignment, kOutputBufferSize));
     output_ref_ = reinterpret_cast<uint8_t *>(
         aom_memalign(kDataAlignment, kOutputBufferSize));
-#if CONFIG_HIGHBITDEPTH
     input16_ = reinterpret_cast<uint16_t *>(aom_memalign(
                    kDataAlignment, (kInputBufferSize + 1) * sizeof(uint16_t))) +
                1;
@@ -309,7 +306,6 @@
         aom_memalign(kDataAlignment, (kOutputBufferSize) * sizeof(uint16_t)));
     output16_ref_ = reinterpret_cast<uint16_t *>(
         aom_memalign(kDataAlignment, (kOutputBufferSize) * sizeof(uint16_t)));
-#endif
   }
 
   virtual void TearDown() { libaom_test::ClearSystemState(); }
@@ -321,14 +317,12 @@
     output_ = NULL;
     aom_free(output_ref_);
     output_ref_ = NULL;
-#if CONFIG_HIGHBITDEPTH
     aom_free(input16_ - 1);
     input16_ = NULL;
     aom_free(output16_);
     output16_ = NULL;
     aom_free(output16_ref_);
     output16_ref_ = NULL;
-#endif
   }
 
  protected:
@@ -356,24 +350,18 @@
 
   virtual void SetUp() {
     UUT_ = GET_PARAM(2);
-#if CONFIG_HIGHBITDEPTH
     if (UUT_->use_highbd_ != 0)
       mask_ = (1 << UUT_->use_highbd_) - 1;
     else
       mask_ = 255;
-#endif
     /* Set up guard blocks for an inner block centered in the outer block */
     for (int i = 0; i < kOutputBufferSize; ++i) {
       if (IsIndexInBorder(i)) {
         output_[i] = 255;
-#if CONFIG_HIGHBITDEPTH
         output16_[i] = mask_;
-#endif
       } else {
         output_[i] = 0;
-#if CONFIG_HIGHBITDEPTH
         output16_[i] = 0;
-#endif
       }
     }
 
@@ -381,31 +369,23 @@
     for (int i = 0; i < kInputBufferSize; ++i) {
       if (i & 1) {
         input_[i] = 255;
-#if CONFIG_HIGHBITDEPTH
         input16_[i] = mask_;
-#endif
       } else {
         input_[i] = prng.Rand8Extremes();
-#if CONFIG_HIGHBITDEPTH
         input16_[i] = prng.Rand16() & mask_;
-#endif
       }
     }
   }
 
   void SetConstantInput(int value) {
     memset(input_, value, kInputBufferSize);
-#if CONFIG_HIGHBITDEPTH
     aom_memset16(input16_, value, kInputBufferSize);
-#endif
   }
 
   void CopyOutputToRef() {
     memcpy(output_ref_, output_, kOutputBufferSize);
-#if CONFIG_HIGHBITDEPTH
     // Copy 16-bit pixels values. The effective number of bytes is double.
     memcpy(output16_ref_, output16_, sizeof(output16_[0]) * kOutputBufferSize);
-#endif
   }
 
   void CheckGuardBlocks() {
@@ -418,72 +398,51 @@
 
   uint8_t *input() const {
     const int offset = BorderTop() * kOuterBlockSize + BorderLeft();
-#if CONFIG_HIGHBITDEPTH
     if (UUT_->use_highbd_ == 0) {
       return input_ + offset;
     } else {
       return CONVERT_TO_BYTEPTR(input16_) + offset;
     }
-#else
-    return input_ + offset;
-#endif
   }
 
   uint8_t *output() const {
     const int offset = BorderTop() * kOuterBlockSize + BorderLeft();
-#if CONFIG_HIGHBITDEPTH
     if (UUT_->use_highbd_ == 0) {
       return output_ + offset;
     } else {
       return CONVERT_TO_BYTEPTR(output16_) + offset;
     }
-#else
-    return output_ + offset;
-#endif
   }
 
   uint8_t *output_ref() const {
     const int offset = BorderTop() * kOuterBlockSize + BorderLeft();
-#if CONFIG_HIGHBITDEPTH
     if (UUT_->use_highbd_ == 0) {
       return output_ref_ + offset;
     } else {
       return CONVERT_TO_BYTEPTR(output16_ref_) + offset;
     }
-#else
-    return output_ref_ + offset;
-#endif
   }
 
   uint16_t lookup(uint8_t *list, int index) const {
-#if CONFIG_HIGHBITDEPTH
     if (UUT_->use_highbd_ == 0) {
       return list[index];
     } else {
       return CONVERT_TO_SHORTPTR(list)[index];
     }
-#else
-    return list[index];
-#endif
   }
 
   void assign_val(uint8_t *list, int index, uint16_t val) const {
-#if CONFIG_HIGHBITDEPTH
     if (UUT_->use_highbd_ == 0) {
       list[index] = (uint8_t)val;
     } else {
       CONVERT_TO_SHORTPTR(list)[index] = val;
     }
-#else
-    list[index] = (uint8_t)val;
-#endif
   }
 
   void wrapper_filter_average_block2d_8_c(
       const uint8_t *src_ptr, unsigned int src_stride, const int16_t *HFilter,
       const int16_t *VFilter, uint8_t *dst_ptr, unsigned int dst_stride,
       unsigned int output_width, unsigned int output_height) {
-#if CONFIG_HIGHBITDEPTH
     if (UUT_->use_highbd_ == 0) {
       filter_average_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, dst_ptr,
                                  dst_stride, output_width, output_height);
@@ -493,17 +452,12 @@
           CONVERT_TO_SHORTPTR(dst_ptr), dst_stride, output_width, output_height,
           UUT_->use_highbd_);
     }
-#else
-    filter_average_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, dst_ptr,
-                               dst_stride, output_width, output_height);
-#endif
   }
 
   void wrapper_filter_block2d_8_c(
       const uint8_t *src_ptr, unsigned int src_stride, const int16_t *HFilter,
       const int16_t *VFilter, uint8_t *dst_ptr, unsigned int dst_stride,
       unsigned int output_width, unsigned int output_height) {
-#if CONFIG_HIGHBITDEPTH
     if (UUT_->use_highbd_ == 0) {
       filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, dst_ptr,
                          dst_stride, output_width, output_height);
@@ -513,32 +467,24 @@
                                 dst_stride, output_width, output_height,
                                 UUT_->use_highbd_);
     }
-#else
-    filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, dst_ptr,
-                       dst_stride, output_width, output_height);
-#endif
   }
 
   const ConvolveFunctions *UUT_;
   static uint8_t *input_;
   static uint8_t *output_;
   static uint8_t *output_ref_;
-#if CONFIG_HIGHBITDEPTH
   static uint16_t *input16_;
   static uint16_t *output16_;
   static uint16_t *output16_ref_;
   int mask_;
-#endif
 };
 
 uint8_t *ConvolveTest::input_ = NULL;
 uint8_t *ConvolveTest::output_ = NULL;
 uint8_t *ConvolveTest::output_ref_ = NULL;
-#if CONFIG_HIGHBITDEPTH
 uint16_t *ConvolveTest::input16_ = NULL;
 uint16_t *ConvolveTest::output16_ = NULL;
 uint16_t *ConvolveTest::output16_ref_ = NULL;
-#endif
 
 TEST_P(ConvolveTest, GuardBlocks) { CheckGuardBlocks(); }
 
@@ -670,7 +616,6 @@
 TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) {
   uint8_t *const in = input();
   uint8_t *const out = output();
-#if CONFIG_HIGHBITDEPTH
   uint8_t ref8[kOutputStride * kMaxDimension];
   uint16_t ref16[kOutputStride * kMaxDimension];
   uint8_t *ref;
@@ -679,9 +624,6 @@
   } else {
     ref = CONVERT_TO_BYTEPTR(ref16);
   }
-#else
-  uint8_t ref[kOutputStride * kMaxDimension];
-#endif
 
   for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
     const InterpFilter filter = (InterpFilter)filter_bank;
@@ -733,7 +675,6 @@
 TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) {
   uint8_t *const in = input();
   uint8_t *const out = output();
-#if CONFIG_HIGHBITDEPTH
   uint8_t ref8[kOutputStride * kMaxDimension];
   uint16_t ref16[kOutputStride * kMaxDimension];
   uint8_t *ref;
@@ -742,25 +683,17 @@
   } else {
     ref = CONVERT_TO_BYTEPTR(ref16);
   }
-#else
-  uint8_t ref[kOutputStride * kMaxDimension];
-#endif
 
   // Populate ref and out with some random data
   ::libaom_test::ACMRandom prng;
   for (int y = 0; y < Height(); ++y) {
     for (int x = 0; x < Width(); ++x) {
       uint16_t r;
-#if CONFIG_HIGHBITDEPTH
       if (UUT_->use_highbd_ == 0 || UUT_->use_highbd_ == 8) {
         r = prng.Rand8Extremes();
       } else {
         r = prng.Rand16() & mask_;
       }
-#else
-      r = prng.Rand8Extremes();
-#endif
-
       assign_val(out, y * kOutputStride + x, r);
       assign_val(ref, y * kOutputStride + x, r);
     }
@@ -816,7 +749,6 @@
 TEST_P(ConvolveTest, FilterExtremes) {
   uint8_t *const in = input();
   uint8_t *const out = output();
-#if CONFIG_HIGHBITDEPTH
   uint8_t ref8[kOutputStride * kMaxDimension];
   uint16_t ref16[kOutputStride * kMaxDimension];
   uint8_t *ref;
@@ -825,24 +757,17 @@
   } else {
     ref = CONVERT_TO_BYTEPTR(ref16);
   }
-#else
-  uint8_t ref[kOutputStride * kMaxDimension];
-#endif
 
   // Populate ref and out with some random data
   ::libaom_test::ACMRandom prng;
   for (int y = 0; y < Height(); ++y) {
     for (int x = 0; x < Width(); ++x) {
       uint16_t r;
-#if CONFIG_HIGHBITDEPTH
       if (UUT_->use_highbd_ == 0 || UUT_->use_highbd_ == 8) {
         r = prng.Rand8Extremes();
       } else {
         r = prng.Rand16() & mask_;
       }
-#else
-      r = prng.Rand8Extremes();
-#endif
       assign_val(out, y * kOutputStride + x, r);
       assign_val(ref, y * kOutputStride + x, r);
     }
@@ -853,13 +778,8 @@
     while (seed_val < 256) {
       for (int y = 0; y < 8; ++y) {
         for (int x = 0; x < 8; ++x) {
-#if CONFIG_HIGHBITDEPTH
           assign_val(in, y * kOutputStride + x - SUBPEL_TAPS / 2 + 1,
                      ((seed_val >> (axis ? y : x)) & 1) * mask_);
-#else
-          assign_val(in, y * kOutputStride + x - SUBPEL_TAPS / 2 + 1,
-                     ((seed_val >> (axis ? y : x)) & 1) * 255);
-#endif
           if (axis) seed_val++;
         }
         if (axis)
@@ -988,7 +908,6 @@
 TEST_P(ConvolveTest, DISABLED_Speed) {
   uint8_t *const in = input();
   uint8_t *const out = output();
-#if CONFIG_HIGHBITDEPTH
   uint8_t ref8[kOutputStride * kMaxDimension];
   uint16_t ref16[kOutputStride * kMaxDimension];
   uint8_t *ref;
@@ -997,25 +916,17 @@
   } else {
     ref = CONVERT_TO_BYTEPTR(ref16);
   }
-#else
-  uint8_t ref[kOutputStride * kMaxDimension];
-#endif
 
   // Populate ref and out with some random data
   ::libaom_test::ACMRandom prng;
   for (int y = 0; y < Height(); ++y) {
     for (int x = 0; x < Width(); ++x) {
       uint16_t r;
-#if CONFIG_HIGHBITDEPTH
       if (UUT_->use_highbd_ == 0 || UUT_->use_highbd_ == 8) {
         r = prng.Rand8Extremes();
       } else {
         r = prng.Rand16() & mask_;
       }
-#else
-      r = prng.Rand8Extremes();
-#endif
-
       assign_val(out, y * kOutputStride + x, r);
       assign_val(ref, y * kOutputStride + x, r);
     }
@@ -1071,7 +982,6 @@
 
 using std::tr1::make_tuple;
 
-#if CONFIG_HIGHBITDEPTH
 #define WRAP(func, bd)                                                       \
   void wrap_##func##_##bd(                                                   \
       const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst,                \
@@ -1188,19 +1098,9 @@
   ALL_SIZES(convolve8_c), ALL_SIZES(convolve10_c), ALL_SIZES(convolve12_c)
 };
 
-#else
-const ConvolveFunctions convolve8_c(
-    aom_convolve_copy_c, aom_convolve_avg_c, aom_convolve8_horiz_c,
-    aom_convolve8_avg_horiz_c, aom_convolve8_vert_c, aom_convolve8_avg_vert_c,
-    aom_convolve8_c, aom_convolve8_avg_c, aom_scaled_horiz_c,
-    aom_scaled_avg_horiz_c, aom_scaled_vert_c, aom_scaled_avg_vert_c,
-    aom_scaled_2d_c, aom_scaled_avg_2d_c, 0);
-const ConvolveParam kArrayConvolve_c[] = { ALL_SIZES(convolve8_c) };
-#endif
 INSTANTIATE_TEST_CASE_P(C, ConvolveTest, ::testing::ValuesIn(kArrayConvolve_c));
 
 #if HAVE_SSE2 && ARCH_X86_64
-#if CONFIG_HIGHBITDEPTH
 const ConvolveFunctions convolve8_sse2(
     wrap_convolve_copy_sse2_8, wrap_convolve_avg_sse2_8,
     wrap_convolve8_horiz_sse2_8, wrap_convolve8_avg_horiz_sse2_8,
@@ -1228,16 +1128,6 @@
 const ConvolveParam kArrayConvolve_sse2[] = { ALL_SIZES(convolve8_sse2),
                                               ALL_SIZES(convolve10_sse2),
                                               ALL_SIZES(convolve12_sse2) };
-#else
-const ConvolveFunctions convolve8_sse2(
-    aom_convolve_copy_sse2, aom_convolve_avg_sse2, aom_convolve8_horiz_sse2,
-    aom_convolve8_avg_horiz_sse2, aom_convolve8_vert_sse2,
-    aom_convolve8_avg_vert_sse2, aom_convolve8_sse2, aom_convolve8_avg_sse2,
-    aom_scaled_horiz_c, aom_scaled_avg_horiz_c, aom_scaled_vert_c,
-    aom_scaled_avg_vert_c, aom_scaled_2d_c, aom_scaled_avg_2d_c, 0);
-
-const ConvolveParam kArrayConvolve_sse2[] = { ALL_SIZES(convolve8_sse2) };
-#endif  // CONFIG_HIGHBITDEPTH
 INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest,
                         ::testing::ValuesIn(kArrayConvolve_sse2));
 #endif
@@ -1256,7 +1146,6 @@
 #endif
 
 #if HAVE_AVX2
-#if CONFIG_HIGHBITDEPTH
 const ConvolveFunctions convolve8_avx2(
     wrap_convolve_copy_avx2_8, wrap_convolve_avg_avx2_8,
     wrap_convolve8_horiz_avx2_8, wrap_convolve8_avg_horiz_avx2_8,
@@ -1283,16 +1172,6 @@
 const ConvolveParam kArrayConvolve8_avx2[] = { ALL_SIZES_64(convolve8_avx2),
                                                ALL_SIZES_64(convolve10_avx2),
                                                ALL_SIZES_64(convolve12_avx2) };
-#else
-const ConvolveFunctions convolve8_avx2(
-    aom_convolve_copy_c, aom_convolve_avg_c, aom_convolve8_horiz_avx2,
-    aom_convolve8_avg_horiz_ssse3, aom_convolve8_vert_avx2,
-    aom_convolve8_avg_vert_ssse3, aom_convolve8_avx2, aom_convolve8_avg_ssse3,
-    aom_scaled_horiz_c, aom_scaled_avg_horiz_c, aom_scaled_vert_c,
-    aom_scaled_avg_vert_c, aom_scaled_2d_c, aom_scaled_avg_2d_c, 0);
-
-const ConvolveParam kArrayConvolve8_avx2[] = { ALL_SIZES_64(convolve8_avx2) };
-#endif  // CONFIG_HIGHBITDEPTH
 INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest,
                         ::testing::ValuesIn(kArrayConvolve8_avx2));
 #endif  // HAVE_AVX2
diff --git a/test/dct16x16_test.cc b/test/dct16x16_test.cc
index 2962ffb..3e5c4ee 100644
--- a/test/dct16x16_test.cc
+++ b/test/dct16x16_test.cc
@@ -258,7 +258,6 @@
   av1_iht16x16_256_add_c(in, dest, stride, txfm_param);
 }
 
-#if CONFIG_HIGHBITDEPTH
 void fht16x16_10(const int16_t *in, tran_low_t *out, int stride,
                  TxfmParam *txfm_param) {
   av1_fwd_txfm2d_16x16_c(in, out, stride, txfm_param->tx_type, 10);
@@ -280,7 +279,6 @@
   av1_inv_txfm2d_add_16x16_c(in, CONVERT_TO_SHORTPTR(out), stride,
                              txfm_param->tx_type, 12);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 class Trans16x16TestBase {
  public:
@@ -301,10 +299,8 @@
       DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]);
       DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
       DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
-#if CONFIG_HIGHBITDEPTH
       DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
       DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
-#endif
 
       // Initialize a test block with input range [-mask_, mask_].
       for (int j = 0; j < kNumCoeffs; ++j) {
@@ -312,12 +308,10 @@
           src[j] = rnd.Rand8();
           dst[j] = rnd.Rand8();
           test_input_block[j] = src[j] - dst[j];
-#if CONFIG_HIGHBITDEPTH
         } else {
           src16[j] = rnd.Rand16() & mask_;
           dst16[j] = rnd.Rand16() & mask_;
           test_input_block[j] = src16[j] - dst16[j];
-#endif
         }
       }
 
@@ -325,20 +319,14 @@
           RunFwdTxfm(test_input_block, test_temp_block, pitch_));
       if (bit_depth_ == AOM_BITS_8) {
         ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
-#if CONFIG_HIGHBITDEPTH
       } else {
         ASM_REGISTER_STATE_CHECK(
             RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
-#endif
       }
 
       for (int j = 0; j < kNumCoeffs; ++j) {
-#if CONFIG_HIGHBITDEPTH
         const int32_t diff =
             bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
-#else
-        const int32_t diff = dst[j] - src[j];
-#endif
         const uint32_t error = diff * diff;
         if (max_error < error) max_error = error;
         total_error += error;
@@ -412,10 +400,8 @@
 
     DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
-#if CONFIG_HIGHBITDEPTH
     DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
-#endif
 
     for (int i = 0; i < count_test_block; ++i) {
       // Initialize a test block with input range [-mask_, mask_].
@@ -432,10 +418,8 @@
       // clear reconstructed pixel buffers
       memset(dst, 0, kNumCoeffs * sizeof(uint8_t));
       memset(ref, 0, kNumCoeffs * sizeof(uint8_t));
-#if CONFIG_HIGHBITDEPTH
       memset(dst16, 0, kNumCoeffs * sizeof(uint16_t));
       memset(ref16, 0, kNumCoeffs * sizeof(uint16_t));
-#endif
 
       // quantization with maximum allowed step sizes
       output_ref_block[0] = (output_ref_block[0] / dc_thred) * dc_thred;
@@ -444,20 +428,16 @@
       if (bit_depth_ == AOM_BITS_8) {
         inv_txfm_ref(output_ref_block, ref, pitch_, &txfm_param_);
         ASM_REGISTER_STATE_CHECK(RunInvTxfm(output_ref_block, dst, pitch_));
-#if CONFIG_HIGHBITDEPTH
       } else {
         inv_txfm_ref(output_ref_block, CONVERT_TO_BYTEPTR(ref16), pitch_,
                      &txfm_param_);
         ASM_REGISTER_STATE_CHECK(
             RunInvTxfm(output_ref_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
-#endif
       }
       if (bit_depth_ == AOM_BITS_8) {
         for (int j = 0; j < kNumCoeffs; ++j) EXPECT_EQ(ref[j], dst[j]);
-#if CONFIG_HIGHBITDEPTH
       } else {
         for (int j = 0; j < kNumCoeffs; ++j) EXPECT_EQ(ref16[j], dst16[j]);
-#endif
       }
     }
   }
@@ -469,10 +449,8 @@
     DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
-#if CONFIG_HIGHBITDEPTH
     DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
-#endif  // CONFIG_HIGHBITDEPTH
 
     for (int i = 0; i < count_test_block; ++i) {
       double out_r[kNumCoeffs];
@@ -483,12 +461,10 @@
           src[j] = rnd.Rand8();
           dst[j] = rnd.Rand8();
           in[j] = src[j] - dst[j];
-#if CONFIG_HIGHBITDEPTH
         } else {
           src16[j] = rnd.Rand16() & mask_;
           dst16[j] = rnd.Rand16() & mask_;
           in[j] = src16[j] - dst16[j];
-#endif  // CONFIG_HIGHBITDEPTH
         }
       }
 
@@ -498,20 +474,14 @@
 
       if (bit_depth_ == AOM_BITS_8) {
         ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, 16));
-#if CONFIG_HIGHBITDEPTH
       } else {
         ASM_REGISTER_STATE_CHECK(
             RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), 16));
-#endif  // CONFIG_HIGHBITDEPTH
       }
 
       for (int j = 0; j < kNumCoeffs; ++j) {
-#if CONFIG_HIGHBITDEPTH
         const int diff =
             bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
-#else
-        const int diff = dst[j] - src[j];
-#endif  // CONFIG_HIGHBITDEPTH
         const uint32_t error = diff * diff;
         EXPECT_GE(1u, error)
             << "Error: 16x16 IDCT has error " << error << " at index " << j;
@@ -527,10 +497,8 @@
     DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
-#if CONFIG_HIGHBITDEPTH
     DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
-#endif  // CONFIG_HIGHBITDEPTH
 
     for (int i = 0; i < count_test_block; ++i) {
       for (int j = 0; j < kNumCoeffs; ++j) {
@@ -543,31 +511,23 @@
         if (bit_depth_ == AOM_BITS_8) {
           dst[j] = 0;
           ref[j] = 0;
-#if CONFIG_HIGHBITDEPTH
         } else {
           dst16[j] = 0;
           ref16[j] = 0;
-#endif  // CONFIG_HIGHBITDEPTH
         }
       }
       if (bit_depth_ == AOM_BITS_8) {
         ref_txfm(coeff, ref, pitch_);
         ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
       } else {
-#if CONFIG_HIGHBITDEPTH
         ref_txfm(coeff, CONVERT_TO_BYTEPTR(ref16), pitch_);
         ASM_REGISTER_STATE_CHECK(
             RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_));
-#endif  // CONFIG_HIGHBITDEPTH
       }
 
       for (int j = 0; j < kNumCoeffs; ++j) {
-#if CONFIG_HIGHBITDEPTH
         const int diff =
             bit_depth_ == AOM_BITS_8 ? dst[j] - ref[j] : dst16[j] - ref16[j];
-#else
-        const int diff = dst[j] - ref[j];
-#endif  // CONFIG_HIGHBITDEPTH
         const uint32_t error = diff * diff;
         EXPECT_EQ(0u, error) << "Error: 16x16 IDCT Comparison has error "
                              << error << " at index " << j;
@@ -639,7 +599,6 @@
     pitch_ = 16;
     mask_ = (1 << bit_depth_) - 1;
     txfm_param_.tx_type = GET_PARAM(2);
-#if CONFIG_HIGHBITDEPTH
     switch (bit_depth_) {
       case AOM_BITS_10:
         fwd_txfm_ref = fht16x16_10;
@@ -654,10 +613,6 @@
         inv_txfm_ref = iht16x16_ref;
         break;
     }
-#else
-    fwd_txfm_ref = fht16x16_ref;
-    inv_txfm_ref = iht16x16_ref;
-#endif
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
@@ -732,12 +687,8 @@
 };
 
 TEST_P(PartialTrans16x16Test, Extremes) {
-#if CONFIG_HIGHBITDEPTH
   const int16_t maxval =
       static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
-#else
-  const int16_t maxval = 255;
-#endif
   const int minval = -maxval;
   DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
   DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
@@ -754,12 +705,8 @@
 }
 
 TEST_P(PartialTrans16x16Test, Random) {
-#if CONFIG_HIGHBITDEPTH
   const int16_t maxval =
       static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
-#else
-  const int16_t maxval = 255;
-#endif
   DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
   DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
   ACMRandom rnd(ACMRandom::DeterministicSeed());
@@ -777,19 +724,10 @@
 
 using std::tr1::make_tuple;
 
-#if CONFIG_HIGHBITDEPTH
 INSTANTIATE_TEST_CASE_P(C, Trans16x16DCT,
                         ::testing::Values(make_tuple(&aom_fdct16x16_c,
                                                      &aom_idct16x16_256_add_c,
                                                      DCT_DCT, AOM_BITS_8)));
-#else
-INSTANTIATE_TEST_CASE_P(C, Trans16x16DCT,
-                        ::testing::Values(make_tuple(&aom_fdct16x16_c,
-                                                     &aom_idct16x16_256_add_c,
-                                                     DCT_DCT, AOM_BITS_8)));
-#endif  // CONFIG_HIGHBITDEPTH
-
-#if CONFIG_HIGHBITDEPTH
 INSTANTIATE_TEST_CASE_P(
     C, Trans16x16HT,
     ::testing::Values(
@@ -809,46 +747,8 @@
                    AOM_BITS_8),
         make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c, ADST_ADST,
                    AOM_BITS_8)));
-#else
-INSTANTIATE_TEST_CASE_P(
-    C, Trans16x16HT,
-    ::testing::Values(make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c,
-                                 DCT_DCT, AOM_BITS_8),
-                      make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c,
-                                 ADST_DCT, AOM_BITS_8),
-                      make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c,
-                                 DCT_ADST, AOM_BITS_8),
-                      make_tuple(&av1_fht16x16_c, &av1_iht16x16_256_add_c,
-                                 ADST_ADST, AOM_BITS_8)));
-#endif  // CONFIG_HIGHBITDEPTH
 
-#if HAVE_NEON_ASM && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(
-    NEON, Trans16x16DCT,
-    ::testing::Values(make_tuple(&aom_fdct16x16_c, &aom_idct16x16_256_add_neon,
-                                 DCT_DCT, AOM_BITS_8)));
-#endif
-
-#if HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(SSE2, Trans16x16DCT,
-                        ::testing::Values(make_tuple(
-                            &aom_fdct16x16_sse2, &aom_idct16x16_256_add_sse2,
-                            DCT_DCT, AOM_BITS_8)));
-#if !CONFIG_DAALA_TX16
-INSTANTIATE_TEST_CASE_P(
-    SSE2, Trans16x16HT,
-    ::testing::Values(make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
-                                 DCT_DCT, AOM_BITS_8),
-                      make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
-                                 ADST_DCT, AOM_BITS_8),
-                      make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
-                                 DCT_ADST, AOM_BITS_8),
-                      make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2,
-                                 ADST_ADST, AOM_BITS_8)));
-#endif  // CONFIG_DAALA_TX16
-#endif  // HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
-
-#if HAVE_SSE2 && CONFIG_HIGHBITDEPTH
+#if HAVE_SSE2
 INSTANTIATE_TEST_CASE_P(SSE2, Trans16x16DCT,
                         ::testing::Values(make_tuple(&aom_fdct16x16_sse2,
                                                      &aom_idct16x16_256_add_c,
@@ -865,13 +765,6 @@
                       make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_c,
                                  ADST_ADST, AOM_BITS_8)));
 #endif
-#endif  // HAVE_SSE2 && CONFIG_HIGHBITDEPTH
-
-#if HAVE_MSA && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(MSA, Trans16x16DCT,
-                        ::testing::Values(make_tuple(&aom_fdct16x16_msa,
-                                                     &aom_idct16x16_256_add_msa,
-                                                     DCT_DCT, AOM_BITS_8)));
-#endif  // HAVE_MSA && !CONFIG_HIGHBITDEPTH
+#endif  // HAVE_SSE2
 }  // namespace
 #endif  // !CONFIG_DAALA_TX
diff --git a/test/dct32x32_test.cc b/test/dct32x32_test.cc
index 02a723a..97a705c 100644
--- a/test/dct32x32_test.cc
+++ b/test/dct32x32_test.cc
@@ -100,10 +100,8 @@
   DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]);
   DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
   DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
-#if CONFIG_HIGHBITDEPTH
   DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
   DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
-#endif
 
   for (int i = 0; i < count_test_block; ++i) {
     // Initialize a test block with input range [-mask_, mask_].
@@ -112,32 +110,24 @@
         src[j] = rnd.Rand8();
         dst[j] = rnd.Rand8();
         test_input_block[j] = src[j] - dst[j];
-#if CONFIG_HIGHBITDEPTH
       } else {
         src16[j] = rnd.Rand16() & mask_;
         dst16[j] = rnd.Rand16() & mask_;
         test_input_block[j] = src16[j] - dst16[j];
-#endif
       }
     }
 
     ASM_REGISTER_STATE_CHECK(fwd_txfm_(test_input_block, test_temp_block, 32));
     if (bit_depth_ == AOM_BITS_8) {
       ASM_REGISTER_STATE_CHECK(inv_txfm_(test_temp_block, dst, 32));
-#if CONFIG_HIGHBITDEPTH
     } else {
       ASM_REGISTER_STATE_CHECK(
           inv_txfm_(test_temp_block, CONVERT_TO_BYTEPTR(dst16), 32));
-#endif
     }
 
     for (int j = 0; j < kNumCoeffs; ++j) {
-#if CONFIG_HIGHBITDEPTH
       const int32_t diff =
           bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
-#else
-      const int32_t diff = dst[j] - src[j];
-#endif
       const uint32_t error = diff * diff;
       if (max_error < error) max_error = error;
       total_error += error;
@@ -233,10 +223,8 @@
   DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
   DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
   DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
-#if CONFIG_HIGHBITDEPTH
   DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
   DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
-#endif
 
   for (int i = 0; i < count_test_block; ++i) {
     double out_r[kNumCoeffs];
@@ -247,12 +235,10 @@
         src[j] = rnd.Rand8();
         dst[j] = rnd.Rand8();
         in[j] = src[j] - dst[j];
-#if CONFIG_HIGHBITDEPTH
       } else {
         src16[j] = rnd.Rand16() & mask_;
         dst16[j] = rnd.Rand16() & mask_;
         in[j] = src16[j] - dst16[j];
-#endif
       }
     }
 
@@ -261,18 +247,12 @@
       coeff[j] = static_cast<tran_low_t>(round(out_r[j]));
     if (bit_depth_ == AOM_BITS_8) {
       ASM_REGISTER_STATE_CHECK(inv_txfm_(coeff, dst, 32));
-#if CONFIG_HIGHBITDEPTH
     } else {
       ASM_REGISTER_STATE_CHECK(inv_txfm_(coeff, CONVERT_TO_BYTEPTR(dst16), 32));
-#endif
     }
     for (int j = 0; j < kNumCoeffs; ++j) {
-#if CONFIG_HIGHBITDEPTH
       const int diff =
           bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
-#else
-      const int diff = dst[j] - src[j];
-#endif
       const int error = diff * diff;
       EXPECT_GE(1, error) << "Error: 32x32 IDCT has error " << error
                           << " at index " << j;
@@ -298,12 +278,8 @@
 };
 
 TEST_P(PartialTrans32x32Test, Extremes) {
-#if CONFIG_HIGHBITDEPTH
   const int16_t maxval =
       static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
-#else
-  const int16_t maxval = 255;
-#endif
   const int minval = -maxval;
   DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
   DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
@@ -320,12 +296,8 @@
 }
 
 TEST_P(PartialTrans32x32Test, Random) {
-#if CONFIG_HIGHBITDEPTH
   const int16_t maxval =
       static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
-#else
-  const int16_t maxval = 255;
-#endif
   DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
   DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
   ACMRandom rnd(ACMRandom::DeterministicSeed());
@@ -343,44 +315,14 @@
 
 using std::tr1::make_tuple;
 
-#if CONFIG_HIGHBITDEPTH
 INSTANTIATE_TEST_CASE_P(
     C, Trans32x32Test,
     ::testing::Values(make_tuple(&aom_fdct32x32_c, &aom_idct32x32_1024_add_c, 0,
                                  AOM_BITS_8),
                       make_tuple(&aom_fdct32x32_rd_c, &aom_idct32x32_1024_add_c,
                                  1, AOM_BITS_8)));
-#else
-INSTANTIATE_TEST_CASE_P(
-    C, Trans32x32Test,
-    ::testing::Values(make_tuple(&aom_fdct32x32_c, &aom_idct32x32_1024_add_c, 0,
-                                 AOM_BITS_8),
-                      make_tuple(&aom_fdct32x32_rd_c, &aom_idct32x32_1024_add_c,
-                                 1, AOM_BITS_8)));
-#endif  // CONFIG_HIGHBITDEPTH
 
-#if HAVE_NEON && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(
-    NEON, Trans32x32Test,
-    ::testing::Values(make_tuple(&aom_fdct32x32_c, &aom_idct32x32_1024_add_neon,
-                                 DCT_DCT, AOM_BITS_8),
-                      make_tuple(&aom_fdct32x32_rd_c,
-                                 &aom_idct32x32_1024_add_neon, ADST_DCT,
-                                 AOM_BITS_8)));
-#endif  // HAVE_NEON && !CONFIG_HIGHBITDEPTH
-
-#if HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(
-    SSE2, Trans32x32Test,
-    ::testing::Values(make_tuple(&aom_fdct32x32_sse2,
-                                 &aom_idct32x32_1024_add_sse2, DCT_DCT,
-                                 AOM_BITS_8),
-                      make_tuple(&aom_fdct32x32_rd_sse2,
-                                 &aom_idct32x32_1024_add_sse2, ADST_DCT,
-                                 AOM_BITS_8)));
-#endif  // HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
-
-#if HAVE_SSE2 && CONFIG_HIGHBITDEPTH
+#if HAVE_SSE2
 INSTANTIATE_TEST_CASE_P(SSE2, Trans32x32Test,
                         ::testing::Values(make_tuple(&aom_fdct32x32_sse2,
                                                      &aom_idct32x32_1024_add_c,
@@ -388,9 +330,9 @@
                                           make_tuple(&aom_fdct32x32_rd_sse2,
                                                      &aom_idct32x32_1024_add_c,
                                                      ADST_DCT, AOM_BITS_8)));
-#endif  // HAVE_SSE2 && CONFIG_HIGHBITDEPTH
+#endif  // HAVE_SSE2
 
-#if HAVE_AVX2 && !CONFIG_HIGHBITDEPTH
+#if HAVE_AVX2
 INSTANTIATE_TEST_CASE_P(
     AVX2, Trans32x32Test,
     ::testing::Values(make_tuple(&aom_fdct32x32_avx2,
@@ -399,27 +341,5 @@
                       make_tuple(&aom_fdct32x32_rd_avx2,
                                  &aom_idct32x32_1024_add_sse2, ADST_DCT,
                                  AOM_BITS_8)));
-#endif  // HAVE_AVX2 && !CONFIG_HIGHBITDEPTH
-
-#if HAVE_AVX2 && CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(
-    AVX2, Trans32x32Test,
-    ::testing::Values(make_tuple(&aom_fdct32x32_avx2,
-                                 &aom_idct32x32_1024_add_sse2, DCT_DCT,
-                                 AOM_BITS_8),
-                      make_tuple(&aom_fdct32x32_rd_avx2,
-                                 &aom_idct32x32_1024_add_sse2, ADST_DCT,
-                                 AOM_BITS_8)));
-#endif  // HAVE_AVX2 && CONFIG_HIGHBITDEPTH
-
-#if HAVE_MSA && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(
-    MSA, Trans32x32Test,
-    ::testing::Values(make_tuple(&aom_fdct32x32_msa,
-                                 &aom_idct32x32_1024_add_msa, DCT_DCT,
-                                 AOM_BITS_8),
-                      make_tuple(&aom_fdct32x32_rd_msa,
-                                 &aom_idct32x32_1024_add_msa, ADST_DCT,
-                                 AOM_BITS_8)));
-#endif  // HAVE_MSA && !CONFIG_HIGHBITDEPTH
+#endif  // HAVE_AVX2
 }  // namespace
diff --git a/test/end_to_end_test.cc b/test/end_to_end_test.cc
index ebf92c4..0b96cb3 100644
--- a/test/end_to_end_test.cc
+++ b/test/end_to_end_test.cc
@@ -30,7 +30,7 @@
 // AV1 HBD average PSNR is slightly lower than AV1.
 // We make two cases here to enable the testing and
 // guard picture quality.
-#if CONFIG_AV1_ENCODER && CONFIG_HIGHBITDEPTH
+#if CONFIG_AV1_ENCODER
   { 36.0, 37.0, 37.0, 37.0, 37.0 }, { 31.0, 36.0, 36.0, 36.0, 36.0 },
   { 31.0, 35.0, 35.0, 35.0, 35.0 }, { 31.0, 34.0, 34.0, 34.0, 34.0 },
   { 31.0, 33.0, 33.0, 33.0, 33.0 }, { 31.0, 32.0, 32.0, 32.0, 32.0 },
@@ -40,7 +40,7 @@
   { 34.0, 35.0, 35.0, 35.0, 35.0 }, { 33.0, 34.0, 34.0, 34.0, 34.0 },
   { 32.0, 33.0, 33.0, 33.0, 33.0 }, { 31.0, 32.0, 32.0, 32.0, 32.0 },
   { 30.0, 31.0, 31.0, 31.0, 31.0 }, { 29.0, 30.0, 30.0, 30.0, 30.0 },
-#endif  // CONFIG_HIGHBITDEPTH && CONFIG_AV1_ENCODER
+#endif  // CONFIG_AV1_ENCODER
 };
 
 typedef struct {
@@ -56,7 +56,6 @@
   { "park_joy_90p_8_422.y4m", 8, AOM_IMG_FMT_I422, AOM_BITS_8, 1 },
   { "park_joy_90p_8_444.y4m", 8, AOM_IMG_FMT_I444, AOM_BITS_8, 1 },
   { "park_joy_90p_8_440.yuv", 8, AOM_IMG_FMT_I440, AOM_BITS_8, 1 },
-#if CONFIG_HIGHBITDEPTH
   { "park_joy_90p_10_420.y4m", 10, AOM_IMG_FMT_I42016, AOM_BITS_10, 2 },
   { "park_joy_90p_10_422.y4m", 10, AOM_IMG_FMT_I42216, AOM_BITS_10, 3 },
   { "park_joy_90p_10_444.y4m", 10, AOM_IMG_FMT_I44416, AOM_BITS_10, 3 },
@@ -65,7 +64,6 @@
   { "park_joy_90p_12_422.y4m", 12, AOM_IMG_FMT_I42216, AOM_BITS_12, 3 },
   { "park_joy_90p_12_444.y4m", 12, AOM_IMG_FMT_I44416, AOM_BITS_12, 3 },
   { "park_joy_90p_12_440.yuv", 12, AOM_IMG_FMT_I44016, AOM_BITS_12, 3 },
-#endif  // CONFIG_HIGHBITDEPTH
 };
 
 // Encoding modes tested
diff --git a/test/error_block_test.cc b/test/error_block_test.cc
index d1eac05..3f626a1 100644
--- a/test/error_block_test.cc
+++ b/test/error_block_test.cc
@@ -28,7 +28,6 @@
 using libaom_test::ACMRandom;
 
 namespace {
-#if CONFIG_HIGHBITDEPTH
 const int kNumIterations = 1000;
 
 typedef int64_t (*ErrorBlockFunc)(const tran_low_t *coeff,
@@ -168,6 +167,4 @@
                       make_tuple(&av1_highbd_block_error_sse2,
                                  &av1_highbd_block_error_c, AOM_BITS_8)));
 #endif  // HAVE_SSE2
-
-#endif  // CONFIG_HIGHBITDEPTH
 }  // namespace
diff --git a/test/fdct4x4_test.cc b/test/fdct4x4_test.cc
index bcb2fbe..669c40a 100644
--- a/test/fdct4x4_test.cc
+++ b/test/fdct4x4_test.cc
@@ -57,7 +57,6 @@
   av1_fwht4x4_c(in, out, stride);
 }
 
-#if CONFIG_HIGHBITDEPTH
 void fht4x4_10(const int16_t *in, tran_low_t *out, int stride,
                TxfmParam *txfm_param) {
   av1_fwd_txfm2d_4x4_c(in, out, stride, txfm_param->tx_type, 10);
@@ -87,7 +86,6 @@
 void iwht4x4_12(const tran_low_t *in, uint8_t *out, int stride) {
   aom_highbd_iwht4x4_16_add_c(in, out, stride, 12);
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 class Trans4x4DCT : public libaom_test::TransformTestBase,
                     public ::testing::TestWithParam<Dct4x4Param> {
@@ -142,13 +140,11 @@
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
     txfm_param_.tx_type = GET_PARAM(2);
-#if CONFIG_HIGHBITDEPTH
     switch (bit_depth_) {
       case AOM_BITS_10: fwd_txfm_ref = fht4x4_10; break;
       case AOM_BITS_12: fwd_txfm_ref = fht4x4_12; break;
       default: fwd_txfm_ref = fht4x4_ref; break;
     }
-#endif
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
@@ -216,7 +212,6 @@
                                                      &aom_idct4x4_16_add_c,
                                                      DCT_DCT, AOM_BITS_8, 16)));
 
-#if CONFIG_HIGHBITDEPTH
 INSTANTIATE_TEST_CASE_P(
     DISABLED_C, Trans4x4HT,
     ::testing::Values(
@@ -240,20 +235,7 @@
                    16),
         make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, ADST_ADST, AOM_BITS_8,
                    16)));
-#else
-INSTANTIATE_TEST_CASE_P(
-    C, Trans4x4HT,
-    ::testing::Values(make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, DCT_DCT,
-                                 AOM_BITS_8, 16),
-                      make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, ADST_DCT,
-                                 AOM_BITS_8, 16),
-                      make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, DCT_ADST,
-                                 AOM_BITS_8, 16),
-                      make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_c, ADST_ADST,
-                                 AOM_BITS_8, 16)));
-#endif  // CONFIG_HIGHBITDEPTH
 
-#if CONFIG_HIGHBITDEPTH
 INSTANTIATE_TEST_CASE_P(
     C, Trans4x4WHT,
     ::testing::Values(make_tuple(&av1_highbd_fwht4x4_c, &iwht4x4_10, DCT_DCT,
@@ -262,32 +244,6 @@
                                  AOM_BITS_12, 16),
                       make_tuple(&av1_fwht4x4_c, &aom_iwht4x4_16_add_c, DCT_DCT,
                                  AOM_BITS_8, 16)));
-#else
-INSTANTIATE_TEST_CASE_P(C, Trans4x4WHT,
-                        ::testing::Values(make_tuple(&av1_fwht4x4_c,
-                                                     &aom_iwht4x4_16_add_c,
-                                                     DCT_DCT, AOM_BITS_8, 16)));
-#endif  // CONFIG_HIGHBITDEPTH
-
-#if HAVE_NEON_ASM && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(NEON, Trans4x4DCT,
-                        ::testing::Values(make_tuple(&aom_fdct4x4_c,
-                                                     &aom_idct4x4_16_add_neon,
-                                                     DCT_DCT, AOM_BITS_8, 16)));
-#endif  // HAVE_NEON_ASM && !CONFIG_HIGHBITDEPTH
-
-#if HAVE_NEON && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(
-    NEON, Trans4x4HT,
-    ::testing::Values(make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon,
-                                 DCT_DCT, AOM_BITS_8, 16),
-                      make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon,
-                                 ADST_DCT, AOM_BITS_8, 16),
-                      make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon,
-                                 DCT_ADST, AOM_BITS_8, 16),
-                      make_tuple(&av1_fht4x4_c, &av1_iht4x4_16_add_neon,
-                                 ADST_ADST, AOM_BITS_8, 16)));
-#endif  // HAVE_NEON && !CONFIG_HIGHBITDEPTH
 
 #if HAVE_SSE2 && !CONFIG_DAALA_TX4
 INSTANTIATE_TEST_CASE_P(
@@ -298,26 +254,7 @@
                                  DCT_DCT, AOM_BITS_8, 16)));
 #endif
 
-#if HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(SSE2, Trans4x4DCT,
-                        ::testing::Values(make_tuple(&aom_fdct4x4_sse2,
-                                                     &aom_idct4x4_16_add_sse2,
-                                                     DCT_DCT, AOM_BITS_8, 16)));
-#if !CONFIG_DAALA_TX4
-INSTANTIATE_TEST_CASE_P(
-    SSE2, Trans4x4HT,
-    ::testing::Values(make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2,
-                                 DCT_DCT, AOM_BITS_8, 16),
-                      make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2,
-                                 ADST_DCT, AOM_BITS_8, 16),
-                      make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2,
-                                 DCT_ADST, AOM_BITS_8, 16),
-                      make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2,
-                                 ADST_ADST, AOM_BITS_8, 16)));
-#endif  // !CONFIG_DAALA_TX4
-#endif  // HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
-
-#if HAVE_SSE2 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_TX4
+#if HAVE_SSE2 && !CONFIG_DAALA_TX4
 INSTANTIATE_TEST_CASE_P(
     SSE2, Trans4x4HT,
     ::testing::Values(make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c,
@@ -328,13 +265,7 @@
                                  DCT_ADST, AOM_BITS_8, 16),
                       make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_c,
                                  ADST_ADST, AOM_BITS_8, 16)));
-#endif  // HAVE_SSE2 && CONFIG_HIGHBITDEPTH && !CONFIG_DAALA_TX4
+#endif  // HAVE_SSE2 && !CONFIG_DAALA_TX4
 
-#if HAVE_MSA && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(MSA, Trans4x4DCT,
-                        ::testing::Values(make_tuple(&aom_fdct4x4_msa,
-                                                     &aom_idct4x4_16_add_msa,
-                                                     DCT_DCT, AOM_BITS_8, 16)));
-#endif  // HAVE_MSA && !CONFIG_HIGHBITDEPTH
 }  // namespace
 #endif  // !CONFIG_DAALA_TX
diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc
index 2ad1afc..09e6e01 100644
--- a/test/fdct8x8_test.cc
+++ b/test/fdct8x8_test.cc
@@ -89,7 +89,6 @@
   av1_fht8x8_c(in, out, stride, txfm_param);
 }
 
-#if CONFIG_HIGHBITDEPTH
 void fht8x8_10(const int16_t *in, tran_low_t *out, int stride,
                TxfmParam *txfm_param) {
   av1_fwd_txfm2d_8x8_c(in, out, stride, txfm_param->tx_type, 10);
@@ -112,8 +111,6 @@
                            txfm_param->tx_type, 12);
 }
 
-#endif  // CONFIG_HIGHBITDEPTH
-
 class FwdTrans8x8TestBase {
  public:
   virtual ~FwdTrans8x8TestBase() {}
@@ -197,10 +194,8 @@
     DECLARE_ALIGNED(16, tran_low_t, test_temp_block[64]);
     DECLARE_ALIGNED(16, uint8_t, dst[64]);
     DECLARE_ALIGNED(16, uint8_t, src[64]);
-#if CONFIG_HIGHBITDEPTH
     DECLARE_ALIGNED(16, uint16_t, dst16[64]);
     DECLARE_ALIGNED(16, uint16_t, src16[64]);
-#endif
 
     for (int i = 0; i < count_test_block; ++i) {
       // Initialize a test block with input range [-mask_, mask_].
@@ -209,12 +204,10 @@
           src[j] = rnd.Rand8();
           dst[j] = rnd.Rand8();
           test_input_block[j] = src[j] - dst[j];
-#if CONFIG_HIGHBITDEPTH
         } else {
           src16[j] = rnd.Rand16() & mask_;
           dst16[j] = rnd.Rand16() & mask_;
           test_input_block[j] = src16[j] - dst16[j];
-#endif
         }
       }
 
@@ -233,20 +226,14 @@
       }
       if (bit_depth_ == AOM_BITS_8) {
         ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
-#if CONFIG_HIGHBITDEPTH
       } else {
         ASM_REGISTER_STATE_CHECK(
             RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
-#endif
       }
 
       for (int j = 0; j < 64; ++j) {
-#if CONFIG_HIGHBITDEPTH
         const int diff =
             bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
-#else
-        const int diff = dst[j] - src[j];
-#endif
         const int error = diff * diff;
         if (max_error < error) max_error = error;
         total_error += error;
@@ -273,10 +260,8 @@
     DECLARE_ALIGNED(16, tran_low_t, ref_temp_block[64]);
     DECLARE_ALIGNED(16, uint8_t, dst[64]);
     DECLARE_ALIGNED(16, uint8_t, src[64]);
-#if CONFIG_HIGHBITDEPTH
     DECLARE_ALIGNED(16, uint16_t, dst16[64]);
     DECLARE_ALIGNED(16, uint16_t, src16[64]);
-#endif
 
     for (int i = 0; i < count_test_block; ++i) {
       // Initialize a test block with input range [-mask_, mask_].
@@ -293,7 +278,6 @@
             dst[j] = rnd.Rand8() % 2 ? 255 : 0;
           }
           test_input_block[j] = src[j] - dst[j];
-#if CONFIG_HIGHBITDEPTH
         } else {
           if (i == 0) {
             src16[j] = mask_;
@@ -306,7 +290,6 @@
             dst16[j] = rnd.Rand8() % 2 ? mask_ : 0;
           }
           test_input_block[j] = src16[j] - dst16[j];
-#endif
         }
       }
 
@@ -316,20 +299,14 @@
           fwd_txfm_ref(test_input_block, ref_temp_block, pitch_, &txfm_param_));
       if (bit_depth_ == AOM_BITS_8) {
         ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
-#if CONFIG_HIGHBITDEPTH
       } else {
         ASM_REGISTER_STATE_CHECK(
             RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
-#endif
       }
 
       for (int j = 0; j < 64; ++j) {
-#if CONFIG_HIGHBITDEPTH
         const int diff =
             bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
-#else
-        const int diff = dst[j] - src[j];
-#endif
         const int error = diff * diff;
         if (max_error < error) max_error = error;
         total_error += error;
@@ -359,10 +336,8 @@
     DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
-#if CONFIG_HIGHBITDEPTH
     DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
-#endif
 
     for (int i = 0; i < count_test_block; ++i) {
       double out_r[kNumCoeffs];
@@ -373,12 +348,10 @@
           src[j] = rnd.Rand8() % 2 ? 255 : 0;
           dst[j] = src[j] > 0 ? 0 : 255;
           in[j] = src[j] - dst[j];
-#if CONFIG_HIGHBITDEPTH
         } else {
           src16[j] = rnd.Rand8() % 2 ? mask_ : 0;
           dst16[j] = src16[j] > 0 ? 0 : mask_;
           in[j] = src16[j] - dst16[j];
-#endif
         }
       }
 
@@ -388,20 +361,14 @@
 
       if (bit_depth_ == AOM_BITS_8) {
         ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
-#if CONFIG_HIGHBITDEPTH
       } else {
         ASM_REGISTER_STATE_CHECK(
             RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_));
-#endif
       }
 
       for (int j = 0; j < kNumCoeffs; ++j) {
-#if CONFIG_HIGHBITDEPTH
         const int diff =
             bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
-#else
-        const int diff = dst[j] - src[j];
-#endif
         const uint32_t error = diff * diff;
         EXPECT_GE(1u << 2 * (bit_depth_ - 8), error)
             << "Error: 8x8 IDCT has error " << error << " at index " << j;
@@ -444,10 +411,8 @@
     DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
-#if CONFIG_HIGHBITDEPTH
     DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
     DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
-#endif
     const int16_t *scan = av1_default_scan_orders[TX_8X8].scan;
 
     for (int i = 0; i < count_test_block; ++i) {
@@ -461,31 +426,23 @@
         if (bit_depth_ == AOM_BITS_8) {
           dst[j] = 0;
           ref[j] = 0;
-#if CONFIG_HIGHBITDEPTH
         } else {
           dst16[j] = 0;
           ref16[j] = 0;
-#endif
         }
       }
       if (bit_depth_ == AOM_BITS_8) {
         ref_txfm(coeff, ref, pitch_);
         ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
-#if CONFIG_HIGHBITDEPTH
       } else {
         ref_txfm(coeff, CONVERT_TO_BYTEPTR(ref16), pitch_);
         ASM_REGISTER_STATE_CHECK(
             RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_));
-#endif
       }
 
       for (int j = 0; j < kNumCoeffs; ++j) {
-#if CONFIG_HIGHBITDEPTH
         const int diff =
             bit_depth_ == AOM_BITS_8 ? dst[j] - ref[j] : dst16[j] - ref16[j];
-#else
-        const int diff = dst[j] - ref[j];
-#endif
         const uint32_t error = diff * diff;
         EXPECT_EQ(0u, error)
             << "Error: 8x8 IDCT has error " << error << " at index " << j;
@@ -551,13 +508,11 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     txfm_param_.tx_type = GET_PARAM(2);
-#if CONFIG_HIGHBITDEPTH
     switch (bit_depth_) {
       case AOM_BITS_10: fwd_txfm_ref = fht8x8_10; break;
       case AOM_BITS_12: fwd_txfm_ref = fht8x8_12; break;
       default: fwd_txfm_ref = fht8x8_ref; break;
     }
-#endif
   }
 
   virtual void TearDown() { libaom_test::ClearSystemState(); }
@@ -613,19 +568,11 @@
 
 using std::tr1::make_tuple;
 
-#if CONFIG_HIGHBITDEPTH
 INSTANTIATE_TEST_CASE_P(C, FwdTrans8x8DCT,
                         ::testing::Values(make_tuple(&aom_fdct8x8_c,
                                                      &aom_idct8x8_64_add_c,
                                                      DCT_DCT, AOM_BITS_8)));
-#else
-INSTANTIATE_TEST_CASE_P(C, FwdTrans8x8DCT,
-                        ::testing::Values(make_tuple(&aom_fdct8x8_c,
-                                                     &aom_idct8x8_64_add_c,
-                                                     DCT_DCT, AOM_BITS_8)));
-#endif  // CONFIG_HIGHBITDEPTH
 
-#if CONFIG_HIGHBITDEPTH
 INSTANTIATE_TEST_CASE_P(
     C, FwdTrans8x8HT,
     ::testing::Values(
@@ -642,57 +589,8 @@
         make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, DCT_ADST, AOM_BITS_8),
         make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, ADST_ADST,
                    AOM_BITS_8)));
-#else
-INSTANTIATE_TEST_CASE_P(
-    C, FwdTrans8x8HT,
-    ::testing::Values(
-        make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, DCT_DCT, AOM_BITS_8),
-        make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, ADST_DCT, AOM_BITS_8),
-        make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, DCT_ADST, AOM_BITS_8),
-        make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_c, ADST_ADST,
-                   AOM_BITS_8)));
-#endif  // CONFIG_HIGHBITDEPTH
 
-#if HAVE_NEON_ASM && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(NEON, FwdTrans8x8DCT,
-                        ::testing::Values(make_tuple(&aom_fdct8x8_neon,
-                                                     &aom_idct8x8_64_add_neon,
-                                                     DCT_DCT, AOM_BITS_8)));
-#endif  // HAVE_NEON_ASM && !CONFIG_HIGHBITDEPTH
-
-#if HAVE_NEON && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(
-    NEON, FwdTrans8x8HT,
-    ::testing::Values(make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon,
-                                 DCT_DCT, AOM_BITS_8),
-                      make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon,
-                                 ADST_DCT, AOM_BITS_8),
-                      make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon,
-                                 DCT_ADST, AOM_BITS_8),
-                      make_tuple(&av1_fht8x8_c, &av1_iht8x8_64_add_neon,
-                                 ADST_ADST, AOM_BITS_8)));
-#endif  // HAVE_NEON && !CONFIG_HIGHBITDEPTH
-
-#if HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(SSE2, FwdTrans8x8DCT,
-                        ::testing::Values(make_tuple(&aom_fdct8x8_sse2,
-                                                     &aom_idct8x8_64_add_sse2,
-                                                     DCT_DCT, AOM_BITS_8)));
-#if !CONFIG_DAALA_TX8
-INSTANTIATE_TEST_CASE_P(
-    SSE2, FwdTrans8x8HT,
-    ::testing::Values(make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2,
-                                 DCT_DCT, AOM_BITS_8),
-                      make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2,
-                                 ADST_DCT, AOM_BITS_8),
-                      make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2,
-                                 DCT_ADST, AOM_BITS_8),
-                      make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2,
-                                 ADST_ADST, AOM_BITS_8)));
-#endif  // !CONFIG_DAALA_TX8
-#endif  // HAVE_SSE2 && !CONFIG_HIGHBITDEPTH
-
-#if HAVE_SSE2 && CONFIG_HIGHBITDEPTH
+#if HAVE_SSE2
 INSTANTIATE_TEST_CASE_P(SSE2, FwdTrans8x8DCT,
                         ::testing::Values(make_tuple(&aom_fdct8x8_sse2,
                                                      &aom_idct8x8_64_add_c,
@@ -709,7 +607,7 @@
                       make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_c,
                                  ADST_ADST, AOM_BITS_8)));
 #endif  // !CONFIG_DAALA_TX8
-#endif  // HAVE_SSE2 && CONFIG_HIGHBITDEPTH
+#endif  // HAVE_SSE2
 
 #if HAVE_SSSE3 && ARCH_X86_64
 INSTANTIATE_TEST_CASE_P(SSSE3, FwdTrans8x8DCT,
@@ -718,11 +616,5 @@
                                                      DCT_DCT, AOM_BITS_8)));
 #endif
 
-#if HAVE_MSA && !CONFIG_HIGHBITDEPTH
-INSTANTIATE_TEST_CASE_P(MSA, FwdTrans8x8DCT,
-                        ::testing::Values(make_tuple(&aom_fdct8x8_msa,
-                                                     &aom_idct8x8_64_add_msa,
-                                                     DCT_DCT, AOM_BITS_8)));
-#endif  // HAVE_MSA && !CONFIG_HIGHBITDEPTH
 }  // namespace
 #endif  // !CONFIG_DAALA_TX
diff --git a/test/hiprec_convolve_test.cc b/test/hiprec_convolve_test.cc
index 78e109c..177fba2 100644
--- a/test/hiprec_convolve_test.cc
+++ b/test/hiprec_convolve_test.cc
@@ -16,9 +16,7 @@
 using std::tr1::make_tuple;
 using libaom_test::ACMRandom;
 using libaom_test::AV1HiprecConvolve::AV1HiprecConvolveTest;
-#if CONFIG_HIGHBITDEPTH
 using libaom_test::AV1HighbdHiprecConvolve::AV1HighbdHiprecConvolveTest;
-#endif
 
 namespace {
 
@@ -30,7 +28,7 @@
                             aom_convolve8_add_src_hip_sse2));
 #endif
 
-#if CONFIG_HIGHBITDEPTH && HAVE_SSSE3
+#if HAVE_SSSE3
 TEST_P(AV1HighbdHiprecConvolveTest, CheckOutput) {
   RunCheckOutput(GET_PARAM(4));
 }
diff --git a/test/hiprec_convolve_test_util.cc b/test/hiprec_convolve_test_util.cc
index 4dee6ab..fe4cae0 100644
--- a/test/hiprec_convolve_test_util.cc
+++ b/test/hiprec_convolve_test_util.cc
@@ -110,7 +110,6 @@
 }
 }  // namespace AV1HiprecConvolve
 
-#if CONFIG_HIGHBITDEPTH
 namespace AV1HighbdHiprecConvolve {
 
 ::testing::internal::ParamGenerator<HighbdHiprecConvolveParam> BuildParams(
@@ -184,5 +183,4 @@
   delete[] output2;
 }
 }  // namespace AV1HighbdHiprecConvolve
-#endif  // CONFIG_HIGHBITDEPTH
 }  // namespace libaom_test
diff --git a/test/hiprec_convolve_test_util.h b/test/hiprec_convolve_test_util.h
index fe31570..5c71dbf 100644
--- a/test/hiprec_convolve_test_util.h
+++ b/test/hiprec_convolve_test_util.h
@@ -54,7 +54,6 @@
 
 }  // namespace AV1HiprecConvolve
 
-#if CONFIG_HIGHBITDEPTH
 namespace AV1HighbdHiprecConvolve {
 typedef void (*highbd_hiprec_convolve_func)(
     const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst,
@@ -82,7 +81,6 @@
 };
 
 }  // namespace AV1HighbdHiprecConvolve
-#endif  // CONFIG_HIGHBITDEPTH
 
 }  // namespace libaom_test
 
diff --git a/test/intrapred_test.cc b/test/intrapred_test.cc
index baa0c15..a616f6c 100644
--- a/test/intrapred_test.cc
+++ b/test/intrapred_test.cc
@@ -180,7 +180,6 @@
       highbd_entry(type, 32, 16, opt, bd), highbd_entry(type, 32, 32, opt, bd)
 */
 
-#if CONFIG_HIGHBITDEPTH
 #if HAVE_SSE2
 const IntraPredFunc<HighbdIntraPred> IntraPredTestVector8[] = {
   // highbd_intrapred(dc, sse2, 8),     highbd_intrapred(dc_left, sse2, 8),
@@ -318,7 +317,6 @@
 INSTANTIATE_TEST_CASE_P(AVX2_TO_C_12, HighbdIntraPredTest,
                         ::testing::ValuesIn(IntraPredTestVectorAvx2_12));
 #endif  // HAVE_AVX2
-#endif  // CONFIG_HIGHBITDEPTH
 
 // -----------------------------------------------------------------------------
 // Low Bit Depth Tests
diff --git a/test/lpf_test.cc b/test/lpf_test.cc
index d1689f9..7da4111 100644
--- a/test/lpf_test.cc
+++ b/test/lpf_test.cc
@@ -37,7 +37,6 @@
 
 const int kSpeedTestNum = 500000;
 
-#if CONFIG_HIGHBITDEPTH
 typedef uint16_t Pixel;
 #define PIXEL_WIDTH 16
 
@@ -47,17 +46,6 @@
                                const uint8_t *limit0, const uint8_t *thresh0,
                                const uint8_t *blimit1, const uint8_t *limit1,
                                const uint8_t *thresh1, int bd);
-#else
-typedef uint8_t Pixel;
-#define PIXEL_WIDTH 8
-
-typedef void (*loop_op_t)(Pixel *s, int p, const uint8_t *blimit,
-                          const uint8_t *limit, const uint8_t *thresh);
-typedef void (*dual_loop_op_t)(Pixel *s, int p, const uint8_t *blimit0,
-                               const uint8_t *limit0, const uint8_t *thresh0,
-                               const uint8_t *blimit1, const uint8_t *limit1,
-                               const uint8_t *thresh1);
-#endif  // CONFIG_HIGHBITDEPTH
 
 typedef std::tr1::tuple<loop_op_t, loop_op_t, int> loop8_param_t;
 typedef std::tr1::tuple<dual_loop_op_t, dual_loop_op_t, int> dualloop8_param_t;
@@ -190,15 +178,9 @@
                     thresh[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                     tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
     InitInput(s, ref_s, &rnd, *limit, mask_, p, i);
-#if CONFIG_HIGHBITDEPTH
     ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_);
     ASM_REGISTER_STATE_CHECK(
         loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_));
-#else
-    ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh);
-    ASM_REGISTER_STATE_CHECK(
-        loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh));
-#endif  // CONFIG_HIGHBITDEPTH
 
     for (int j = 0; j < kNumCoeffs; ++j) {
       err_count += ref_s[j] != s[j];
@@ -253,15 +235,9 @@
       s[j] = rnd.Rand16() & mask_;
       ref_s[j] = s[j];
     }
-#if CONFIG_HIGHBITDEPTH
     ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_);
     ASM_REGISTER_STATE_CHECK(
         loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bit_depth_));
-#else
-    ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh);
-    ASM_REGISTER_STATE_CHECK(
-        loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh));
-#endif  // CONFIG_HIGHBITDEPTH
 
     for (int j = 0; j < kNumCoeffs; ++j) {
       err_count += ref_s[j] != s[j];
@@ -280,12 +256,8 @@
 TEST_P(Loop8Test6Param, DISABLED_Speed) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   const int count_test_block = kSpeedTestNum;
-#if CONFIG_HIGHBITDEPTH
   const int32_t bd = bit_depth_;
   DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]);
-#else
-  DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
-#endif  // CONFIG_HIGHBITDEPTH
 
   uint8_t tmp = GetOuterThresh(&rnd);
   DECLARE_ALIGNED(16, const uint8_t,
@@ -306,11 +278,7 @@
   }
 
   for (int i = 0; i < count_test_block; ++i) {
-#if CONFIG_HIGHBITDEPTH
     loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bd);
-#else
-    loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh);
-#endif  // CONFIG_HIGHBITDEPTH
   }
 }
 
@@ -350,18 +318,11 @@
     int32_t p = kNumCoeffs / 32;
     const uint8_t limit = *limit0 < *limit1 ? *limit0 : *limit1;
     InitInput(s, ref_s, &rnd, limit, mask_, p, i);
-#if CONFIG_HIGHBITDEPTH
     ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
                        limit1, thresh1, bit_depth_);
     ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
                                             thresh0, blimit1, limit1, thresh1,
                                             bit_depth_));
-#else
-    ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
-                       limit1, thresh1);
-    ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
-                                            thresh0, blimit1, limit1, thresh1));
-#endif  // CONFIG_HIGHBITDEPTH
 
     for (int j = 0; j < kNumCoeffs; ++j) {
       err_count += ref_s[j] != s[j];
@@ -415,18 +376,11 @@
       s[j] = rnd.Rand16() & mask_;
       ref_s[j] = s[j];
     }
-#if CONFIG_HIGHBITDEPTH
     ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
                        limit1, thresh1, bit_depth_);
     ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
                                             thresh0, blimit1, limit1, thresh1,
                                             bit_depth_));
-#else
-    ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1,
-                       limit1, thresh1);
-    ASM_REGISTER_STATE_CHECK(loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0,
-                                            thresh0, blimit1, limit1, thresh1));
-#endif  // CONFIG_HIGHBITDEPTH
 
     for (int j = 0; j < kNumCoeffs; ++j) {
       err_count += ref_s[j] != s[j];
@@ -445,11 +399,7 @@
 TEST_P(Loop8Test9Param, DISABLED_Speed) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   const int count_test_block = kSpeedTestNum;
-#if CONFIG_HIGHBITDEPTH
   DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]);
-#else
-  DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]);
-#endif  // CONFIG_HIGHBITDEPTH
 
   uint8_t tmp = GetOuterThresh(&rnd);
   DECLARE_ALIGNED(16, const uint8_t,
@@ -481,21 +431,15 @@
   }
 
   for (int i = 0; i < count_test_block; ++i) {
-#if CONFIG_HIGHBITDEPTH
     const int32_t bd = bit_depth_;
     loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, limit1,
                    thresh1, bd);
-#else
-    loopfilter_op_(s + 8 + p * 8, p, blimit0, limit0, thresh0, blimit1, limit1,
-                   thresh1);
-#endif  // CONFIG_HIGHBITDEPTH
   }
 }
 
 using std::tr1::make_tuple;
 
 #if HAVE_SSE2
-#if CONFIG_HIGHBITDEPTH
 
 const loop8_param_t kHbdLoop8Test6[] = {
   make_tuple(&aom_highbd_lpf_horizontal_4_sse2, &aom_highbd_lpf_horizontal_4_c,
@@ -566,37 +510,9 @@
 
 INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test6Param,
                         ::testing::ValuesIn(kHbdLoop8Test6));
-#else
-const loop8_param_t kLoop8Test6[] = {
-  make_tuple(&aom_lpf_horizontal_4_sse2, &aom_lpf_horizontal_4_c, 8),
-  make_tuple(&aom_lpf_horizontal_8_sse2, &aom_lpf_horizontal_8_c, 8),
-#if !CONFIG_DEBLOCK_13TAP
-  // Despite the name the following funcition is doing 15-tap filtering
-  // which is changed to 13-tap and not yet implemented in SIMD
-  make_tuple(&aom_lpf_horizontal_16_sse2, &aom_lpf_horizontal_16_c, 8),
-#endif
-#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
-  make_tuple(&aom_lpf_horizontal_16_dual_sse2, &aom_lpf_horizontal_16_dual_c,
-             8),
-#endif
-  make_tuple(&aom_lpf_vertical_4_sse2, &aom_lpf_vertical_4_c, 8),
-  make_tuple(&aom_lpf_vertical_8_sse2, &aom_lpf_vertical_8_c, 8),
-#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
-  make_tuple(&aom_lpf_vertical_16_sse2, &aom_lpf_vertical_16_c, 8),
-#endif
-#if !CONFIG_PARALLEL_DEBLOCKING
-  make_tuple(&aom_lpf_vertical_16_dual_sse2, &aom_lpf_vertical_16_dual_c, 8)
-#endif
-};
-
-INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test6Param,
-                        ::testing::ValuesIn(kLoop8Test6));
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // HAVE_SSE2
 
 #if HAVE_AVX2
-#if CONFIG_HIGHBITDEPTH
-
 #if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
 const loop8_param_t kHbdLoop8Test6Avx2[] = {
   make_tuple(&aom_highbd_lpf_horizontal_16_dual_avx2,
@@ -618,21 +534,8 @@
 
 #endif
 #endif
-#endif
-
-#if HAVE_AVX2 && (!CONFIG_HIGHBITDEPTH) && (!CONFIG_PARALLEL_DEBLOCKING)
-INSTANTIATE_TEST_CASE_P(AVX2, Loop8Test6Param,
-                        ::testing::Values(
-#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
-                            make_tuple(&aom_lpf_horizontal_16_dual_avx2,
-                                       &aom_lpf_horizontal_16_dual_c, 8),
-#endif
-                            make_tuple(&aom_lpf_horizontal_16_avx2,
-                                       &aom_lpf_horizontal_16_c, 8)));
-#endif
 
 #if HAVE_SSE2
-#if CONFIG_HIGHBITDEPTH
 const dualloop8_param_t kHbdLoop8Test9[] = {
   make_tuple(&aom_highbd_lpf_horizontal_4_dual_sse2,
              &aom_highbd_lpf_horizontal_4_dual_c, 8),
@@ -662,23 +565,9 @@
 
 INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test9Param,
                         ::testing::ValuesIn(kHbdLoop8Test9));
-#else
-#if !CONFIG_PARALLEL_DEBLOCKING
-const dualloop8_param_t kLoop8Test9[] = {
-  make_tuple(&aom_lpf_horizontal_4_dual_sse2, &aom_lpf_horizontal_4_dual_c, 8),
-  make_tuple(&aom_lpf_horizontal_8_dual_sse2, &aom_lpf_horizontal_8_dual_c, 8),
-  make_tuple(&aom_lpf_vertical_4_dual_sse2, &aom_lpf_vertical_4_dual_c, 8),
-  make_tuple(&aom_lpf_vertical_8_dual_sse2, &aom_lpf_vertical_8_dual_c, 8)
-};
-
-INSTANTIATE_TEST_CASE_P(SSE2, Loop8Test9Param,
-                        ::testing::ValuesIn(kLoop8Test9));
-#endif
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // HAVE_SSE2
 
 #if HAVE_AVX2
-#if CONFIG_HIGHBITDEPTH
 const dualloop8_param_t kHbdLoop8Test9Avx2[] = {
   make_tuple(&aom_highbd_lpf_horizontal_4_dual_avx2,
              &aom_highbd_lpf_horizontal_4_dual_c, 8),
@@ -709,100 +598,5 @@
 INSTANTIATE_TEST_CASE_P(AVX2, Loop8Test9Param,
                         ::testing::ValuesIn(kHbdLoop8Test9Avx2));
 #endif
-#endif
-
-#if HAVE_NEON && (!CONFIG_PARALLEL_DEBLOCKING)
-#if CONFIG_HIGHBITDEPTH
-// No neon high bitdepth functions.
-#else
-INSTANTIATE_TEST_CASE_P(
-    NEON, Loop8Test6Param,
-    ::testing::Values(
-#if HAVE_NEON_ASM
-        // Using #if inside the macro is unsupported on MSVS but the tests are
-        // not
-        // currently built for MSVS with ARM and NEON.
-        make_tuple(&aom_lpf_horizontal_16_neon, &aom_lpf_horizontal_16_c, 8),
-#if !CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
-        make_tuple(&aom_lpf_horizontal_16_dual_neon,
-                   &aom_lpf_horizontal_16_dual_c, 8),
-        make_tuple(&aom_lpf_vertical_16_neon, &aom_lpf_vertical_16_c, 8),
-        make_tuple(&aom_lpf_vertical_16_dual_neon, &aom_lpf_vertical_16_dual_c,
-                   8),
-#endif
-#endif  // HAVE_NEON_ASM
-        make_tuple(&aom_lpf_horizontal_8_neon, &aom_lpf_horizontal_8_c, 8),
-        make_tuple(&aom_lpf_vertical_8_neon, &aom_lpf_vertical_8_c, 8),
-        make_tuple(&aom_lpf_horizontal_4_neon, &aom_lpf_horizontal_4_c, 8),
-        make_tuple(&aom_lpf_vertical_4_neon, &aom_lpf_vertical_4_c, 8)));
-INSTANTIATE_TEST_CASE_P(NEON, Loop8Test9Param,
-                        ::testing::Values(
-#if HAVE_NEON_ASM
-                            make_tuple(&aom_lpf_horizontal_8_dual_neon,
-                                       &aom_lpf_horizontal_8_dual_c, 8),
-                            make_tuple(&aom_lpf_vertical_8_dual_neon,
-                                       &aom_lpf_vertical_8_dual_c, 8),
-#endif  // HAVE_NEON_ASM
-                            make_tuple(&aom_lpf_horizontal_4_dual_neon,
-                                       &aom_lpf_horizontal_4_dual_c, 8),
-                            make_tuple(&aom_lpf_vertical_4_dual_neon,
-                                       &aom_lpf_vertical_4_dual_c, 8)));
-#endif  // CONFIG_HIGHBITDEPTH
-#endif  // HAVE_NEON && (!CONFIG_PARALLEL_DEBLOCKING)
-
-#if HAVE_DSPR2 && !CONFIG_HIGHBITDEPTH && (!CONFIG_PARALLEL_DEBLOCKING)
-INSTANTIATE_TEST_CASE_P(
-    DSPR2, Loop8Test6Param,
-    ::testing::Values(
-        make_tuple(&aom_lpf_horizontal_4_dspr2, &aom_lpf_horizontal_4_c, 8),
-        make_tuple(&aom_lpf_horizontal_8_dspr2, &aom_lpf_horizontal_8_c, 8),
-        make_tuple(&aom_lpf_horizontal_16, &aom_lpf_horizontal_16, 8),
-        make_tuple(&aom_lpf_horizontal_16_dual, &aom_lpf_horizontal_16_dual, 8),
-        make_tuple(&aom_lpf_vertical_4_dspr2, &aom_lpf_vertical_4_c, 8),
-#if CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
-        make_tuple(&aom_lpf_vertical_16_dspr2, &aom_lpf_vertical_16_c, 8),
-        make_tuple(&aom_lpf_vertical_16_dual_dspr2, &aom_lpf_vertical_16_dual_c,
-                   8),
-#endif
-        make_tuple(&aom_lpf_vertical_8_dspr2, &aom_lpf_vertical_8_c, 8)));
-
-INSTANTIATE_TEST_CASE_P(
-    DSPR2, Loop8Test9Param,
-    ::testing::Values(make_tuple(&aom_lpf_horizontal_4_dual_dspr2,
-                                 &aom_lpf_horizontal_4_dual_c, 8),
-                      make_tuple(&aom_lpf_horizontal_8_dual_dspr2,
-                                 &aom_lpf_horizontal_8_dual_c, 8),
-                      make_tuple(&aom_lpf_vertical_4_dual_dspr2,
-                                 &aom_lpf_vertical_4_dual_c, 8),
-                      make_tuple(&aom_lpf_vertical_8_dual_dspr2,
-                                 &aom_lpf_vertical_8_dual_c, 8)));
-#endif  // HAVE_DSPR2 && !CONFIG_HIGHBITDEPTH && (!CONFIG_PARALLEL_DEBLOCKING)
-
-#if HAVE_MSA && (!CONFIG_HIGHBITDEPTH) && (!CONFIG_PARALLEL_DEBLOCKING)
-INSTANTIATE_TEST_CASE_P(
-    MSA, Loop8Test6Param,
-    ::testing::Values(
-        make_tuple(&aom_lpf_horizontal_4_msa, &aom_lpf_horizontal_4_c, 8),
-        make_tuple(&aom_lpf_horizontal_8_msa, &aom_lpf_horizontal_8_c, 8),
-        make_tuple(&aom_lpf_horizontal_16_msa, &aom_lpf_horizontal_16_c, 8),
-#if CONFIG_DEBLOCK_13TAP  // No SIMD implementation for deblock_13tap yet
-        make_tuple(&aom_lpf_horizontal_16_dual_msa,
-                   &aom_lpf_horizontal_16_dual_c, 8),
-        make_tuple(&aom_lpf_vertical_16_msa, &aom_lpf_vertical_16_c, 8),
-#endif
-        make_tuple(&aom_lpf_vertical_4_msa, &aom_lpf_vertical_4_c, 8),
-        make_tuple(&aom_lpf_vertical_8_msa, &aom_lpf_vertical_8_c, 8)));
-
-INSTANTIATE_TEST_CASE_P(
-    MSA, Loop8Test9Param,
-    ::testing::Values(make_tuple(&aom_lpf_horizontal_4_dual_msa,
-                                 &aom_lpf_horizontal_4_dual_c, 8),
-                      make_tuple(&aom_lpf_horizontal_8_dual_msa,
-                                 &aom_lpf_horizontal_8_dual_c, 8),
-                      make_tuple(&aom_lpf_vertical_4_dual_msa,
-                                 &aom_lpf_vertical_4_dual_c, 8),
-                      make_tuple(&aom_lpf_vertical_8_dual_msa,
-                                 &aom_lpf_vertical_8_dual_c, 8)));
-#endif  // HAVE_MSA && (!CONFIG_HIGHBITDEPTH) && (!CONFIG_PARALLEL_DEBLOCKING)
 
 }  // namespace
diff --git a/test/masked_sad_test.cc b/test/masked_sad_test.cc
index 19f9771..928b47e 100644
--- a/test/masked_sad_test.cc
+++ b/test/masked_sad_test.cc
@@ -89,7 +89,6 @@
       << "First failed at test case " << first_failure;
 }
 
-#if CONFIG_HIGHBITDEPTH
 typedef unsigned int (*HighbdMaskedSADFunc)(const uint8_t *src, int src_stride,
                                             const uint8_t *ref, int ref_stride,
                                             const uint8_t *second_pred,
@@ -155,7 +154,6 @@
       << "Error: High BD Masked SAD Test, C output doesn't match SSSE3 output. "
       << "First failed at test case " << first_failure;
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 using std::tr1::make_tuple;
 
@@ -183,7 +181,6 @@
 
 INSTANTIATE_TEST_CASE_P(SSSE3_C_COMPARE, MaskedSADTest,
                         ::testing::ValuesIn(msad_test));
-#if CONFIG_HIGHBITDEPTH
 const HighbdMaskedSADParam hbd_msad_test[] = {
 #if CONFIG_EXT_PARTITION
   make_tuple(&aom_highbd_masked_sad128x128_ssse3,
@@ -210,6 +207,5 @@
 
 INSTANTIATE_TEST_CASE_P(SSSE3_C_COMPARE, HighbdMaskedSADTest,
                         ::testing::ValuesIn(hbd_msad_test));
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // HAVE_SSSE3
 }  // namespace
diff --git a/test/masked_variance_test.cc b/test/masked_variance_test.cc
index a9cbdc8..d01a84b 100644
--- a/test/masked_variance_test.cc
+++ b/test/masked_variance_test.cc
@@ -169,7 +169,6 @@
                           << " y_offset = " << first_failure_y;
 }
 
-#if CONFIG_HIGHBITDEPTH
 typedef std::tr1::tuple<MaskedSubPixelVarianceFunc, MaskedSubPixelVarianceFunc,
                         aom_bit_depth_t>
     HighbdMaskedSubPixelVarianceParam;
@@ -311,7 +310,6 @@
                           << " x_offset = " << first_failure_x
                           << " y_offset = " << first_failure_y;
 }
-#endif  // CONFIG_HIGHBITDEPTH
 
 using std::tr1::make_tuple;
 
@@ -357,7 +355,6 @@
 INSTANTIATE_TEST_CASE_P(SSSE3_C_COMPARE, MaskedSubPixelVarianceTest,
                         ::testing::ValuesIn(sub_pel_var_test));
 
-#if CONFIG_HIGHBITDEPTH
 const HighbdMaskedSubPixelVarianceParam hbd_sub_pel_var_test[] = {
 #if CONFIG_EXT_PARTITION
   make_tuple(&aom_highbd_8_masked_sub_pixel_variance128x128_ssse3,
@@ -465,7 +462,5 @@
 
 INSTANTIATE_TEST_CASE_P(SSSE3_C_COMPARE, HighbdMaskedSubPixelVarianceTest,
                         ::testing::ValuesIn(hbd_sub_pel_var_test));
-#endif  // CONFIG_HIGHBITDEPTH
-
 #endif  // HAVE_SSSE3
 }  // namespace
diff --git a/test/obmc_sad_test.cc b/test/obmc_sad_test.cc
index d74b590..317f0f5 100644
--- a/test/obmc_sad_test.cc
+++ b/test/obmc_sad_test.cc
@@ -113,7 +113,6 @@
 // High bit-depth
 ////////////////////////////////////////////////////////////////////////////////
 
-#if CONFIG_HIGHBITDEPTH
 class ObmcSadHBDTest : public FunctionEquivalenceTest<ObmcSadF> {};
 
 TEST_P(ObmcSadHBDTest, RandomValues) {
@@ -191,5 +190,4 @@
 INSTANTIATE_TEST_CASE_P(SSE4_1, ObmcSadHBDTest,
                         ::testing::ValuesIn(sse4_functions_hbd));
 #endif  // HAVE_SSE4_1
-#endif  // CONFIG_HIGHBITDEPTH
 }  // namespace
diff --git a/test/obmc_variance_test.cc b/test/obmc_variance_test.cc
index a41ba7d..ed6c4c1 100644
--- a/test/obmc_variance_test.cc
+++ b/test/obmc_variance_test.cc
@@ -122,7 +122,6 @@
 // High bit-depth
 ////////////////////////////////////////////////////////////////////////////////
 
-#if CONFIG_HIGHBITDEPTH
 class ObmcVarianceHBDTest : public FunctionEquivalenceTest<ObmcVarF> {};
 
 TEST_P(ObmcVarianceHBDTest, RandomValues) {
@@ -289,5 +288,4 @@
 INSTANTIATE_TEST_CASE_P(SSE4_1, ObmcVarianceHBDTest,
                         ::testing::ValuesIn(sse4_functions_hbd));
 #endif  // HAVE_SSE4_1
-#endif  // CONFIG_HIGHBITDEPTH
 }  // namespace
diff --git a/test/partial_idct_test.cc b/test/partial_idct_test.cc
index b2ea176..13249a6 100644
--- a/test/partial_idct_test.cc
+++ b/test/partial_idct_test.cc
@@ -309,26 +309,6 @@
 INSTANTIATE_TEST_CASE_P(C, PartialIDctTest,
                         ::testing::ValuesIn(c_partial_idct_tests));
 
-#if HAVE_NEON && !CONFIG_HIGHBITDEPTH
-const PartialInvTxfmParam neon_partial_idct_tests[] = {
-  make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>,
-             &wrapper<aom_idct32x32_1_add_neon>, TX_32X32, 1, 8, 1),
-  make_tuple(&aom_fdct16x16_c, &wrapper<aom_idct16x16_256_add_c>,
-             &wrapper<aom_idct16x16_10_add_neon>, TX_16X16, 10, 8, 1),
-  make_tuple(&aom_fdct16x16_c, &wrapper<aom_idct16x16_256_add_c>,
-             &wrapper<aom_idct16x16_1_add_neon>, TX_16X16, 1, 8, 1),
-  make_tuple(&aom_fdct8x8_c, &wrapper<aom_idct8x8_64_add_c>,
-             &wrapper<aom_idct8x8_12_add_neon>, TX_8X8, 12, 8, 1),
-  make_tuple(&aom_fdct8x8_c, &wrapper<aom_idct8x8_64_add_c>,
-             &wrapper<aom_idct8x8_1_add_neon>, TX_8X8, 1, 8, 1),
-  make_tuple(&aom_fdct4x4_c, &wrapper<aom_idct4x4_16_add_c>,
-             &wrapper<aom_idct4x4_1_add_neon>, TX_4X4, 1, 8, 1)
-};
-
-INSTANTIATE_TEST_CASE_P(NEON, PartialIDctTest,
-                        ::testing::ValuesIn(neon_partial_idct_tests));
-#endif  // HAVE_NEON && !CONFIG_HIGHBITDEPTH
-
 #if HAVE_SSE2
 const PartialInvTxfmParam sse2_partial_idct_tests[] = {
   make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>,
@@ -404,68 +384,4 @@
                         ::testing::ValuesIn(avx2_partial_idct_tests));
 #endif  // HAVE_AVX2
 
-#if HAVE_DSPR2 && !CONFIG_HIGHBITDEPTH
-const PartialInvTxfmParam dspr2_partial_idct_tests[] = {
-  make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>,
-             &wrapper<aom_idct32x32_1024_add_dspr2>, TX_32X32, 1024, 8, 1),
-  make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>,
-             &wrapper<aom_idct32x32_1024_add_dspr2>, TX_32X32, 135, 8, 1),
-  make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>,
-             &wrapper<aom_idct32x32_34_add_dspr2>, TX_32X32, 34, 8, 1),
-  make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>,
-             &wrapper<aom_idct32x32_1_add_dspr2>, TX_32X32, 1, 8, 1),
-  make_tuple(&aom_fdct16x16_c, &wrapper<aom_idct16x16_256_add_c>,
-             &wrapper<aom_idct16x16_256_add_dspr2>, TX_16X16, 256, 8, 1),
-  make_tuple(&aom_fdct16x16_c, &wrapper<aom_idct16x16_256_add_c>,
-             &wrapper<aom_idct16x16_10_add_dspr2>, TX_16X16, 10, 8, 1),
-  make_tuple(&aom_fdct16x16_c, &wrapper<aom_idct16x16_256_add_c>,
-             &wrapper<aom_idct16x16_1_add_dspr2>, TX_16X16, 1, 8, 1),
-  make_tuple(&aom_fdct8x8_c, &wrapper<aom_idct8x8_64_add_c>,
-             &wrapper<aom_idct8x8_64_add_dspr2>, TX_8X8, 64, 8, 1),
-  make_tuple(&aom_fdct8x8_c, &wrapper<aom_idct8x8_64_add_c>,
-             &wrapper<aom_idct8x8_12_add_dspr2>, TX_8X8, 12, 8, 1),
-  make_tuple(&aom_fdct8x8_c, &wrapper<aom_idct8x8_64_add_c>,
-             &wrapper<aom_idct8x8_1_add_dspr2>, TX_8X8, 1, 8, 1),
-  make_tuple(&aom_fdct4x4_c, &wrapper<aom_idct4x4_16_add_c>,
-             &wrapper<aom_idct4x4_16_add_dspr2>, TX_4X4, 16, 8, 1),
-  make_tuple(&aom_fdct4x4_c, &wrapper<aom_idct4x4_16_add_c>,
-             &wrapper<aom_idct4x4_1_add_dspr2>, TX_4X4, 1, 8, 1)
-};
-
-INSTANTIATE_TEST_CASE_P(DSPR2, PartialIDctTest,
-                        ::testing::ValuesIn(dspr2_partial_idct_tests));
-#endif  // HAVE_DSPR2 && !CONFIG_HIGHBITDEPTH
-
-#if HAVE_MSA && !CONFIG_HIGHBITDEPTH
-const PartialInvTxfmParam msa_partial_idct_tests[] = {
-  make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>,
-             &wrapper<aom_idct32x32_1024_add_msa>, TX_32X32, 1024, 8, 1),
-  make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>,
-             &wrapper<aom_idct32x32_1024_add_msa>, TX_32X32, 135, 8, 1),
-  make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>,
-             &wrapper<aom_idct32x32_34_add_msa>, TX_32X32, 34, 8, 1),
-  make_tuple(&aom_fdct32x32_c, &wrapper<aom_idct32x32_1024_add_c>,
-             &wrapper<aom_idct32x32_1_add_msa>, TX_32X32, 1, 8, 1),
-  make_tuple(&aom_fdct16x16_c, &wrapper<aom_idct16x16_256_add_c>,
-             &wrapper<aom_idct16x16_256_add_msa>, TX_16X16, 256, 8, 1),
-  make_tuple(&aom_fdct16x16_c, &wrapper<aom_idct16x16_256_add_c>,
-             &wrapper<aom_idct16x16_10_add_msa>, TX_16X16, 10, 8, 1),
-  make_tuple(&aom_fdct16x16_c, &wrapper<aom_idct16x16_256_add_c>,
-             &wrapper<aom_idct16x16_1_add_msa>, TX_16X16, 1, 8, 1),
-  make_tuple(&aom_fdct8x8_c, &wrapper<aom_idct8x8_64_add_c>,
-             &wrapper<aom_idct8x8_64_add_msa>, TX_8X8, 64, 8, 1),
-  make_tuple(&aom_fdct8x8_c, &wrapper<aom_idct8x8_64_add_c>,
-             &wrapper<aom_idct8x8_12_add_msa>, TX_8X8, 12, 8, 1),
-  make_tuple(&aom_fdct8x8_c, &wrapper<aom_idct8x8_64_add_c>,
-             &wrapper<aom_idct8x8_1_add_msa>, TX_8X8, 1, 8, 1),
-  make_tuple(&aom_fdct4x4_c, &wrapper<aom_idct4x4_16_add_c>,
-             &wrapper<aom_idct4x4_16_add_msa>, TX_4X4, 16, 8, 1),
-  make_tuple(&aom_fdct4x4_c, &wrapper<aom_idct4x4_16_add_c>,
-             &wrapper<aom_idct4x4_1_add_msa>, TX_4X4, 1, 8, 1)
-};
-
-INSTANTIATE_TEST_CASE_P(MSA, PartialIDctTest,
-                        ::testing::ValuesIn(msa_partial_idct_tests));
-#endif  // HAVE_MSA && !CONFIG_HIGHBITDEPTH
-
 }  // namespace
diff --git a/test/quantize_func_test.cc b/test/quantize_func_test.cc
index 9303053..2f87a2c 100644
--- a/test/quantize_func_test.cc
+++ b/test/quantize_func_test.cc
@@ -301,7 +301,6 @@
              AOM_BITS_8),
   make_tuple(&av1_quantize_fp_32x32_c, &av1_quantize_fp_32x32_avx2, TX_32X32,
              TYPE_FP, AOM_BITS_8),
-#if CONFIG_HIGHBITDEPTH
   make_tuple(&highbd_quan16x16_wrapper<av1_highbd_quantize_fp_c>,
              &highbd_quan16x16_wrapper<av1_highbd_quantize_fp_avx2>, TX_16X16,
              TYPE_FP, AOM_BITS_8),
@@ -337,7 +336,6 @@
              TYPE_B, AOM_BITS_10),
   make_tuple(&aom_highbd_quantize_b_c, &aom_highbd_quantize_b_avx2, TX_16X16,
              TYPE_B, AOM_BITS_12),
-#endif  // CONFIG_HIGHBITDEPTH
 };
 
 INSTANTIATE_TEST_CASE_P(AVX2, QuantizeTest,
@@ -348,7 +346,6 @@
 const QuantizeParam kQParamArraySSE2[] = {
   make_tuple(&av1_quantize_fp_c, &av1_quantize_fp_sse2, TX_16X16, TYPE_FP,
              AOM_BITS_8),
-#if CONFIG_HIGHBITDEPTH
   make_tuple(&aom_highbd_quantize_b_c, &aom_highbd_quantize_b_sse2, TX_16X16,
              TYPE_B, AOM_BITS_8),
   make_tuple(&aom_highbd_quantize_b_c, &aom_highbd_quantize_b_sse2, TX_16X16,
@@ -361,28 +358,10 @@
              TX_32X32, TYPE_B, AOM_BITS_10),
   make_tuple(&aom_highbd_quantize_b_32x32_c, &aom_highbd_quantize_b_32x32_sse2,
              TX_32X32, TYPE_B, AOM_BITS_12),
-#endif
 };
 
 INSTANTIATE_TEST_CASE_P(SSE2, QuantizeTest,
                         ::testing::ValuesIn(kQParamArraySSE2));
 #endif
 
-#if !CONFIG_HIGHBITDEPTH && HAVE_SSSE3 && ARCH_X86_64
-const QuantizeParam kQ16x16ParamArraySSSE3[] = {
-  make_tuple(&av1_quantize_fp_c, &av1_quantize_fp_ssse3, TX_16X16, TYPE_FP,
-             AOM_BITS_8),
-};
-INSTANTIATE_TEST_CASE_P(SSSE3, QuantizeTest,
-                        ::testing::ValuesIn(kQ16x16ParamArraySSSE3));
-
-// TODO(any):
-//  The following test does not pass yet
-const QuantizeParam kQ32x32ParamArraySSSE3[] = { make_tuple(
-    &av1_quantize_fp_32x32_c, &av1_quantize_fp_32x32_ssse3, TX_32X32, TYPE_FP,
-    AOM_BITS_8) };
-INSTANTIATE_TEST_CASE_P(DISABLED_SSSE3, QuantizeTest,
-                        ::testing::ValuesIn(kQ32x32ParamArraySSSE3));
-#endif
-
 }  // namespace
diff --git a/test/sad_test.cc b/test/sad_test.cc
index d2555e3..003e42a 100644
--- a/test/sad_test.cc
+++ b/test/sad_test.cc
@@ -139,7 +139,6 @@
       comp_pred_ = comp_pred8_;
       comp_pred_test_ = comp_pred8_test_;
 #endif
-#if CONFIG_HIGHBITDEPTH
     } else {
       use_high_bit_depth_ = true;
       bit_depth_ = static_cast<aom_bit_depth_t>(bd_);
@@ -150,7 +149,6 @@
       comp_pred_ = CONVERT_TO_BYTEPTR(comp_pred16_);
       comp_pred_test_ = CONVERT_TO_BYTEPTR(comp_pred16_test_);
 #endif
-#endif  // CONFIG_HIGHBITDEPTH
     }
     mask_ = (1 << bit_depth_) - 1;
     source_stride_ = (width_ + 31) & ~31;
@@ -159,11 +157,9 @@
   }
 
   virtual uint8_t *GetReference(int block_idx) {
-#if CONFIG_HIGHBITDEPTH
     if (use_high_bit_depth_)
       return CONVERT_TO_BYTEPTR(CONVERT_TO_SHORTPTR(reference_data_) +
                                 block_idx * kDataBlockSize);
-#endif  // CONFIG_HIGHBITDEPTH
     return reference_data_ + block_idx * kDataBlockSize;
   }
 
@@ -173,21 +169,17 @@
     unsigned int sad = 0;
     const uint8_t *const reference8 = GetReference(block_idx);
     const uint8_t *const source8 = source_data_;
-#if CONFIG_HIGHBITDEPTH
     const uint16_t *const reference16 =
         CONVERT_TO_SHORTPTR(GetReference(block_idx));
     const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_);
-#endif  // CONFIG_HIGHBITDEPTH
     for (int h = 0; h < height_; ++h) {
       for (int w = 0; w < width_; ++w) {
         if (!use_high_bit_depth_) {
           sad += abs(source8[h * source_stride_ + w] -
                      reference8[h * reference_stride_ + w]);
-#if CONFIG_HIGHBITDEPTH
         } else {
           sad += abs(source16[h * source_stride_ + w] -
                      reference16[h * reference_stride_ + w]);
-#endif  // CONFIG_HIGHBITDEPTH
         }
       }
     }
@@ -202,12 +194,10 @@
     const uint8_t *const reference8 = GetReference(block_idx);
     const uint8_t *const source8 = source_data_;
     const uint8_t *const second_pred8 = second_pred_;
-#if CONFIG_HIGHBITDEPTH
     const uint16_t *const reference16 =
         CONVERT_TO_SHORTPTR(GetReference(block_idx));
     const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_);
     const uint16_t *const second_pred16 = CONVERT_TO_SHORTPTR(second_pred_);
-#endif  // CONFIG_HIGHBITDEPTH
     for (int h = 0; h < height_; ++h) {
       for (int w = 0; w < width_; ++w) {
         if (!use_high_bit_depth_) {
@@ -215,13 +205,11 @@
                           reference8[h * reference_stride_ + w];
           const uint8_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1);
           sad += abs(source8[h * source_stride_ + w] - comp_pred);
-#if CONFIG_HIGHBITDEPTH
         } else {
           const int tmp = second_pred16[h * width_ + w] +
                           reference16[h * reference_stride_ + w];
           const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 1);
           sad += abs(source16[h * source_stride_ + w] - comp_pred);
-#endif  // CONFIG_HIGHBITDEPTH
         }
       }
     }
@@ -233,12 +221,10 @@
     const uint8_t *const reference8 = GetReference(block_idx);
     const uint8_t *const second_pred8 = second_pred_;
     uint8_t *const comp_pred8 = comp_pred_;
-#if CONFIG_HIGHBITDEPTH
     const uint16_t *const reference16 =
         CONVERT_TO_SHORTPTR(GetReference(block_idx));
     const uint16_t *const second_pred16 = CONVERT_TO_SHORTPTR(second_pred_);
     uint16_t *const comp_pred16 = CONVERT_TO_SHORTPTR(comp_pred_);
-#endif  // CONFIG_HIGHBITDEPTH
     for (int h = 0; h < height_; ++h) {
       for (int w = 0; w < width_; ++w) {
         if (!use_high_bit_depth_) {
@@ -246,13 +232,11 @@
               second_pred8[h * width_ + w] * jcp_param_.bck_offset +
               reference8[h * reference_stride_ + w] * jcp_param_.fwd_offset;
           comp_pred8[h * width_ + w] = ROUND_POWER_OF_TWO(tmp, 4);
-#if CONFIG_HIGHBITDEPTH
         } else {
           const int tmp =
               second_pred16[h * width_ + w] * jcp_param_.bck_offset +
               reference16[h * reference_stride_ + w] * jcp_param_.fwd_offset;
           comp_pred16[h * width_ + w] = ROUND_POWER_OF_TWO(tmp, 4);
-#endif  // CONFIG_HIGHBITDEPTH
         }
       }
     }
@@ -263,12 +247,10 @@
     const uint8_t *const reference8 = GetReference(block_idx);
     const uint8_t *const source8 = source_data_;
     const uint8_t *const second_pred8 = second_pred_;
-#if CONFIG_HIGHBITDEPTH
     const uint16_t *const reference16 =
         CONVERT_TO_SHORTPTR(GetReference(block_idx));
     const uint16_t *const source16 = CONVERT_TO_SHORTPTR(source_data_);
     const uint16_t *const second_pred16 = CONVERT_TO_SHORTPTR(second_pred_);
-#endif  // CONFIG_HIGHBITDEPTH
     for (int h = 0; h < height_; ++h) {
       for (int w = 0; w < width_; ++w) {
         if (!use_high_bit_depth_) {
@@ -277,14 +259,12 @@
               reference8[h * reference_stride_ + w] * jcp_param_.fwd_offset;
           const uint8_t comp_pred = ROUND_POWER_OF_TWO(tmp, 4);
           sad += abs(source8[h * source_stride_ + w] - comp_pred);
-#if CONFIG_HIGHBITDEPTH
         } else {
           const int tmp =
               second_pred16[h * width_ + w] * jcp_param_.bck_offset +
               reference16[h * reference_stride_ + w] * jcp_param_.fwd_offset;
           const uint16_t comp_pred = ROUND_POWER_OF_TWO(tmp, 4);
           sad += abs(source16[h * source_stride_ + w] - comp_pred);
-#endif  // CONFIG_HIGHBITDEPTH
         }
       }
     }
@@ -294,17 +274,13 @@
 
   void FillConstant(uint8_t *data, int stride, uint16_t fill_constant) {
     uint8_t *data8 = data;
-#if CONFIG_HIGHBITDEPTH
     uint16_t *data16 = CONVERT_TO_SHORTPTR(data);
-#endif  // CONFIG_HIGHBITDEPTH
     for (int h = 0; h < height_; ++h) {
       for (int w = 0; w < width_; ++w) {
         if (!use_high_bit_depth_) {
           data8[h * stride + w] = static_cast<uint8_t>(fill_constant);
-#if CONFIG_HIGHBITDEPTH
         } else {
           data16[h * stride + w] = fill_constant;
-#endif  // CONFIG_HIGHBITDEPTH
         }
       }
     }
@@ -312,17 +288,13 @@
 
   void FillRandom(uint8_t *data, int stride) {
     uint8_t *data8 = data;
-#if CONFIG_HIGHBITDEPTH
     uint16_t *data16 = CONVERT_TO_SHORTPTR(data);
-#endif  // CONFIG_HIGHBITDEPTH
     for (int h = 0; h < height_; ++h) {
       for (int w = 0; w < width_; ++w) {
         if (!use_high_bit_depth_) {
           data8[h * stride + w] = rnd_.Rand8();
-#if CONFIG_HIGHBITDEPTH
         } else {
           data16[h * stride + w] = rnd_.Rand16() & mask_;
-#endif  // CONFIG_HIGHBITDEPTH
         }
       }
     }
@@ -884,7 +856,6 @@
   make_tuple(8, 4, &aom_sad8x4_c, -1),
   make_tuple(4, 8, &aom_sad4x8_c, -1),
   make_tuple(4, 4, &aom_sad4x4_c, -1),
-#if CONFIG_HIGHBITDEPTH
 #if CONFIG_AV1 && CONFIG_EXT_PARTITION
   make_tuple(128, 128, &aom_highbd_sad128x128_c, 8),
   make_tuple(128, 64, &aom_highbd_sad128x64_c, 8),
@@ -939,7 +910,6 @@
   make_tuple(8, 4, &aom_highbd_sad8x4_c, 12),
   make_tuple(4, 8, &aom_highbd_sad4x8_c, 12),
   make_tuple(4, 4, &aom_highbd_sad4x4_c, 12),
-#endif  // CONFIG_HIGHBITDEPTH
 };
 INSTANTIATE_TEST_CASE_P(C, SADTest, ::testing::ValuesIn(c_tests));
 
@@ -962,7 +932,6 @@
   make_tuple(8, 4, &aom_sad8x4_avg_c, -1),
   make_tuple(4, 8, &aom_sad4x8_avg_c, -1),
   make_tuple(4, 4, &aom_sad4x4_avg_c, -1),
-#if CONFIG_HIGHBITDEPTH
 #if CONFIG_AV1 && CONFIG_EXT_PARTITION
   make_tuple(128, 128, &aom_highbd_sad128x128_avg_c, 8),
   make_tuple(128, 64, &aom_highbd_sad128x64_avg_c, 8),
@@ -1017,7 +986,6 @@
   make_tuple(8, 4, &aom_highbd_sad8x4_avg_c, 12),
   make_tuple(4, 8, &aom_highbd_sad4x8_avg_c, 12),
   make_tuple(4, 4, &aom_highbd_sad4x4_avg_c, 12),
-#endif  // CONFIG_HIGHBITDEPTH
 };
 INSTANTIATE_TEST_CASE_P(C, SADavgTest, ::testing::ValuesIn(avg_c_tests));
 
@@ -1089,7 +1057,6 @@
   make_tuple(8, 4, &aom_sad8x4x4d_c, -1),
   make_tuple(4, 8, &aom_sad4x8x4d_c, -1),
   make_tuple(4, 4, &aom_sad4x4x4d_c, -1),
-#if CONFIG_HIGHBITDEPTH
 #if CONFIG_AV1 && CONFIG_EXT_PARTITION
   make_tuple(128, 128, &aom_highbd_sad128x128x4d_c, 8),
   make_tuple(128, 64, &aom_highbd_sad128x64x4d_c, 8),
@@ -1144,7 +1111,6 @@
   make_tuple(8, 4, &aom_highbd_sad8x4x4d_c, 12),
   make_tuple(4, 8, &aom_highbd_sad4x8x4d_c, 12),
   make_tuple(4, 4, &aom_highbd_sad4x4x4d_c, 12),
-#endif  // CONFIG_HIGHBITDEPTH
 };
 INSTANTIATE_TEST_CASE_P(C, SADx4Test, ::testing::ValuesIn(x4d_c_tests));
 
@@ -1192,7 +1158,6 @@
   make_tuple(8, 4, &aom_sad8x4_sse2, -1),
   make_tuple(4, 8, &aom_sad4x8_sse2, -1),
   make_tuple(4, 4, &aom_sad4x4_sse2, -1),
-#if CONFIG_HIGHBITDEPTH
   make_tuple(64, 64, &aom_highbd_sad64x64_sse2, 8),
   make_tuple(64, 32, &aom_highbd_sad64x32_sse2, 8),
   make_tuple(32, 64, &aom_highbd_sad32x64_sse2, 8),
@@ -1226,7 +1191,6 @@
   make_tuple(8, 16, &aom_highbd_sad8x16_sse2, 12),
   make_tuple(8, 8, &aom_highbd_sad8x8_sse2, 12),
   make_tuple(8, 4, &aom_highbd_sad8x4_sse2, 12),
-#endif  // CONFIG_HIGHBITDEPTH
 };
 INSTANTIATE_TEST_CASE_P(SSE2, SADTest, ::testing::ValuesIn(sse2_tests));
 
@@ -1249,7 +1213,6 @@
   make_tuple(8, 4, &aom_sad8x4_avg_sse2, -1),
   make_tuple(4, 8, &aom_sad4x8_avg_sse2, -1),
   make_tuple(4, 4, &aom_sad4x4_avg_sse2, -1),
-#if CONFIG_HIGHBITDEPTH
   make_tuple(64, 64, &aom_highbd_sad64x64_avg_sse2, 8),
   make_tuple(64, 32, &aom_highbd_sad64x32_avg_sse2, 8),
   make_tuple(32, 64, &aom_highbd_sad32x64_avg_sse2, 8),
@@ -1283,7 +1246,6 @@
   make_tuple(8, 16, &aom_highbd_sad8x16_avg_sse2, 12),
   make_tuple(8, 8, &aom_highbd_sad8x8_avg_sse2, 12),
   make_tuple(8, 4, &aom_highbd_sad8x4_avg_sse2, 12),
-#endif  // CONFIG_HIGHBITDEPTH
 };
 INSTANTIATE_TEST_CASE_P(SSE2, SADavgTest, ::testing::ValuesIn(avg_sse2_tests));
 
@@ -1306,7 +1268,6 @@
   make_tuple(8, 4, &aom_sad8x4x4d_sse2, -1),
   make_tuple(4, 8, &aom_sad4x8x4d_sse2, -1),
   make_tuple(4, 4, &aom_sad4x4x4d_sse2, -1),
-#if CONFIG_HIGHBITDEPTH
   make_tuple(64, 64, &aom_highbd_sad64x64x4d_sse2, 8),
   make_tuple(64, 32, &aom_highbd_sad64x32x4d_sse2, 8),
   make_tuple(32, 64, &aom_highbd_sad32x64x4d_sse2, 8),
@@ -1346,7 +1307,6 @@
   make_tuple(8, 4, &aom_highbd_sad8x4x4d_sse2, 12),
   make_tuple(4, 8, &aom_highbd_sad4x8x4d_sse2, 12),
   make_tuple(4, 4, &aom_highbd_sad4x4x4d_sse2, 12),
-#endif  // CONFIG_HIGHBITDEPTH
 };
 INSTANTIATE_TEST_CASE_P(SSE2, SADx4Test, ::testing::ValuesIn(x4d_sse2_tests));
 
@@ -1459,7 +1419,6 @@
   make_tuple(32, 64, &aom_sad32x64_avx2, -1),
   make_tuple(32, 32, &aom_sad32x32_avx2, -1),
   make_tuple(32, 16, &aom_sad32x16_avx2, -1),
-#if CONFIG_HIGHBITDEPTH
 #if CONFIG_EXT_PARTITION
   make_tuple(128, 128, &aom_highbd_sad128x128_avx2, 8),
   make_tuple(128, 128, &aom_highbd_sad128x128_avx2, 10),
@@ -1495,7 +1454,6 @@
   make_tuple(16, 8, &aom_highbd_sad16x8_avx2, 8),
   make_tuple(16, 8, &aom_highbd_sad16x8_avx2, 10),
   make_tuple(16, 8, &aom_highbd_sad16x8_avx2, 12),
-#endif
 };
 INSTANTIATE_TEST_CASE_P(AVX2, SADTest, ::testing::ValuesIn(avx2_tests));
 
@@ -1510,7 +1468,6 @@
   make_tuple(32, 64, &aom_sad32x64_avg_avx2, -1),
   make_tuple(32, 32, &aom_sad32x32_avg_avx2, -1),
   make_tuple(32, 16, &aom_sad32x16_avg_avx2, -1),
-#if CONFIG_HIGHBITDEPTH
 #if CONFIG_EXT_PARTITION
   make_tuple(128, 128, &aom_highbd_sad128x128_avg_avx2, 8),
   make_tuple(128, 128, &aom_highbd_sad128x128_avg_avx2, 10),
@@ -1546,7 +1503,6 @@
   make_tuple(16, 8, &aom_highbd_sad16x8_avg_avx2, 8),
   make_tuple(16, 8, &aom_highbd_sad16x8_avg_avx2, 10),
   make_tuple(16, 8, &aom_highbd_sad16x8_avg_avx2, 12),
-#endif
 };
 INSTANTIATE_TEST_CASE_P(AVX2, SADavgTest, ::testing::ValuesIn(avg_avx2_tests));
 
@@ -1560,7 +1516,6 @@
   make_tuple(32, 64, &aom_sad32x64x4d_avx2, -1),
   make_tuple(64, 32, &aom_sad64x32x4d_avx2, -1),
   make_tuple(32, 32, &aom_sad32x32x4d_avx2, -1),
-#if CONFIG_HIGHBITDEPTH
 #if CONFIG_EXT_PARTITION
   make_tuple(128, 128, &aom_highbd_sad128x128x4d_avx2, 8),
   make_tuple(128, 128, &aom_highbd_sad128x128x4d_avx2, 10),
@@ -1596,7 +1551,6 @@
   make_tuple(16, 8, &aom_highbd_sad16x8x4d_avx2, 8),
   make_tuple(16, 8, &aom_highbd_sad16x8x4d_avx2, 10),
   make_tuple(16, 8, &aom_highbd_sad16x8x4d_avx2, 12),
-#endif
 };
 INSTANTIATE_TEST_CASE_P(AVX2, SADx4Test, ::testing::ValuesIn(x4d_avx2_tests));
 #endif  // HAVE_AVX2
diff --git a/test/selfguided_filter_test.cc b/test/selfguided_filter_test.cc
index b5114b8..093f9dc 100644
--- a/test/selfguided_filter_test.cc
+++ b/test/selfguided_filter_test.cc
@@ -179,8 +179,6 @@
                         ::testing::ValuesIn(params));
 #endif
 
-#if CONFIG_HIGHBITDEPTH
-
 typedef tuple<int> HighbdFilterTestParam;
 
 class AV1HighbdSelfguidedFilterTest
@@ -341,6 +339,5 @@
 INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdSelfguidedFilterTest,
                         ::testing::ValuesIn(highbd_params));
 #endif
-#endif
 
 }  // namespace
diff --git a/test/subtract_test.cc b/test/subtract_test.cc
index 578c2ae..de1097c 100644
--- a/test/subtract_test.cc
+++ b/test/subtract_test.cc
@@ -117,7 +117,6 @@
 // <width, height, bit_dpeth, subtract>
 typedef tuple<int, int, int, HBDSubtractFunc> Params;
 
-#if CONFIG_HIGHBITDEPTH
 class AV1HBDSubtractBlockTest : public ::testing::TestWithParam<Params> {
  public:
   virtual void SetUp() {
@@ -262,5 +261,4 @@
 INSTANTIATE_TEST_CASE_P(SSE2, AV1HBDSubtractBlockTest,
                         ::testing::ValuesIn(kAV1HBDSubtractBlock_sse2));
 #endif  // HAVE_SSE2
-#endif  // CONFIG_HIGHBITDEPTH
 }  // namespace
diff --git a/test/test.cmake b/test/test.cmake
index 4ff69c5..589c4ab 100644
--- a/test/test.cmake
+++ b/test/test.cmake
@@ -303,7 +303,6 @@
   endif ()
 endif ()
 
-if (CONFIG_HIGHBITDEPTH)
   if (CONFIG_AV1_ENCODER AND NOT BUILD_SHARED_LIBS)
     set(AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1
         ${AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1}
@@ -316,7 +315,6 @@
         ${AOM_UNIT_TEST_COMMON_SOURCES}
         "${AOM_ROOT}/test/hbd_metrics_test.cc")
   endif ()
-endif ()
 
 if (CONFIG_UNIT_TESTS)
   find_package(PythonInterp)
diff --git a/test/test.mk b/test/test.mk
index ed38f24..fe8d4f8 100644
--- a/test/test.mk
+++ b/test/test.mk
@@ -191,12 +191,10 @@
 LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += obmc_sad_test.cc
 LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += obmc_variance_test.cc
 
-ifeq ($(CONFIG_HIGHBITDEPTH),yes)
 ifeq ($(CONFIG_AV1_ENCODER),yes)
 LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += av1_quantize_test.cc
 LIBAOM_TEST_SRCS-$(HAVE_SSE4_1) += av1_highbd_iht_test.cc
 endif
-endif # CONFIG_HIGHBITDEPTH
 endif # AV1
 
 ## Multi-codec / unconditional whitebox tests.
@@ -206,7 +204,7 @@
 LIBAOM_TEST_SRCS-$(CONFIG_LV_MAP) += encodetxb_test.cc
 endif
 ifeq ($(CONFIG_INTERNAL_STATS),yes)
-LIBAOM_TEST_SRCS-$(CONFIG_HIGHBITDEPTH) += hbd_metrics_test.cc
+LIBAOM_TEST_SRCS-yes += hbd_metrics_test.cc
 endif
 LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += sad_test.cc
 LIBAOM_TEST_SRCS-$(CONFIG_AV1_ENCODER) += av1_txfm_test.h
diff --git a/test/test_intra_pred_speed.cc b/test/test_intra_pred_speed.cc
index 5f90ab6..aab7834 100644
--- a/test/test_intra_pred_speed.cc
+++ b/test/test_intra_pred_speed.cc
@@ -634,7 +634,6 @@
 
 // -----------------------------------------------------------------------------
 // High Bitdepth
-#if CONFIG_HIGHBITDEPTH
 namespace {
 
 typedef void (*AvxHighbdPredFunc)(uint16_t *dst, ptrdiff_t y_stride,
@@ -1119,6 +1118,5 @@
     aom_highbd_paeth_predictor_32x16_c, aom_highbd_smooth_predictor_32x16_c,
     aom_highbd_smooth_v_predictor_32x16_c,
     aom_highbd_smooth_h_predictor_32x16_c)
-#endif  // CONFIG_HIGHBITDEPTH
 
 #include "test/test_libaom.cc"
diff --git a/test/transform_test_base.h b/test/transform_test_base.h
index 3db0c69..16d003d 100644
--- a/test/transform_test_base.h
+++ b/test/transform_test_base.h
@@ -57,12 +57,10 @@
         aom_memalign(16, sizeof(uint8_t) * num_coeffs_));
     uint8_t *src = reinterpret_cast<uint8_t *>(
         aom_memalign(16, sizeof(uint8_t) * num_coeffs_));
-#if CONFIG_HIGHBITDEPTH
     uint16_t *dst16 = reinterpret_cast<uint16_t *>(
         aom_memalign(16, sizeof(uint16_t) * num_coeffs_));
     uint16_t *src16 = reinterpret_cast<uint16_t *>(
         aom_memalign(16, sizeof(uint16_t) * num_coeffs_));
-#endif
 
     for (int i = 0; i < count_test_block; ++i) {
       // Initialize a test block with input range [-255, 255].
@@ -71,12 +69,10 @@
           src[j] = rnd.Rand8();
           dst[j] = rnd.Rand8();
           test_input_block[j] = src[j] - dst[j];
-#if CONFIG_HIGHBITDEPTH
         } else {
           src16[j] = rnd.Rand16() & mask_;
           dst16[j] = rnd.Rand16() & mask_;
           test_input_block[j] = src16[j] - dst16[j];
-#endif
         }
       }
 
@@ -84,21 +80,14 @@
           RunFwdTxfm(test_input_block, test_temp_block, pitch_));
       if (bit_depth_ == AOM_BITS_8) {
         ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
-#if CONFIG_HIGHBITDEPTH
       } else {
         ASM_REGISTER_STATE_CHECK(
             RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
-#endif
       }
 
       for (int j = 0; j < num_coeffs_; ++j) {
-#if CONFIG_HIGHBITDEPTH
         const int diff =
             bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
-#else
-        ASSERT_EQ(AOM_BITS_8, bit_depth_);
-        const int diff = dst[j] - src[j];
-#endif
         const uint32_t error = diff * diff;
         if (max_error < error) max_error = error;
         total_error += error;
@@ -119,10 +108,8 @@
     aom_free(test_temp_block);
     aom_free(dst);
     aom_free(src);
-#if CONFIG_HIGHBITDEPTH
     aom_free(dst16);
     aom_free(src16);
-#endif
   }
 
   void RunCoeffCheck() {
@@ -149,11 +136,9 @@
           input_block[in_idx] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
           if (bit_depth_ == AOM_BITS_8) {
             output_block[out_idx] = output_ref_block[out_idx] = rnd.Rand8();
-#if CONFIG_HIGHBITDEPTH
           } else {
             output_block[out_idx] = output_ref_block[out_idx] =
                 rnd.Rand16() & mask_;
-#endif
           }
         }
       }
@@ -281,12 +266,10 @@
     uint8_t *src = reinterpret_cast<uint8_t *>(
         aom_memalign(16, sizeof(uint8_t) * num_coeffs_));
 
-#if CONFIG_HIGHBITDEPTH
     uint16_t *dst16 = reinterpret_cast<uint16_t *>(
         aom_memalign(16, sizeof(uint16_t) * num_coeffs_));
     uint16_t *src16 = reinterpret_cast<uint16_t *>(
         aom_memalign(16, sizeof(uint16_t) * num_coeffs_));
-#endif
 
     for (int i = 0; i < count_test_block; ++i) {
       // Initialize a test block with input range [-mask_, mask_].
@@ -295,12 +278,10 @@
           src[j] = rnd.Rand8();
           dst[j] = rnd.Rand8();
           in[j] = src[j] - dst[j];
-#if CONFIG_HIGHBITDEPTH
         } else {
           src16[j] = rnd.Rand16() & mask_;
           dst16[j] = rnd.Rand16() & mask_;
           in[j] = src16[j] - dst16[j];
-#endif
         }
       }
 
@@ -308,20 +289,14 @@
 
       if (bit_depth_ == AOM_BITS_8) {
         ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
-#if CONFIG_HIGHBITDEPTH
       } else {
         ASM_REGISTER_STATE_CHECK(
             RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16), pitch_));
-#endif
       }
 
       for (int j = 0; j < num_coeffs_; ++j) {
-#if CONFIG_HIGHBITDEPTH
         const int diff =
             bit_depth_ == AOM_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
-#else
-        const int diff = dst[j] - src[j];
-#endif
         const uint32_t error = diff * diff;
         ASSERT_GE(static_cast<uint32_t>(limit), error)
             << "Error: 4x4 IDCT has error " << error << " at index " << j;
@@ -331,10 +306,8 @@
     aom_free(coeff);
     aom_free(dst);
     aom_free(src);
-#if CONFIG_HIGHBITDEPTH
     aom_free(src16);
     aom_free(dst16);
-#endif
   }
 
   int pitch_;
diff --git a/test/variance_test.cc b/test/variance_test.cc
index 9e1240b..b614104 100644
--- a/test/variance_test.cc
+++ b/test/variance_test.cc
@@ -95,13 +95,11 @@
         diff = src[y * src_stride + x] - ref[y * ref_stride + x];
         se += diff;
         sse += diff * diff;
-#if CONFIG_HIGHBITDEPTH
       } else {
         diff = CONVERT_TO_SHORTPTR(src)[y * src_stride + x] -
                CONVERT_TO_SHORTPTR(ref)[y * ref_stride + x];
         se += diff;
         sse += diff * diff;
-#endif  // CONFIG_HIGHBITDEPTH
       }
     }
   }
@@ -142,7 +140,6 @@
         const int diff = r - src[w * y + x];
         se += diff;
         sse += diff * diff;
-#if CONFIG_HIGHBITDEPTH
       } else {
         uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref);
         uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
@@ -156,7 +153,6 @@
         const int diff = r - src16[w * y + x];
         se += diff;
         sse += diff * diff;
-#endif  // CONFIG_HIGHBITDEPTH
       }
     }
   }
@@ -194,7 +190,6 @@
             ((r + second_pred[w * y + x] + 1) >> 1) - src[w * y + x];
         se += diff;
         sse += diff * diff;
-#if CONFIG_HIGHBITDEPTH
       } else {
         const uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref);
         const uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
@@ -209,7 +204,6 @@
         const int diff = ((r + sec16[w * y + x] + 1) >> 1) - src16[w * y + x];
         se += diff;
         sse += diff * diff;
-#endif  // CONFIG_HIGHBITDEPTH
       }
     }
   }
@@ -250,7 +244,6 @@
 
         se += diff;
         sse += diff * diff;
-#if CONFIG_HIGHBITDEPTH
       } else {
         const uint16_t *ref16 = CONVERT_TO_SHORTPTR(ref);
         const uint16_t *src16 = CONVERT_TO_SHORTPTR(src);
@@ -270,7 +263,6 @@
 
         se += diff;
         sse += diff * diff;
-#endif  // CONFIG_HIGHBITDEPTH
       }
     }
   }
@@ -375,23 +367,19 @@
     ref_ = new uint8_t[block_size() * unit];
     ASSERT_TRUE(src_ != NULL);
     ASSERT_TRUE(ref_ != NULL);
-#if CONFIG_HIGHBITDEPTH
     if (use_high_bit_depth()) {
       // TODO(skal): remove!
       src_ = CONVERT_TO_BYTEPTR(src_);
       ref_ = CONVERT_TO_BYTEPTR(ref_);
     }
-#endif
   }
 
   virtual void TearDown() {
-#if CONFIG_HIGHBITDEPTH
     if (use_high_bit_depth()) {
       // TODO(skal): remove!
       src_ = reinterpret_cast<uint8_t *>(CONVERT_TO_SHORTPTR(src_));
       ref_ = reinterpret_cast<uint8_t *>(CONVERT_TO_SHORTPTR(ref_));
     }
-#endif
 
     aom_free(src_);
     delete[] ref_;
@@ -466,11 +454,9 @@
       if (!use_high_bit_depth()) {
         src_[j] = rnd_.Rand8();
         ref_[j] = rnd_.Rand8();
-#if CONFIG_HIGHBITDEPTH
       } else {
         CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask();
         CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask();
-#endif  // CONFIG_HIGHBITDEPTH
       }
     }
     unsigned int sse1, sse2, var1, var2;
@@ -496,11 +482,9 @@
       if (!use_high_bit_depth()) {
         src_[src_ind] = rnd_.Rand8();
         ref_[ref_ind] = rnd_.Rand8();
-#if CONFIG_HIGHBITDEPTH
       } else {
         CONVERT_TO_SHORTPTR(src_)[src_ind] = rnd_.Rand16() & mask();
         CONVERT_TO_SHORTPTR(ref_)[ref_ind] = rnd_.Rand16() & mask();
-#endif  // CONFIG_HIGHBITDEPTH
       }
     }
     unsigned int sse1, sse2;
@@ -523,12 +507,10 @@
     memset(src_, 255, block_size());
     memset(ref_, 255, half);
     memset(ref_ + half, 0, half);
-#if CONFIG_HIGHBITDEPTH
   } else {
     aom_memset16(CONVERT_TO_SHORTPTR(src_), 255 << byte_shift(), block_size());
     aom_memset16(CONVERT_TO_SHORTPTR(ref_), 255 << byte_shift(), half);
     aom_memset16(CONVERT_TO_SHORTPTR(ref_) + half, 0, half);
-#endif  // CONFIG_HIGHBITDEPTH
   }
   unsigned int sse, var, expected;
   ASM_REGISTER_STATE_CHECK(
@@ -611,7 +593,6 @@
       src_ = reinterpret_cast<uint8_t *>(aom_memalign(16, block_size()));
       sec_ = reinterpret_cast<uint8_t *>(aom_memalign(16, block_size()));
       ref_ = new uint8_t[block_size() + width() + height() + 1];
-#if CONFIG_HIGHBITDEPTH
     } else {
       src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>(
           aom_memalign(16, block_size() * sizeof(uint16_t))));
@@ -619,7 +600,6 @@
           aom_memalign(16, block_size() * sizeof(uint16_t))));
       ref_ = CONVERT_TO_BYTEPTR(aom_memalign(
           16, (block_size() + width() + height() + 1) * sizeof(uint16_t)));
-#endif  // CONFIG_HIGHBITDEPTH
     }
     ASSERT_TRUE(src_ != NULL);
     ASSERT_TRUE(sec_ != NULL);
@@ -631,12 +611,10 @@
       aom_free(src_);
       delete[] ref_;
       aom_free(sec_);
-#if CONFIG_HIGHBITDEPTH
     } else {
       aom_free(CONVERT_TO_SHORTPTR(src_));
       aom_free(CONVERT_TO_SHORTPTR(ref_));
       aom_free(CONVERT_TO_SHORTPTR(sec_));
-#endif  // CONFIG_HIGHBITDEPTH
     }
     libaom_test::ClearSystemState();
   }
@@ -674,7 +652,6 @@
         for (int j = 0; j < block_size() + width() + height() + 1; j++) {
           ref_[j] = rnd_.Rand8();
         }
-#if CONFIG_HIGHBITDEPTH
       } else {
         for (int j = 0; j < block_size(); j++) {
           CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask();
@@ -682,7 +659,6 @@
         for (int j = 0; j < block_size() + width() + height() + 1; j++) {
           CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask();
         }
-#endif  // CONFIG_HIGHBITDEPTH
       }
       unsigned int sse1, sse2;
       unsigned int var1;
@@ -710,14 +686,12 @@
         memset(src_ + half, 255, half);
         memset(ref_, 255, half);
         memset(ref_ + half, 0, half + width() + height() + 1);
-#if CONFIG_HIGHBITDEPTH
       } else {
         aom_memset16(CONVERT_TO_SHORTPTR(src_), mask(), half);
         aom_memset16(CONVERT_TO_SHORTPTR(src_) + half, 0, half);
         aom_memset16(CONVERT_TO_SHORTPTR(ref_), 0, half);
         aom_memset16(CONVERT_TO_SHORTPTR(ref_) + half, mask(),
                      half + width() + height() + 1);
-#endif  // CONFIG_HIGHBITDEPTH
       }
       unsigned int sse1, sse2;
       unsigned int var1;
@@ -744,7 +718,6 @@
         for (int j = 0; j < block_size() + width() + height() + 1; j++) {
           ref_[j] = rnd_.Rand8();
         }
-#if CONFIG_HIGHBITDEPTH
       } else {
         for (int j = 0; j < block_size(); j++) {
           CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask();
@@ -753,7 +726,6 @@
         for (int j = 0; j < block_size() + width() + height() + 1; j++) {
           CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask();
         }
-#endif  // CONFIG_HIGHBITDEPTH
       }
       uint32_t sse1, sse2;
       uint32_t var1, var2;
@@ -781,7 +753,6 @@
         for (int j = 0; j < block_size() + width() + height() + 1; j++) {
           ref_[j] = rnd_.Rand8();
         }
-#if CONFIG_HIGHBITDEPTH
       } else {
         for (int j = 0; j < block_size(); j++) {
           CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask();
@@ -790,7 +761,6 @@
         for (int j = 0; j < block_size() + width() + height() + 1; j++) {
           CONVERT_TO_SHORTPTR(ref_)[j] = rnd_.Rand16() & mask();
         }
-#endif  // CONFIG_HIGHBITDEPTH
       }
       for (int x0 = 0; x0 < 2; ++x0) {
         for (int y0 = 0; y0 < 4; ++y0) {
@@ -940,7 +910,6 @@
                                    0)));
 #endif  // CONFIG_JNT_COMP
 
-#if CONFIG_HIGHBITDEPTH
 typedef MainTestClass<VarianceMxNFunc> AvxHBDMseTest;
 typedef MainTestClass<VarianceMxNFunc> AvxHBDVarianceTest;
 typedef SubpelVarianceTest<SubpixVarMxNFunc> AvxHBDSubpelVarianceTest;
@@ -1032,14 +1001,14 @@
 INSTANTIATE_TEST_CASE_P(C, AvxHBDVarianceTest,
                         ::testing::ValuesIn(kArrayHBDVariance_c));
 
-#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH
+#if HAVE_SSE4_1
 INSTANTIATE_TEST_CASE_P(
     SSE4_1, AvxHBDVarianceTest,
     ::testing::Values(
         VarianceParams(2, 2, &aom_highbd_8_variance4x4_sse4_1, 8),
         VarianceParams(2, 2, &aom_highbd_10_variance4x4_sse4_1, 10),
         VarianceParams(2, 2, &aom_highbd_12_variance4x4_sse4_1, 12)));
-#endif  // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH
+#endif  // HAVE_SSE4_1
 
 const SubpelVarianceParams kArrayHBDSubpelVariance_c[] = {
 #if CONFIG_AV1 && CONFIG_EXT_PARTITION
@@ -1185,7 +1154,6 @@
 };
 INSTANTIATE_TEST_CASE_P(C, AvxHBDSubpelAvgVarianceTest,
                         ::testing::ValuesIn(kArrayHBDSubpelAvgVariance_c));
-#endif  // CONFIG_HIGHBITDEPTH
 
 #if HAVE_SSE2
 INSTANTIATE_TEST_CASE_P(SSE2, SumOfSquaresTest,
@@ -1247,7 +1215,7 @@
         SubpelAvgVarianceParams(2, 3, &aom_sub_pixel_avg_variance4x8_sse2, 0),
         SubpelAvgVarianceParams(2, 2, &aom_sub_pixel_avg_variance4x4_sse2, 0)));
 
-#if HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH
+#if HAVE_SSE4_1
 INSTANTIATE_TEST_CASE_P(
     SSE4_1, AvxSubpelVarianceTest,
     ::testing::Values(
@@ -1270,9 +1238,8 @@
         SubpelAvgVarianceParams(2, 2,
                                 &aom_highbd_12_sub_pixel_avg_variance4x4_sse4_1,
                                 12)));
-#endif  // HAVE_SSE4_1 && CONFIG_HIGHBITDEPTH
+#endif  // HAVE_SSE4_1
 
-#if CONFIG_HIGHBITDEPTH
 /* TODO(debargha): This test does not support the highbd version
 INSTANTIATE_TEST_CASE_P(
     SSE2, AvxHBDMseTest,
@@ -1433,7 +1400,6 @@
 
 INSTANTIATE_TEST_CASE_P(SSE2, AvxHBDSubpelAvgVarianceTest,
                         ::testing::ValuesIn(kArrayHBDSubpelAvgVariance_sse2));
-#endif  // CONFIG_HIGHBITDEPTH
 #endif  // HAVE_SSE2
 
 #if HAVE_SSSE3
diff --git a/test/warp_filter_test.cc b/test/warp_filter_test.cc
index c6fc23b..3330162 100644
--- a/test/warp_filter_test.cc
+++ b/test/warp_filter_test.cc
@@ -16,9 +16,7 @@
 using std::tr1::make_tuple;
 using libaom_test::ACMRandom;
 using libaom_test::AV1WarpFilter::AV1WarpFilterTest;
-#if CONFIG_HIGHBITDEPTH
 using libaom_test::AV1HighbdWarpFilter::AV1HighbdWarpFilterTest;
-#endif
 
 namespace {
 
@@ -29,14 +27,12 @@
     SSE4_1, AV1WarpFilterTest,
     libaom_test::AV1WarpFilter::BuildParams(av1_warp_affine_sse4_1));
 
-#if CONFIG_HIGHBITDEPTH
 TEST_P(AV1HighbdWarpFilterTest, CheckOutput) {
   RunCheckOutput(av1_highbd_warp_affine_sse4_1);
 }
 
 INSTANTIATE_TEST_CASE_P(SSE4_1, AV1HighbdWarpFilterTest,
                         libaom_test::AV1HighbdWarpFilter::GetDefaultParams());
-#endif
 
 #else  // CONFIG_JNT_COMP && HAVE_SSE4_1
 TEST_P(AV1WarpFilterTest, CheckOutput) { RunCheckOutput(GET_PARAM(3)); }
@@ -49,9 +45,7 @@
 INSTANTIATE_TEST_CASE_P(
     SSSE3, AV1WarpFilterTest,
     libaom_test::AV1WarpFilter::BuildParams(av1_warp_affine_ssse3));
-#endif
 
-#if CONFIG_HIGHBITDEPTH && HAVE_SSSE3
 TEST_P(AV1HighbdWarpFilterTest, CheckOutput) {
   RunCheckOutput(av1_highbd_warp_affine_ssse3);
 }
diff --git a/test/warp_filter_test_util.cc b/test/warp_filter_test_util.cc
index 5613009..6b27a4e 100644
--- a/test/warp_filter_test_util.cc
+++ b/test/warp_filter_test_util.cc
@@ -198,7 +198,6 @@
 }
 }  // namespace AV1WarpFilter
 
-#if CONFIG_HIGHBITDEPTH
 namespace AV1HighbdWarpFilter {
 
 ::testing::internal::ParamGenerator<HighbdWarpTestParam> GetDefaultParams() {
@@ -391,5 +390,4 @@
   delete[] dstb;
 }
 }  // namespace AV1HighbdWarpFilter
-#endif  // CONFIG_HIGHBITDEPTH
 }  // namespace libaom_test
diff --git a/test/warp_filter_test_util.h b/test/warp_filter_test_util.h
index a7cda9a..67f447d 100644
--- a/test/warp_filter_test_util.h
+++ b/test/warp_filter_test_util.h
@@ -59,7 +59,6 @@
 
 }  // namespace AV1WarpFilter
 
-#if CONFIG_HIGHBITDEPTH
 namespace AV1HighbdWarpFilter {
 typedef void (*highbd_warp_affine_func)(const int32_t *mat, const uint16_t *ref,
                                         int width, int height, int stride,
@@ -93,7 +92,6 @@
 };
 
 }  // namespace AV1HighbdWarpFilter
-#endif  // CONFIG_HIGHBITDEPTH
 
 }  // namespace libaom_test
 
diff --git a/tools_common.c b/tools_common.c
index b7095e3..49f46e3 100644
--- a/tools_common.c
+++ b/tools_common.c
@@ -236,7 +236,6 @@
 }
 
 // TODO(debargha): Consolidate the functions below into a separate file.
-#if CONFIG_HIGHBITDEPTH
 static void highbd_img_upshift(aom_image_t *dst, aom_image_t *src,
                                int input_shift) {
   // Note the offset is 1 less than half.
@@ -427,4 +426,3 @@
     lowbd_img_downshift(dst, src, down_shift);
   }
 }
-#endif  // CONFIG_HIGHBITDEPTH
diff --git a/tools_common.h b/tools_common.h
index 0aa98ae..6fa9b6a 100644
--- a/tools_common.h
+++ b/tools_common.h
@@ -153,12 +153,9 @@
 int aom_img_read(aom_image_t *img, FILE *file);
 
 double sse_to_psnr(double samples, double peak, double mse);
-
-#if CONFIG_HIGHBITDEPTH
 void aom_img_upshift(aom_image_t *dst, aom_image_t *src, int input_shift);
 void aom_img_downshift(aom_image_t *dst, aom_image_t *src, int down_shift);
 void aom_img_truncate_16_to_8(aom_image_t *dst, aom_image_t *src);
-#endif
 
 #ifdef __cplusplus
 } /* extern "C" */