Merge "Add explict conversion from int64_t to int" into nextgenv2
diff --git a/aom_dsp/aom_dsp_rtcd_defs.pl b/aom_dsp/aom_dsp_rtcd_defs.pl
index 2afb3cd..d885890 100644
--- a/aom_dsp/aom_dsp_rtcd_defs.pl
+++ b/aom_dsp/aom_dsp_rtcd_defs.pl
@@ -86,8 +86,12 @@
 add_proto qw/void aom_ve_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
 specialize qw/aom_ve_predictor_4x4/;
 
-add_proto qw/void aom_tm_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
-specialize qw/aom_tm_predictor_4x4 neon dspr2 msa sse2/;
+if ((aom_config("CONFIG_ALT_INTRA") eq "yes")) {
+  add_proto qw/void aom_paeth_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+} else {
+  add_proto qw/void aom_tm_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+  specialize qw/aom_tm_predictor_4x4 neon dspr2 msa sse2/;
+}  # CONFIG_ALT_INTRA
 
 add_proto qw/void aom_dc_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
 specialize qw/aom_dc_predictor_4x4 dspr2 msa neon sse2/;
@@ -134,8 +138,12 @@
 add_proto qw/void aom_v_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
 specialize qw/aom_v_predictor_8x8 neon msa sse2/;
 
-add_proto qw/void aom_tm_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
-specialize qw/aom_tm_predictor_8x8 neon dspr2 msa sse2/;
+if ((aom_config("CONFIG_ALT_INTRA") eq "yes")) {
+  add_proto qw/void aom_paeth_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+} else {
+  add_proto qw/void aom_tm_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+  specialize qw/aom_tm_predictor_8x8 neon dspr2 msa sse2/;
+}  # CONFIG_ALT_INTRA
 
 add_proto qw/void aom_dc_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
 specialize qw/aom_dc_predictor_8x8 dspr2 neon msa sse2/;
@@ -182,8 +190,13 @@
 add_proto qw/void aom_v_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
 specialize qw/aom_v_predictor_16x16 neon msa sse2/;
 
-add_proto qw/void aom_tm_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
-specialize qw/aom_tm_predictor_16x16 neon msa sse2/;
+if ((aom_config("CONFIG_ALT_INTRA") eq "yes")) {
+  add_proto qw/void aom_paeth_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+} else {
+  add_proto qw/void aom_tm_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+  specialize qw/aom_tm_predictor_16x16 neon msa sse2/;
+}  # CONFIG_ALT_INTRA
+
 
 add_proto qw/void aom_dc_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
 specialize qw/aom_dc_predictor_16x16 dspr2 neon msa sse2/;
@@ -230,8 +243,13 @@
 add_proto qw/void aom_v_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
 specialize qw/aom_v_predictor_32x32 neon msa sse2/;
 
-add_proto qw/void aom_tm_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
-specialize qw/aom_tm_predictor_32x32 neon msa sse2/;
+if ((aom_config("CONFIG_ALT_INTRA") eq "yes")) {
+  add_proto qw/void aom_paeth_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+} else {
+  add_proto qw/void aom_tm_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+  specialize qw/aom_tm_predictor_32x32 neon msa sse2/;
+}  # CONFIG_ALT_INTRA
+
 
 add_proto qw/void aom_dc_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
 specialize qw/aom_dc_predictor_32x32 msa neon sse2/;
@@ -280,8 +298,13 @@
   add_proto qw/void aom_highbd_v_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
   specialize qw/aom_highbd_v_predictor_4x4 sse2/;
 
-  add_proto qw/void aom_highbd_tm_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
-  specialize qw/aom_highbd_tm_predictor_4x4 sse2/;
+  if ((aom_config("CONFIG_ALT_INTRA") eq "yes")) {
+    add_proto qw/void aom_highbd_paeth_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
+  } else {
+    add_proto qw/void aom_highbd_tm_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
+    specialize qw/aom_highbd_tm_predictor_4x4 sse2/;
+  }  # CONFIG_ALT_INTRA
+
 
   add_proto qw/void aom_highbd_dc_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
   specialize qw/aom_highbd_dc_predictor_4x4 sse2/;
@@ -328,8 +351,12 @@
   add_proto qw/void aom_highbd_v_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
   specialize qw/aom_highbd_v_predictor_8x8 sse2/;
 
-  add_proto qw/void aom_highbd_tm_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
-  specialize qw/aom_highbd_tm_predictor_8x8 sse2/;
+  if ((aom_config("CONFIG_ALT_INTRA") eq "yes")) {
+    add_proto qw/void aom_highbd_paeth_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
+  } else {
+    add_proto qw/void aom_highbd_tm_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
+    specialize qw/aom_highbd_tm_predictor_8x8 sse2/;
+  }  # CONFIG_ALT_INTRA
 
   add_proto qw/void aom_highbd_dc_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
   specialize qw/aom_highbd_dc_predictor_8x8 sse2/;;
@@ -376,8 +403,12 @@
   add_proto qw/void aom_highbd_v_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
   specialize qw/aom_highbd_v_predictor_16x16 sse2/;
 
-  add_proto qw/void aom_highbd_tm_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
-  specialize qw/aom_highbd_tm_predictor_16x16 sse2/;
+  if ((aom_config("CONFIG_ALT_INTRA") eq "yes")) {
+    add_proto qw/void aom_highbd_paeth_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
+  } else {
+    add_proto qw/void aom_highbd_tm_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
+    specialize qw/aom_highbd_tm_predictor_16x16 sse2/;
+  }  # CONFIG_ALT_INTRA
 
   add_proto qw/void aom_highbd_dc_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
   specialize qw/aom_highbd_dc_predictor_16x16 sse2/;
@@ -424,8 +455,12 @@
   add_proto qw/void aom_highbd_v_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
   specialize qw/aom_highbd_v_predictor_32x32 sse2/;
 
-  add_proto qw/void aom_highbd_tm_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
-  specialize qw/aom_highbd_tm_predictor_32x32 sse2/;
+  if ((aom_config("CONFIG_ALT_INTRA") eq "yes")) {
+    add_proto qw/void aom_highbd_paeth_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
+  } else {
+    add_proto qw/void aom_highbd_tm_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
+    specialize qw/aom_highbd_tm_predictor_32x32 sse2/;
+  }  # CONFIG_ALT_INTRA
 
   add_proto qw/void aom_highbd_dc_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd";
   specialize qw/aom_highbd_dc_predictor_32x32 sse2/;
diff --git a/aom_dsp/intrapred.c b/aom_dsp/intrapred.c
index df4ec80..52f0b35 100644
--- a/aom_dsp/intrapred.c
+++ b/aom_dsp/intrapred.c
@@ -218,6 +218,36 @@
   }
 }
 
+#if CONFIG_ALT_INTRA
+static INLINE int abs_diff(int a, int b) { return (a > b) ? a - b : b - a; }
+
+static INLINE uint16_t paeth_predictor_single(uint16_t left, uint16_t top,
+                                              uint16_t top_left) {
+  const int base = top + left - top_left;
+  const int p_left = abs_diff(base, left);
+  const int p_top = abs_diff(base, top);
+  const int p_top_left = abs_diff(base, top_left);
+
+  // Return nearest to base of left, top and top_left.
+  return (p_left <= p_top && p_left <= p_top_left)
+             ? left
+             : (p_top <= p_top_left) ? top : top_left;
+}
+
+static INLINE void paeth_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
+                                   const uint8_t *above, const uint8_t *left) {
+  int r, c;
+  const uint8_t ytop_left = above[-1];
+
+  for (r = 0; r < bs; r++) {
+    for (c = 0; c < bs; c++)
+      dst[c] = (uint8_t)paeth_predictor_single(left[r], above[c], ytop_left);
+    dst += stride;
+  }
+}
+
+#else
+
 static INLINE void tm_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
                                 const uint8_t *above, const uint8_t *left) {
   int r, c;
@@ -229,6 +259,7 @@
     dst += stride;
   }
 }
+#endif  // CONFIG_ALT_INTRA
 
 static INLINE void dc_128_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
                                     const uint8_t *above, const uint8_t *left) {
@@ -688,6 +719,22 @@
   }
 }
 
+#if CONFIG_ALT_INTRA
+static INLINE void highbd_paeth_predictor(uint16_t *dst, ptrdiff_t stride,
+                                          int bs, const uint16_t *above,
+                                          const uint16_t *left, int bd) {
+  int r, c;
+  const uint16_t ytop_left = above[-1];
+  (void)bd;
+
+  for (r = 0; r < bs; r++) {
+    for (c = 0; c < bs; c++)
+      dst[c] = paeth_predictor_single(left[r], above[c], ytop_left);
+    dst += stride;
+  }
+}
+
+#else
 static INLINE void highbd_tm_predictor(uint16_t *dst, ptrdiff_t stride, int bs,
                                        const uint16_t *above,
                                        const uint16_t *left, int bd) {
@@ -701,6 +748,7 @@
     dst += stride;
   }
 }
+#endif  // CONFIG_ALT_INTRA
 
 static INLINE void highbd_dc_128_predictor(uint16_t *dst, ptrdiff_t stride,
                                            int bs, const uint16_t *above,
@@ -830,7 +878,11 @@
 intra_pred_no_4x4(d153)
 intra_pred_allsizes(v)
 intra_pred_allsizes(h)
+#if CONFIG_ALT_INTRA
+intra_pred_allsizes(paeth)
+#else
 intra_pred_allsizes(tm)
+#endif  // CONFIG_ALT_INTRA
 intra_pred_allsizes(dc_128)
 intra_pred_allsizes(dc_left)
 intra_pred_allsizes(dc_top)
diff --git a/av1/common/reconintra.c b/av1/common/reconintra.c
index e1bf6f0..3dc1974 100644
--- a/av1/common/reconintra.c
+++ b/av1/common/reconintra.c
@@ -335,7 +335,12 @@
   INIT_ALL_SIZES(pred[D117_PRED], d117);
   INIT_ALL_SIZES(pred[D135_PRED], d135);
   INIT_ALL_SIZES(pred[D153_PRED], d153);
+
+#if CONFIG_ALT_INTRA
+  INIT_ALL_SIZES(pred[TM_PRED], paeth);
+#else
   INIT_ALL_SIZES(pred[TM_PRED], tm);
+#endif  // CONFIG_ALT_INTRA
 
   INIT_ALL_SIZES(dc_pred[0][0], dc_128);
   INIT_ALL_SIZES(dc_pred[0][1], dc_top);
@@ -351,7 +356,12 @@
   INIT_ALL_SIZES(pred_high[D117_PRED], highbd_d117);
   INIT_ALL_SIZES(pred_high[D135_PRED], highbd_d135);
   INIT_ALL_SIZES(pred_high[D153_PRED], highbd_d153);
+
+#if CONFIG_ALT_INTRA
+  INIT_ALL_SIZES(pred_high[TM_PRED], highbd_paeth);
+#else
   INIT_ALL_SIZES(pred_high[TM_PRED], highbd_tm);
+#endif  // CONFIG_ALT_INTRA
 
   INIT_ALL_SIZES(dc_pred_high[0][0], highbd_dc_128);
   INIT_ALL_SIZES(dc_pred_high[0][1], highbd_dc_top);
diff --git a/configure b/configure
index 3a7cca8..c96691ba 100755
--- a/configure
+++ b/configure
@@ -276,6 +276,7 @@
     entropy
     bidir_pred
     bitstream_debug
+    alt_intra
 "
 CONFIG_LIST="
     dependency_tracking
diff --git a/test/intrapred_test.cc b/test/intrapred_test.cc
index efa57f7..e635234 100644
--- a/test/intrapred_test.cc
+++ b/test/intrapred_test.cc
@@ -129,10 +129,13 @@
     SSE2_TO_C_8, AV1IntraPredTest,
     ::testing::Values(IntraPredFunc(&aom_highbd_dc_predictor_32x32_sse2,
                                     &aom_highbd_dc_predictor_32x32_c, 32, 8),
+#if !CONFIG_ALT_INTRA
                       IntraPredFunc(&aom_highbd_tm_predictor_16x16_sse2,
                                     &aom_highbd_tm_predictor_16x16_c, 16, 8),
                       IntraPredFunc(&aom_highbd_tm_predictor_32x32_sse2,
                                     &aom_highbd_tm_predictor_32x32_c, 32, 8),
+#endif  // !CONFIG_ALT_INTRA
+
                       IntraPredFunc(&aom_highbd_dc_predictor_4x4_sse2,
                                     &aom_highbd_dc_predictor_4x4_c, 4, 8),
                       IntraPredFunc(&aom_highbd_dc_predictor_8x8_sse2,
@@ -146,20 +149,26 @@
                       IntraPredFunc(&aom_highbd_v_predictor_16x16_sse2,
                                     &aom_highbd_v_predictor_16x16_c, 16, 8),
                       IntraPredFunc(&aom_highbd_v_predictor_32x32_sse2,
-                                    &aom_highbd_v_predictor_32x32_c, 32, 8),
+                                    &aom_highbd_v_predictor_32x32_c, 32, 8)
+#if !CONFIG_ALT_INTRA
+                          ,
                       IntraPredFunc(&aom_highbd_tm_predictor_4x4_sse2,
                                     &aom_highbd_tm_predictor_4x4_c, 4, 8),
                       IntraPredFunc(&aom_highbd_tm_predictor_8x8_sse2,
-                                    &aom_highbd_tm_predictor_8x8_c, 8, 8)));
+                                    &aom_highbd_tm_predictor_8x8_c, 8, 8)
+#endif  // !CONFIG_ALT_INTRA
+                          ));
 
 INSTANTIATE_TEST_CASE_P(
     SSE2_TO_C_10, AV1IntraPredTest,
     ::testing::Values(IntraPredFunc(&aom_highbd_dc_predictor_32x32_sse2,
                                     &aom_highbd_dc_predictor_32x32_c, 32, 10),
+#if !CONFIG_ALT_INTRA
                       IntraPredFunc(&aom_highbd_tm_predictor_16x16_sse2,
                                     &aom_highbd_tm_predictor_16x16_c, 16, 10),
                       IntraPredFunc(&aom_highbd_tm_predictor_32x32_sse2,
                                     &aom_highbd_tm_predictor_32x32_c, 32, 10),
+#endif  // !CONFIG_ALT_INTRA
                       IntraPredFunc(&aom_highbd_dc_predictor_4x4_sse2,
                                     &aom_highbd_dc_predictor_4x4_c, 4, 10),
                       IntraPredFunc(&aom_highbd_dc_predictor_8x8_sse2,
@@ -173,20 +182,26 @@
                       IntraPredFunc(&aom_highbd_v_predictor_16x16_sse2,
                                     &aom_highbd_v_predictor_16x16_c, 16, 10),
                       IntraPredFunc(&aom_highbd_v_predictor_32x32_sse2,
-                                    &aom_highbd_v_predictor_32x32_c, 32, 10),
+                                    &aom_highbd_v_predictor_32x32_c, 32, 10)
+#if !CONFIG_ALT_INTRA
+                          ,
                       IntraPredFunc(&aom_highbd_tm_predictor_4x4_sse2,
                                     &aom_highbd_tm_predictor_4x4_c, 4, 10),
                       IntraPredFunc(&aom_highbd_tm_predictor_8x8_sse2,
-                                    &aom_highbd_tm_predictor_8x8_c, 8, 10)));
+                                    &aom_highbd_tm_predictor_8x8_c, 8, 10)
+#endif  // !CONFIG_ALT_INTRA
+                          ));
 
 INSTANTIATE_TEST_CASE_P(
     SSE2_TO_C_12, AV1IntraPredTest,
     ::testing::Values(IntraPredFunc(&aom_highbd_dc_predictor_32x32_sse2,
                                     &aom_highbd_dc_predictor_32x32_c, 32, 12),
+#if !CONFIG_ALT_INTRA
                       IntraPredFunc(&aom_highbd_tm_predictor_16x16_sse2,
                                     &aom_highbd_tm_predictor_16x16_c, 16, 12),
                       IntraPredFunc(&aom_highbd_tm_predictor_32x32_sse2,
                                     &aom_highbd_tm_predictor_32x32_c, 32, 12),
+#endif  // !CONFIG_ALT_INTRA
                       IntraPredFunc(&aom_highbd_dc_predictor_4x4_sse2,
                                     &aom_highbd_dc_predictor_4x4_c, 4, 12),
                       IntraPredFunc(&aom_highbd_dc_predictor_8x8_sse2,
@@ -200,11 +215,15 @@
                       IntraPredFunc(&aom_highbd_v_predictor_16x16_sse2,
                                     &aom_highbd_v_predictor_16x16_c, 16, 12),
                       IntraPredFunc(&aom_highbd_v_predictor_32x32_sse2,
-                                    &aom_highbd_v_predictor_32x32_c, 32, 12),
+                                    &aom_highbd_v_predictor_32x32_c, 32, 12)
+#if !CONFIG_ALT_INTRA
+                          ,
                       IntraPredFunc(&aom_highbd_tm_predictor_4x4_sse2,
                                     &aom_highbd_tm_predictor_4x4_c, 4, 12),
                       IntraPredFunc(&aom_highbd_tm_predictor_8x8_sse2,
-                                    &aom_highbd_tm_predictor_8x8_c, 8, 12)));
+                                    &aom_highbd_tm_predictor_8x8_c, 8, 12)
+#endif  // !CONFIG_ALT_INTRA
+                          ));
 
 #endif  // CONFIG_AOM_HIGHBITDEPTH
 #endif  // HAVE_SSE2
diff --git a/test/test_intra_pred_speed.cc b/test/test_intra_pred_speed.cc
index 5f08dec..cd1e2a1 100644
--- a/test/test_intra_pred_speed.cc
+++ b/test/test_intra_pred_speed.cc
@@ -161,7 +161,13 @@
                 aom_h_predictor_4x4_c, aom_d45_predictor_4x4_c,
                 aom_d135_predictor_4x4_c, aom_d117_predictor_4x4_c,
                 aom_d153_predictor_4x4_c, aom_d207_predictor_4x4_c,
-                aom_d63_predictor_4x4_c, aom_tm_predictor_4x4_c)
+                aom_d63_predictor_4x4_c,
+#if CONFIG_ALT_INTRA
+                aom_paeth_predictor_4x4_c
+#else
+                aom_tm_predictor_4x4_c
+#endif  // CONFIG_ALT_INTRA
+                )
 
 #if HAVE_SSE2
 INTRA_PRED_TEST(SSE2, TestIntraPred4, aom_dc_predictor_4x4_sse2,
@@ -169,7 +175,12 @@
                 aom_dc_128_predictor_4x4_sse2, aom_v_predictor_4x4_sse2,
                 aom_h_predictor_4x4_sse2, aom_d45_predictor_4x4_sse2, NULL,
                 NULL, NULL, aom_d207_predictor_4x4_sse2, NULL,
-                aom_tm_predictor_4x4_sse2)
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_4x4_sse2
+#endif  // CONFIG_ALT_INTRA
+                )
 #endif  // HAVE_SSE2
 
 #if HAVE_SSSE3
@@ -181,7 +192,13 @@
 #if HAVE_DSPR2
 INTRA_PRED_TEST(DSPR2, TestIntraPred4, aom_dc_predictor_4x4_dspr2, NULL, NULL,
                 NULL, NULL, aom_h_predictor_4x4_dspr2, NULL, NULL, NULL, NULL,
-                NULL, NULL, aom_tm_predictor_4x4_dspr2)
+                NULL, NULL,
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_4x4_dspr2
+#endif  // CONFIG_ALT_INTRA
+                )
 #endif  // HAVE_DSPR2
 
 #if HAVE_NEON
@@ -190,7 +207,12 @@
                 aom_dc_128_predictor_4x4_neon, aom_v_predictor_4x4_neon,
                 aom_h_predictor_4x4_neon, aom_d45_predictor_4x4_neon,
                 aom_d135_predictor_4x4_neon, NULL, NULL, NULL, NULL,
-                aom_tm_predictor_4x4_neon)
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_4x4_neon
+#endif  // CONFIG_ALT_INTRA
+                )
 #endif  // HAVE_NEON
 
 #if HAVE_MSA
@@ -198,7 +220,12 @@
                 aom_dc_left_predictor_4x4_msa, aom_dc_top_predictor_4x4_msa,
                 aom_dc_128_predictor_4x4_msa, aom_v_predictor_4x4_msa,
                 aom_h_predictor_4x4_msa, NULL, NULL, NULL, NULL, NULL, NULL,
-                aom_tm_predictor_4x4_msa)
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_4x4_msa
+#endif  // CONFIG_ALT_INTRA
+                )
 #endif  // HAVE_MSA
 
 // -----------------------------------------------------------------------------
@@ -210,14 +237,26 @@
                 aom_h_predictor_8x8_c, aom_d45_predictor_8x8_c,
                 aom_d135_predictor_8x8_c, aom_d117_predictor_8x8_c,
                 aom_d153_predictor_8x8_c, aom_d207_predictor_8x8_c,
-                aom_d63_predictor_8x8_c, aom_tm_predictor_8x8_c)
+                aom_d63_predictor_8x8_c,
+#if CONFIG_ALT_INTRA
+                aom_paeth_predictor_8x8_c
+#else
+                aom_tm_predictor_8x8_c
+#endif  // CONFIG_ALT_INTRA
+                )
 
 #if HAVE_SSE2
 INTRA_PRED_TEST(SSE2, TestIntraPred8, aom_dc_predictor_8x8_sse2,
                 aom_dc_left_predictor_8x8_sse2, aom_dc_top_predictor_8x8_sse2,
                 aom_dc_128_predictor_8x8_sse2, aom_v_predictor_8x8_sse2,
                 aom_h_predictor_8x8_sse2, aom_d45_predictor_8x8_sse2, NULL,
-                NULL, NULL, NULL, NULL, aom_tm_predictor_8x8_sse2)
+                NULL, NULL, NULL, NULL,
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_8x8_sse2
+#endif  // CONFIG_ALT_INTRA
+                )
 #endif  // HAVE_SSE2
 
 #if HAVE_SSSE3
@@ -229,7 +268,13 @@
 #if HAVE_DSPR2
 INTRA_PRED_TEST(DSPR2, TestIntraPred8, aom_dc_predictor_8x8_dspr2, NULL, NULL,
                 NULL, NULL, aom_h_predictor_8x8_dspr2, NULL, NULL, NULL, NULL,
-                NULL, NULL, aom_tm_predictor_8x8_dspr2)
+                NULL, NULL,
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_8x8_dspr2
+#endif  // CONFIG_ALT_INTRA
+                )
 #endif  // HAVE_DSPR2
 
 #if HAVE_NEON
@@ -237,7 +282,13 @@
                 aom_dc_left_predictor_8x8_neon, aom_dc_top_predictor_8x8_neon,
                 aom_dc_128_predictor_8x8_neon, aom_v_predictor_8x8_neon,
                 aom_h_predictor_8x8_neon, aom_d45_predictor_8x8_neon, NULL,
-                NULL, NULL, NULL, NULL, aom_tm_predictor_8x8_neon)
+                NULL, NULL, NULL, NULL,
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_8x8_neon
+#endif  // CONFIG_ALT_INTRA
+                )
 
 #endif  // HAVE_NEON
 
@@ -246,7 +297,12 @@
                 aom_dc_left_predictor_8x8_msa, aom_dc_top_predictor_8x8_msa,
                 aom_dc_128_predictor_8x8_msa, aom_v_predictor_8x8_msa,
                 aom_h_predictor_8x8_msa, NULL, NULL, NULL, NULL, NULL, NULL,
-                aom_tm_predictor_8x8_msa)
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_8x8_msa
+#endif  // CONFIG_ALT_INTRA
+                )
 #endif  // HAVE_MSA
 
 // -----------------------------------------------------------------------------
@@ -258,7 +314,13 @@
                 aom_h_predictor_16x16_c, aom_d45_predictor_16x16_c,
                 aom_d135_predictor_16x16_c, aom_d117_predictor_16x16_c,
                 aom_d153_predictor_16x16_c, aom_d207_predictor_16x16_c,
-                aom_d63_predictor_16x16_c, aom_tm_predictor_16x16_c)
+                aom_d63_predictor_16x16_c,
+#if CONFIG_ALT_INTRA
+                aom_paeth_predictor_16x16_c
+#else
+                aom_tm_predictor_16x16_c
+#endif  // CONFIG_ALT_INTRA
+                )
 
 #if HAVE_SSE2
 INTRA_PRED_TEST(SSE2, TestIntraPred16, aom_dc_predictor_16x16_sse2,
@@ -266,7 +328,12 @@
                 aom_dc_top_predictor_16x16_sse2,
                 aom_dc_128_predictor_16x16_sse2, aom_v_predictor_16x16_sse2,
                 aom_h_predictor_16x16_sse2, NULL, NULL, NULL, NULL, NULL, NULL,
-                aom_tm_predictor_16x16_sse2)
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_16x16_sse2
+#endif  // CONFIG_ALT_INTRA
+                )
 #endif  // HAVE_SSE2
 
 #if HAVE_SSSE3
@@ -288,7 +355,13 @@
                 aom_dc_top_predictor_16x16_neon,
                 aom_dc_128_predictor_16x16_neon, aom_v_predictor_16x16_neon,
                 aom_h_predictor_16x16_neon, aom_d45_predictor_16x16_neon, NULL,
-                NULL, NULL, NULL, NULL, aom_tm_predictor_16x16_neon)
+                NULL, NULL, NULL, NULL,
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_16x16_neon
+#endif  // CONFIG_ALT_INTRA
+                )
 #endif  // HAVE_NEON
 
 #if HAVE_MSA
@@ -296,7 +369,12 @@
                 aom_dc_left_predictor_16x16_msa, aom_dc_top_predictor_16x16_msa,
                 aom_dc_128_predictor_16x16_msa, aom_v_predictor_16x16_msa,
                 aom_h_predictor_16x16_msa, NULL, NULL, NULL, NULL, NULL, NULL,
-                aom_tm_predictor_16x16_msa)
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_16x16_msa
+#endif  // CONFIG_ALT_INTRA
+                )
 #endif  // HAVE_MSA
 
 // -----------------------------------------------------------------------------
@@ -308,7 +386,13 @@
                 aom_h_predictor_32x32_c, aom_d45_predictor_32x32_c,
                 aom_d135_predictor_32x32_c, aom_d117_predictor_32x32_c,
                 aom_d153_predictor_32x32_c, aom_d207_predictor_32x32_c,
-                aom_d63_predictor_32x32_c, aom_tm_predictor_32x32_c)
+                aom_d63_predictor_32x32_c,
+#if CONFIG_ALT_INTRA
+                aom_paeth_predictor_32x32_c
+#else
+                aom_tm_predictor_32x32_c
+#endif  // CONFIG_ALT_INTRA
+                )
 
 #if HAVE_SSE2
 INTRA_PRED_TEST(SSE2, TestIntraPred32, aom_dc_predictor_32x32_sse2,
@@ -316,7 +400,12 @@
                 aom_dc_top_predictor_32x32_sse2,
                 aom_dc_128_predictor_32x32_sse2, aom_v_predictor_32x32_sse2,
                 aom_h_predictor_32x32_sse2, NULL, NULL, NULL, NULL, NULL, NULL,
-                aom_tm_predictor_32x32_sse2)
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_32x32_sse2
+#endif  // CONFIG_ALT_INTRA
+                )
 #endif  // HAVE_SSE2
 
 #if HAVE_SSSE3
@@ -332,7 +421,12 @@
                 aom_dc_top_predictor_32x32_neon,
                 aom_dc_128_predictor_32x32_neon, aom_v_predictor_32x32_neon,
                 aom_h_predictor_32x32_neon, NULL, NULL, NULL, NULL, NULL, NULL,
-                aom_tm_predictor_32x32_neon)
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_32x32_neon
+#endif  // CONFIG_ALT_INTRA
+                )
 #endif  // HAVE_NEON
 
 #if HAVE_MSA
@@ -340,7 +434,12 @@
                 aom_dc_left_predictor_32x32_msa, aom_dc_top_predictor_32x32_msa,
                 aom_dc_128_predictor_32x32_msa, aom_v_predictor_32x32_msa,
                 aom_h_predictor_32x32_msa, NULL, NULL, NULL, NULL, NULL, NULL,
-                aom_tm_predictor_32x32_msa)
+#if CONFIG_ALT_INTRA
+                NULL
+#else
+                aom_tm_predictor_32x32_msa
+#endif  // CONFIG_ALT_INTRA
+                )
 #endif  // HAVE_MSA
 
 #include "test/test_libaom.cc"