From 0f98fd86d52f5aa295f1b89c7acb0ee6de35a410 Mon Sep 17 00:00:00 2001
From: James Zern <[EMAIL REDACTED]>
Date: Mon, 19 Aug 2024 12:40:58 -0700
Subject: [PATCH] remove aom_get_mb_ss() w/CONFIG_REALTIME_ONLY=1
This function is only used in firstpass.c.
Bug: aomedia:3416
Change-Id: Ia06f86e9a0a2277fd65c92c93ffdb45869bd314a
---
aom_dsp/aom_dsp_rtcd_defs.pl | 9 ++++-----
aom_dsp/arm/variance_neon.c | 2 ++
aom_dsp/variance.c | 2 ++
aom_dsp/x86/variance_sse2.c | 2 ++
test/variance_test.cc | 6 ++++++
5 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/aom_dsp/aom_dsp_rtcd_defs.pl b/aom_dsp/aom_dsp_rtcd_defs.pl
index a7f74eee3..f0af31d80 100755
--- a/aom_dsp/aom_dsp_rtcd_defs.pl
+++ b/aom_dsp/aom_dsp_rtcd_defs.pl
@@ -1341,11 +1341,10 @@ ()
}
}
- #
- #
- #
- add_proto qw/unsigned int aom_get_mb_ss/, "const int16_t *";
- specialize qw/aom_get_mb_ss sse2 neon/;
+ if (aom_config("CONFIG_REALTIME_ONLY") ne "yes") {
+ add_proto qw/unsigned int aom_get_mb_ss/, "const int16_t *";
+ specialize qw/aom_get_mb_ss sse2 neon/;
+ }
#
# Variance / Subpixel Variance / Subpixel Avg Variance
diff --git a/aom_dsp/arm/variance_neon.c b/aom_dsp/arm/variance_neon.c
index 74524add0..fb46857a7 100644
--- a/aom_dsp/arm/variance_neon.c
+++ b/aom_dsp/arm/variance_neon.c
@@ -445,6 +445,7 @@ uint64_t aom_mse_wxh_16bit_neon(uint8_t *dst, int dstride, uint16_t *src,
return horizontal_add_u64x2(mse_wxh_16bit(dst, dstride, src, sstride, w, h));
}
+#if !CONFIG_REALTIME_ONLY
uint32_t aom_get_mb_ss_neon(const int16_t *a) {
int32x4_t sse[2] = { vdupq_n_s32(0), vdupq_n_s32(0) };
@@ -457,6 +458,7 @@ uint32_t aom_get_mb_ss_neon(const int16_t *a) {
return horizontal_add_s32x4(vaddq_s32(sse[0], sse[1]));
}
+#endif // !CONFIG_REALTIME_ONLY
uint64_t aom_mse_16xh_16bit_neon(uint8_t *dst, int dstride, uint16_t *src,
int w, int h) {
diff --git a/aom_dsp/variance.c b/aom_dsp/variance.c
index e1cc07af6..6481cf7f3 100644
--- a/aom_dsp/variance.c
+++ b/aom_dsp/variance.c
@@ -24,6 +24,7 @@
#include "av1/common/filter.h"
#include "av1/common/reconinter.h"
+#if !CONFIG_REALTIME_ONLY
uint32_t aom_get_mb_ss_c(const int16_t *a) {
unsigned int i, sum = 0;
@@ -33,6 +34,7 @@ uint32_t aom_get_mb_ss_c(const int16_t *a) {
return sum;
}
+#endif // !CONFIG_REALTIME_ONLY
static void variance(const uint8_t *a, int a_stride, const uint8_t *b,
int b_stride, int w, int h, uint32_t *sse, int *sum) {
diff --git a/aom_dsp/x86/variance_sse2.c b/aom_dsp/x86/variance_sse2.c
index 9d6a238a2..8731e953c 100644
--- a/aom_dsp/x86/variance_sse2.c
+++ b/aom_dsp/x86/variance_sse2.c
@@ -20,6 +20,7 @@
#include "aom_dsp/x86/synonyms.h"
#include "aom_ports/mem.h"
+#if !CONFIG_REALTIME_ONLY
unsigned int aom_get_mb_ss_sse2(const int16_t *src) {
__m128i vsum = _mm_setzero_si128();
int i;
@@ -34,6 +35,7 @@ unsigned int aom_get_mb_ss_sse2(const int16_t *src) {
vsum = _mm_add_epi32(vsum, _mm_srli_si128(vsum, 4));
return (unsigned int)_mm_cvtsi128_si32(vsum);
}
+#endif // !CONFIG_REALTIME_ONLY
static inline __m128i load4x2_sse2(const uint8_t *const p, const int stride) {
const __m128i p0 = _mm_cvtsi32_si128(loadu_int32(p + 0 * stride));
diff --git a/test/variance_test.cc b/test/variance_test.cc
index 6f98ae4ad..144338e8d 100644
--- a/test/variance_test.cc
+++ b/test/variance_test.cc
@@ -1756,8 +1756,10 @@ INSTANTIATE_TEST_SUITE_P(
Mse16xHParams(2, 3, &aom_mse_16xh_16bit_c, 8),
Mse16xHParams(2, 2, &aom_mse_16xh_16bit_c, 8)));
+#if !CONFIG_REALTIME_ONLY
INSTANTIATE_TEST_SUITE_P(C, SumOfSquaresTest,
::testing::Values(aom_get_mb_ss_c));
+#endif // !CONFIG_REALTIME_ONLY
typedef TestParams<VarianceMxNFunc> MseParams;
INSTANTIATE_TEST_SUITE_P(C, AvxMseTest,
@@ -2729,8 +2731,10 @@ INSTANTIATE_TEST_SUITE_P(
Mse16xHParams(2, 3, &aom_mse_16xh_16bit_sse2, 8),
Mse16xHParams(2, 2, &aom_mse_16xh_16bit_sse2, 8)));
+#if !CONFIG_REALTIME_ONLY
INSTANTIATE_TEST_SUITE_P(SSE2, SumOfSquaresTest,
::testing::Values(aom_get_mb_ss_sse2));
+#endif // !CONFIG_REALTIME_ONLY
INSTANTIATE_TEST_SUITE_P(SSE2, AvxMseTest,
::testing::Values(MseParams(4, 4, &aom_mse16x16_sse2),
@@ -3411,8 +3415,10 @@ INSTANTIATE_TEST_SUITE_P(
Mse16xHParams(2, 3, &aom_mse_16xh_16bit_neon, 8),
Mse16xHParams(2, 2, &aom_mse_16xh_16bit_neon, 8)));
+#if !CONFIG_REALTIME_ONLY
INSTANTIATE_TEST_SUITE_P(NEON, SumOfSquaresTest,
::testing::Values(aom_get_mb_ss_neon));
+#endif // !CONFIG_REALTIME_ONLY
INSTANTIATE_TEST_SUITE_P(NEON, AvxMseTest,
::testing::Values(MseParams(3, 3, &aom_mse8x8_neon),