Fix standard bitdepth-only builds
The kHbdDotProdMergeBlockTbl constant table defined in
higbd_convolve_sve2.c is used in standard bit-depth convolve_sve2.c,
which causes a compilation error for standard bidepth-only builds. Move
the table definition to convolve_sve2.c to avoid the error. Also rename
the table to better reflect the purpose.
Similarly, move aom_tbl2x2_s16 helper function used by convolve_sve2.c
from highbd_convolve_sve2.h to convolve_sve2.h to avoid including the
high bit-depth header in standard bit-depth .c files.
Also move highbd_warp_plane_sve.c in av1.cmake to the dedicated high
bit-depth section as it is not used for standard bit-depth.
Change-Id: I29ece9130a9aadb5cdd87f1e6ab9e9c42aa67f24
diff --git a/av1/av1.cmake b/av1/av1.cmake
index b2f1bdf..14346a1 100644
--- a/av1/av1.cmake
+++ b/av1/av1.cmake
@@ -466,7 +466,6 @@
"${AOM_ROOT}/av1/common/arm/warp_plane_neon_i8mm.c")
list(APPEND AOM_AV1_COMMON_INTRIN_SVE
- "${AOM_ROOT}/av1/common/arm/highbd_warp_plane_sve.c"
"${AOM_ROOT}/av1/common/arm/warp_plane_sve.c")
list(APPEND AOM_AV1_COMMON_INTRIN_SVE2
@@ -550,6 +549,9 @@
"${AOM_ROOT}/av1/common/arm/highbd_warp_plane_neon.c"
"${AOM_ROOT}/av1/common/arm/highbd_wiener_convolve_neon.c")
+ list(APPEND AOM_AV1_COMMON_INTRIN_SVE
+ "${AOM_ROOT}/av1/common/arm/highbd_warp_plane_sve.c")
+
list(APPEND AOM_AV1_COMMON_INTRIN_SVE2
"${AOM_ROOT}/av1/common/arm/highbd_compound_convolve_sve2.c"
"${AOM_ROOT}/av1/common/arm/highbd_convolve_sve2.c")
diff --git a/av1/common/arm/convolve_sve2.c b/av1/common/arm/convolve_sve2.c
index 8090b24..ae00386 100644
--- a/av1/common/arm/convolve_sve2.c
+++ b/av1/common/arm/convolve_sve2.c
@@ -23,9 +23,20 @@
#include "aom_dsp/arm/mem_neon.h"
#include "aom_dsp/arm/transpose_neon.h"
#include "aom_ports/mem.h"
-#include "av1/common/arm/highbd_convolve_sve2.h"
+#include "av1/common/arm/convolve_sve2.h"
#include "av1/common/arm/convolve_neon_i8mm.h"
+// clang-format off
+DECLARE_ALIGNED(16, const uint16_t, kSVEDotProdMergeBlockTbl[24]) = {
+ // Shift left and insert new last column in transposed 4x4 block.
+ 1, 2, 3, 0, 5, 6, 7, 4,
+ // Shift left and insert two new columns in transposed 4x4 block.
+ 2, 3, 0, 1, 6, 7, 4, 5,
+ // Shift left and insert three new columns in transposed 4x4 block.
+ 3, 0, 1, 2, 7, 4, 5, 6,
+};
+// clang-format on
+
static inline int32x4_t highbd_convolve12_4_2d_v(int16x8_t s0[2],
int16x8_t s1[2],
int16x8_t s2[2],
@@ -52,7 +63,7 @@
const int bd = 8;
const int16x8_t sub_const = vdupq_n_s16(1 << (bd - 1));
- uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kHbdDotProdMergeBlockTbl);
+ uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kSVEDotProdMergeBlockTbl);
// Scale indices by size of the true vector length to avoid reading from an
// 'undefined' portion of a vector on a system with SVE vectors > 128-bit.
uint16x8_t correction0 =
diff --git a/av1/common/arm/convolve_sve2.h b/av1/common/arm/convolve_sve2.h
new file mode 100644
index 0000000..bd02153
--- /dev/null
+++ b/av1/common/arm/convolve_sve2.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2025, Alliance for Open Media. All rights reserved.
+ *
+ * This source code is subject to the terms of the BSD 2 Clause License and
+ * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
+ * was not distributed with this source code in the LICENSE file, you can
+ * obtain it at www.aomedia.org/license/software. If the Alliance for Open
+ * Media Patent License 1.0 was not distributed with this source code in the
+ * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
+ */
+
+#ifndef AOM_AV1_COMMON_ARM_CONVOLVE_SVE2_H_
+#define AOM_AV1_COMMON_ARM_CONVOLVE_SVE2_H_
+
+#include "aom_dsp/arm/aom_neon_sve2_bridge.h"
+#include "aom_ports/mem.h"
+
+DECLARE_ALIGNED(16, extern const uint16_t, kSVEDotProdMergeBlockTbl[24]);
+
+static inline void aom_tbl2x2_s16(int16x8_t t0[2], int16x8_t t1[2],
+ uint16x8_t tbl, int16x8_t res[2]) {
+ res[0] = aom_tbl2_s16(t0[0], t1[0], tbl);
+ res[1] = aom_tbl2_s16(t0[1], t1[1], tbl);
+}
+
+#endif // AOM_AV1_COMMON_ARM_CONVOLVE_SVE2_H_
diff --git a/av1/common/arm/highbd_compound_convolve_sve2.c b/av1/common/arm/highbd_compound_convolve_sve2.c
index 36c0ae7..e5fbe41 100644
--- a/av1/common/arm/highbd_compound_convolve_sve2.c
+++ b/av1/common/arm/highbd_compound_convolve_sve2.c
@@ -24,6 +24,7 @@
#include "av1/common/convolve.h"
#include "av1/common/filter.h"
#include "av1/common/filter.h"
+#include "av1/common/arm/convolve_sve2.h"
#include "av1/common/arm/highbd_compound_convolve_neon.h"
#include "av1/common/arm/highbd_convolve_neon.h"
#include "av1/common/arm/highbd_convolve_sve2.h"
@@ -473,7 +474,7 @@
vdupq_n_s64((1 << (12 + FILTER_BITS)) + (1 << (12 + FILTER_BITS - 1)));
const int16x8_t y_filter = vld1q_s16(y_filter_ptr);
- uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kHbdDotProdMergeBlockTbl);
+ uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kSVEDotProdMergeBlockTbl);
// Scale indices by size of the true vector length to avoid reading from an
// 'undefined' portion of a vector on a system with SVE vectors > 128-bit.
uint16x8_t correction0 =
@@ -649,7 +650,7 @@
vdupq_n_s64((1 << (bd + FILTER_BITS)) + (1 << (bd + FILTER_BITS - 1)));
const int16x8_t y_filter = vld1q_s16(y_filter_ptr);
- uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kHbdDotProdMergeBlockTbl);
+ uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kSVEDotProdMergeBlockTbl);
// Scale indices by size of the true vector length to avoid reading from an
// 'undefined' portion of a vector on a system with SVE vectors > 128-bit.
uint16x8_t correction0 =
@@ -1200,7 +1201,7 @@
const int16x8_t y_filter = vld1q_s16(y_filter_ptr);
const int64x2_t offset_s64 = vdupq_n_s64(offset);
- uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kHbdDotProdMergeBlockTbl);
+ uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kSVEDotProdMergeBlockTbl);
// Scale indices by size of the true vector length to avoid reading from an
// 'undefined' portion of a vector on a system with SVE vectors > 128-bit.
uint16x8_t correction0 =
diff --git a/av1/common/arm/highbd_convolve_sve2.c b/av1/common/arm/highbd_convolve_sve2.c
index a455e80..656d8d5 100644
--- a/av1/common/arm/highbd_convolve_sve2.c
+++ b/av1/common/arm/highbd_convolve_sve2.c
@@ -24,19 +24,9 @@
#include "aom_ports/mem.h"
#include "av1/common/convolve.h"
#include "av1/common/filter.h"
+#include "av1/common/arm/convolve_sve2.h"
#include "av1/common/arm/highbd_convolve_sve2.h"
-// clang-format off
-DECLARE_ALIGNED(16, const uint16_t, kHbdDotProdMergeBlockTbl[24]) = {
- // Shift left and insert new last column in transposed 4x4 block.
- 1, 2, 3, 0, 5, 6, 7, 4,
- // Shift left and insert two new columns in transposed 4x4 block.
- 2, 3, 0, 1, 6, 7, 4, 5,
- // Shift left and insert three new columns in transposed 4x4 block.
- 3, 0, 1, 2, 7, 4, 5, 6,
-};
-// clang-format on
-
static inline uint16x4_t convolve12_4_x(
int16x8_t s0, int16x8_t s1, int16x8_t filter_0_7, int16x8_t filter_4_11,
const int64x2_t offset, uint16x8x4_t permute_tbl, uint16x4_t max) {
@@ -559,7 +549,7 @@
const int16x8_t y_filter = vld1q_s16(filter_y);
- uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kHbdDotProdMergeBlockTbl);
+ uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kSVEDotProdMergeBlockTbl);
// Scale indices by size of the true vector length to avoid reading from an
// 'undefined' portion of a vector on a system with SVE vectors > 128-bit.
uint16x8_t correction0 =
@@ -1202,7 +1192,7 @@
const int16x8_t y_filter_0_7 = vld1q_s16(y_filter_ptr);
const int16x8_t y_filter_4_11 = vld1q_s16(y_filter_ptr + 4);
- uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kHbdDotProdMergeBlockTbl);
+ uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kSVEDotProdMergeBlockTbl);
// Scale indices by size of the true vector length to avoid reading from an
// 'undefined' portion of a vector on a system with SVE vectors > 128-bit.
uint16x8_t correction0 =
@@ -1345,7 +1335,7 @@
const int32x4_t shift = vdupq_n_s32(-conv_params->round_1);
const int16x8_t y_filter = vld1q_s16(filter_y);
- uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kHbdDotProdMergeBlockTbl);
+ uint16x8x3_t merge_block_tbl = vld1q_u16_x3(kSVEDotProdMergeBlockTbl);
// Scale indices by size of the true vector length to avoid reading from an
// 'undefined' portion of a vector on a system with SVE vectors > 128-bit.
uint16x8_t correction0 =
diff --git a/av1/common/arm/highbd_convolve_sve2.h b/av1/common/arm/highbd_convolve_sve2.h
index 5862e68..0b59e26 100644
--- a/av1/common/arm/highbd_convolve_sve2.h
+++ b/av1/common/arm/highbd_convolve_sve2.h
@@ -16,8 +16,6 @@
#include "aom_dsp/arm/aom_neon_sve2_bridge.h"
-DECLARE_ALIGNED(16, extern const uint16_t, kHbdDotProdMergeBlockTbl[24]);
-
static inline void aom_tbl2x4_s16(int16x8_t t0[4], int16x8_t t1[4],
uint16x8_t tbl, int16x8_t res[4]) {
res[0] = aom_tbl2_s16(t0[0], t1[0], tbl);
@@ -26,10 +24,4 @@
res[3] = aom_tbl2_s16(t0[3], t1[3], tbl);
}
-static inline void aom_tbl2x2_s16(int16x8_t t0[2], int16x8_t t1[2],
- uint16x8_t tbl, int16x8_t res[2]) {
- res[0] = aom_tbl2_s16(t0[0], t1[0], tbl);
- res[1] = aom_tbl2_s16(t0[1], t1[1], tbl);
-}
-
#endif // AOM_AV1_COMMON_ARM_HIGHBD_CONVOLVE_SVE2_H_