aom: disable av1_estimate_noise_from_single_plane_neon w/armv7

From def2ea6cf01a557b7dcbbc804f854d7b14813ae3 Mon Sep 17 00:00:00 2001
From: James Zern <[EMAIL REDACTED]>
Date: Tue, 25 Jun 2024 15:20:26 -0700
Subject: [PATCH] disable av1_estimate_noise_from_single_plane_neon w/armv7

This function causes a SIGBUS.

Bug: aomedia:349450845
Change-Id: Ib1f7b8c41dc711f82cf5f573ab45aadea7b5f2af
---
 av1/common/av1_rtcd_defs.pl            | 7 ++++++-
 av1/encoder/arm/temporal_filter_neon.c | 3 +++
 test/temporal_filter_test.cc           | 3 +++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/av1/common/av1_rtcd_defs.pl b/av1/common/av1_rtcd_defs.pl
index e9f6cbc61..c19c483c1 100644
--- a/av1/common/av1_rtcd_defs.pl
+++ b/av1/common/av1_rtcd_defs.pl
@@ -386,7 +386,12 @@ ()
     specialize qw/av1_apply_temporal_filter sse2 avx2 neon neon_dotprod/;
 
     add_proto qw/double av1_estimate_noise_from_single_plane/, "const uint8_t *src, int height, int width, int stride, int edge_thresh";
-    specialize qw/av1_estimate_noise_from_single_plane avx2 neon/;
+    # TODO(aomedia:349450845): enable NEON for armv7 after SIGBUS is fixed.
+    if (aom_config("AOM_ARCH_ARM") eq "yes" && aom_config("AOM_ARCH_AARCH64") eq "") {
+      specialize qw/av1_estimate_noise_from_single_plane avx2/;
+    } else {
+      specialize qw/av1_estimate_noise_from_single_plane avx2 neon/;
+    }
     if (aom_config("CONFIG_AV1_HIGHBITDEPTH") eq "yes") {
       add_proto qw/void av1_highbd_apply_temporal_filter/, "const struct yv12_buffer_config *frame_to_filter, const struct macroblockd *mbd, const BLOCK_SIZE block_size, const int mb_row, const int mb_col, const int num_planes, const double *noise_levels, const MV *subblock_mvs, const int *subblock_mses, const int q_factor, const int filter_strength, int tf_wgt_calc_lvl, const uint8_t *pred, uint32_t *accum, uint16_t *count";
       specialize qw/av1_highbd_apply_temporal_filter sse2 avx2 neon/;
diff --git a/av1/encoder/arm/temporal_filter_neon.c b/av1/encoder/arm/temporal_filter_neon.c
index 103324fbe..dffa36898 100644
--- a/av1/encoder/arm/temporal_filter_neon.c
+++ b/av1/encoder/arm/temporal_filter_neon.c
@@ -283,6 +283,8 @@ void av1_apply_temporal_filter_neon(
   }
 }
 
+// TODO(aomedia:349450845): enable for armv7 after SIGBUS is fixed.
+#if AOM_ARCH_AARCH64
 double av1_estimate_noise_from_single_plane_neon(const uint8_t *src, int height,
                                                  int width, int stride,
                                                  int edge_thresh) {
@@ -546,3 +548,4 @@ double av1_estimate_noise_from_single_plane_neon(const uint8_t *src, int height,
              ? -1.0
              : (double)final_acc / (6 * final_count) * SQRT_PI_BY_2;
 }
+#endif  // AOM_ARCH_AARCH64
diff --git a/test/temporal_filter_test.cc b/test/temporal_filter_test.cc
index 52e2366aa..be11e2c63 100644
--- a/test/temporal_filter_test.cc
+++ b/test/temporal_filter_test.cc
@@ -413,12 +413,15 @@ INSTANTIATE_TEST_SUITE_P(
 #endif  // HAVE_AVX2
 
 #if HAVE_NEON
+// TODO(aomedia:349450845): enable for armv7 after SIGBUS is fixed.
+#if AOM_ARCH_AARCH64
 INSTANTIATE_TEST_SUITE_P(
     NEON, EstimateNoiseTest,
     ::testing::Combine(
         ::testing::Values(av1_estimate_noise_from_single_plane_c),
         ::testing::Values(av1_estimate_noise_from_single_plane_neon),
         ::testing::ValuesIn(kWidths), ::testing::ValuesIn(kHeights)));
+#endif  // AOM_ARCH_AARCH64
 #endif  // HAVE_NEON
 
 #if CONFIG_AV1_HIGHBITDEPTH