AArch64: Clean up duplicate constant tables for convolutions

Refactor duplicate constant tables used by various convolution funtions
so they are defined just once in a single .c file, and referenced by
other files.

Change-Id: I00c4efe07d508d46997d1ef0861ce6194cfb4845
diff --git a/aom_dsp/arm/aom_convolve8_neon_dotprod.c b/aom_dsp/arm/aom_convolve8_neon_dotprod.c
index 6013a33..fd86a39 100644
--- a/aom_dsp/arm/aom_convolve8_neon_dotprod.c
+++ b/aom_dsp/arm/aom_convolve8_neon_dotprod.c
@@ -25,25 +25,11 @@
 #include "aom_dsp/arm/mem_neon.h"
 #include "aom_dsp/arm/transpose_neon.h"
 #include "aom_ports/mem.h"
+#include "av1/common/arm/convolve_neon_dotprod.h"
 
 // Filter values always sum to 128.
 #define FILTER_WEIGHT 128
 
-DECLARE_ALIGNED(16, static const uint8_t, kDotProdPermuteTbl[48]) = {
-  0, 1, 2,  3,  1, 2,  3,  4,  2,  3,  4,  5,  3,  4,  5,  6,
-  4, 5, 6,  7,  5, 6,  7,  8,  6,  7,  8,  9,  7,  8,  9,  10,
-  8, 9, 10, 11, 9, 10, 11, 12, 10, 11, 12, 13, 11, 12, 13, 14
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kDotProdMergeBlockTbl[48]) = {
-  // Shift left and insert new last column in transposed 4x4 block.
-  1, 2, 3, 16, 5, 6, 7, 20, 9, 10, 11, 24, 13, 14, 15, 28,
-  // Shift left and insert two new columns in transposed 4x4 block.
-  2, 3, 16, 17, 6, 7, 20, 21, 10, 11, 24, 25, 14, 15, 28, 29,
-  // Shift left and insert three new columns in transposed 4x4 block.
-  3, 16, 17, 18, 7, 20, 21, 22, 11, 24, 25, 26, 15, 28, 29, 30
-};
-
 static inline int16x4_t convolve8_4_h(const uint8x16_t samples,
                                       const int8x8_t filters,
                                       const uint8x16x2_t permute_tbl) {
diff --git a/aom_dsp/arm/aom_convolve8_neon_i8mm.c b/aom_dsp/arm/aom_convolve8_neon_i8mm.c
index b0bb2fc..33694f8 100644
--- a/aom_dsp/arm/aom_convolve8_neon_i8mm.c
+++ b/aom_dsp/arm/aom_convolve8_neon_i8mm.c
@@ -24,35 +24,8 @@
 #include "aom_dsp/arm/mem_neon.h"
 #include "aom_dsp/arm/transpose_neon.h"
 #include "aom_ports/mem.h"
-
-DECLARE_ALIGNED(16, static const uint8_t, kMatMul6PermuteTbl[32]) = {
-  // clang-format off
-  0,  1,  2,  3,  4,  5,  6,  7,  2,  3,  4,  5,  6,  7,  8,  9,
-  4,  5,  6,  7,  8,  9, 10, 11,  6,  7,  8,  9, 10, 11, 12, 13
-  // clang-format on
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kMatMul8PermuteTbl[32]) = {
-  // clang-format off
-  1,  2,  3,  4,  5,  6,  7,  8,  3,  4,  5,  6,  7,  8,  9, 10,
-  5,  6,  7,  8,  9, 10, 11, 12,  7,  8,  9, 10, 11, 12, 13, 14
-  // clang-format on
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kMatMul8FilterPermuteTbl[16]) = {
-  // clang-format off
-  1,  2,  3,  4,  5,  6,  7, 16, 16,  1,  2,  3,  4,  5,  6,  7
-  // clang-format on
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kDotProdMergeBlockTbl[48]) = {
-  // Shift left and insert new last column in transposed 4x4 block.
-  1, 2, 3, 16, 5, 6, 7, 20, 9, 10, 11, 24, 13, 14, 15, 28,
-  // Shift left and insert two new columns in transposed 4x4 block.
-  2, 3, 16, 17, 6, 7, 20, 21, 10, 11, 24, 25, 14, 15, 28, 29,
-  // Shift left and insert three new columns in transposed 4x4 block.
-  3, 16, 17, 18, 7, 20, 21, 22, 11, 24, 25, 26, 15, 28, 29, 30
-};
+#include "av1/common/arm/convolve_neon_dotprod.h"
+#include "av1/common/arm/convolve_neon_i8mm.h"
 
 static inline int16x4_t convolve8_4_h(const uint8x16_t samples,
                                       const int8x16_t filters,
@@ -101,7 +74,7 @@
   const int8x8_t filter_s8 = vshrn_n_s16(vld1q_s16(filter_x), 1);
   // Stagger the filter for use with the matrix multiply instructions.
   // { f1, f2, f3, f4, f5, f6, f7, 0, 0, f1, f2, f3, f4, f5, f6, f7 }
-  const uint8x16_t filter_idx = vld1q_u8(kMatMul8FilterPermuteTbl);
+  const uint8x16_t filter_idx = vld1q_u8(kFilterPermuteTbl);
   const int8x16_t filter =
       vqtbl1q_s8(vcombine_s8(filter_s8, vdup_n_s8(0)), filter_idx);
 
diff --git a/av1/common/arm/av1_convolve_scale_neon_dotprod.c b/av1/common/arm/av1_convolve_scale_neon_dotprod.c
index 1551d3a..340987c 100644
--- a/av1/common/arm/av1_convolve_scale_neon_dotprod.c
+++ b/av1/common/arm/av1_convolve_scale_neon_dotprod.c
@@ -28,7 +28,7 @@
 #include "av1/common/filter.h"
 
 // clang-format off
-DECLARE_ALIGNED(16, static const uint8_t, kScale2DotProdPermuteTbl[32]) = {
+DECLARE_ALIGNED(16, const uint8_t, kScale2DotProdPermuteTbl[32]) = {
   0, 1, 2, 3, 2, 3, 4, 5, 4, 5,  6,  7,  6,  7,  8,  9,
   4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13
 };
diff --git a/av1/common/arm/av1_convolve_scale_neon_dotprod.h b/av1/common/arm/av1_convolve_scale_neon_dotprod.h
new file mode 100644
index 0000000..6188124
--- /dev/null
+++ b/av1/common/arm/av1_convolve_scale_neon_dotprod.h
@@ -0,0 +1,18 @@
+/*
+ * 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_AV1_CONVOLVE_SCALE_NEON_DOTPROD_H_
+#define AOM_AV1_COMMON_ARM_AV1_CONVOLVE_SCALE_NEON_DOTPROD_H_
+
+#include "aom_ports/mem.h"
+
+DECLARE_ALIGNED(16, extern const uint8_t, kScale2DotProdPermuteTbl[32]);
+
+#endif  // AOM_AV1_COMMON_ARM_AV1_CONVOLVE_SCALE_NEON_DOTPROD_H_
diff --git a/av1/common/arm/av1_convolve_scale_neon_i8mm.c b/av1/common/arm/av1_convolve_scale_neon_i8mm.c
index eb5092b..8ae218bf 100644
--- a/av1/common/arm/av1_convolve_scale_neon_i8mm.c
+++ b/av1/common/arm/av1_convolve_scale_neon_i8mm.c
@@ -23,17 +23,11 @@
 #include "aom_dsp/arm/transpose_neon.h"
 #include "aom_ports/mem.h"
 #include "av1/common/arm/convolve_scale_neon.h"
+#include "av1/common/arm/av1_convolve_scale_neon_dotprod.h"
 #include "av1/common/convolve.h"
 #include "av1/common/enums.h"
 #include "av1/common/filter.h"
 
-// clang-format off
-DECLARE_ALIGNED(16, static const uint8_t, kScale2DotProdPermuteTbl[32]) = {
-  0, 1, 2, 3, 2, 3, 4, 5, 4, 5,  6,  7,  6,  7,  8,  9,
-  4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13
-};
-// clang-format on
-
 static inline int16x4_t convolve8_4_h(const uint8x8_t s0, const uint8x8_t s1,
                                       const uint8x8_t s2, const uint8x8_t s3,
                                       const int8x8_t filter,
diff --git a/av1/common/arm/compound_convolve_neon_dotprod.c b/av1/common/arm/compound_convolve_neon_dotprod.c
index abe4758..f4c55de 100644
--- a/av1/common/arm/compound_convolve_neon_dotprod.c
+++ b/av1/common/arm/compound_convolve_neon_dotprod.c
@@ -15,26 +15,10 @@
 #include "aom_dsp/arm/mem_neon.h"
 #include "aom_dsp/arm/transpose_neon.h"
 #include "av1/common/arm/compound_convolve_neon.h"
+#include "av1/common/arm/convolve_neon_dotprod.h"
 #include "config/aom_config.h"
 #include "config/av1_rtcd.h"
 
-DECLARE_ALIGNED(16, static const uint8_t, dot_prod_permute_tbl[48]) = {
-  0, 1, 2,  3,  1, 2,  3,  4,  2,  3,  4,  5,  3,  4,  5,  6,
-  4, 5, 6,  7,  5, 6,  7,  8,  6,  7,  8,  9,  7,  8,  9,  10,
-  8, 9, 10, 11, 9, 10, 11, 12, 10, 11, 12, 13, 11, 12, 13, 14
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kDotProdMergeBlockTbl[48]) = {
-  // clang-format off
-  // Shift left and insert new last column in transposed 4x4 block.
-  1, 2,  3,  16, 5, 6,  7,  20, 9,  10, 11, 24, 13, 14, 15, 28,
-  // Shift left and insert two new columns in transposed 4x4 block.
-  2, 3,  16, 17, 6, 7,  20, 21, 10, 11, 24, 25, 14, 15, 28, 29,
-  // Shift left and insert three new columns in transposed 4x4 block.
-  3, 16, 17, 18, 7, 20, 21, 22, 11, 24, 25, 26, 15, 28, 29, 30
-  // clang-format on
-};
-
 static inline int16x4_t convolve4_4_2d_h(uint8x16_t samples,
                                          const int8x8_t x_filter,
                                          const int32x4_t correction,
@@ -109,7 +93,7 @@
   int height = im_h;
 
   if (w == 4) {
-    const uint8x16_t permute_tbl = vld1q_u8(dot_prod_permute_tbl);
+    const uint8x16_t permute_tbl = vld1q_u8(kDotProdPermuteTbl);
     // 4-tap filters are used for blocks having width <= 4.
     // Filter values are even, so halve to reduce intermediate precision reqs.
     const int8x8_t x_filter =
@@ -149,7 +133,7 @@
       dst_ptr += dst_stride;
     } while (--height != 0);
   } else {
-    const uint8x16x3_t permute_tbl = vld1q_u8_x3(dot_prod_permute_tbl);
+    const uint8x16x3_t permute_tbl = vld1q_u8_x3(kDotProdPermuteTbl);
     // Filter values are even, so halve to reduce intermediate precision reqs.
     const int8x8_t x_filter = vshrn_n_s16(x_filter_s16, 1);
 
@@ -361,7 +345,7 @@
   int height = h;
 
   if (w == 4) {
-    const uint8x16_t permute_tbl = vld1q_u8(dot_prod_permute_tbl);
+    const uint8x16_t permute_tbl = vld1q_u8(kDotProdPermuteTbl);
     // 4-tap filters are used for blocks having width <= 4.
     // Filter values are even, so halve to reduce intermediate precision reqs.
     const int8x8_t x_filter =
@@ -398,7 +382,7 @@
       height -= 4;
     } while (height != 0);
   } else {
-    const uint8x16x3_t permute_tbl = vld1q_u8_x3(dot_prod_permute_tbl);
+    const uint8x16x3_t permute_tbl = vld1q_u8_x3(kDotProdPermuteTbl);
     // Filter values are even, so halve to reduce intermediate precision reqs.
     const int8x8_t x_filter = vshrn_n_s16(x_filter_s16, 1);
 
@@ -481,7 +465,7 @@
   int height = h;
 
   if (w == 4) {
-    const uint8x16_t permute_tbl = vld1q_u8(dot_prod_permute_tbl);
+    const uint8x16_t permute_tbl = vld1q_u8(kDotProdPermuteTbl);
     // 4-tap filters are used for blocks having width <= 4.
     // Filter values are even, so halve to reduce intermediate precision reqs.
     const int8x8_t x_filter =
@@ -518,7 +502,7 @@
       height -= 4;
     } while (height != 0);
   } else {
-    const uint8x16x3_t permute_tbl = vld1q_u8_x3(dot_prod_permute_tbl);
+    const uint8x16x3_t permute_tbl = vld1q_u8_x3(kDotProdPermuteTbl);
     // Filter values are even, so halve to reduce intermediate precision reqs.
     const int8x8_t x_filter = vshrn_n_s16(x_filter_s16, 1);
 
@@ -598,7 +582,7 @@
   int height = h;
 
   if (w == 4) {
-    const uint8x16_t permute_tbl = vld1q_u8(dot_prod_permute_tbl);
+    const uint8x16_t permute_tbl = vld1q_u8(kDotProdPermuteTbl);
     // 4-tap filters are used for blocks having width <= 4.
     // Filter values are even, so halve to reduce intermediate precision reqs.
     const int8x8_t x_filter =
@@ -626,7 +610,7 @@
       height -= 4;
     } while (height != 0);
   } else {
-    const uint8x16x3_t permute_tbl = vld1q_u8_x3(dot_prod_permute_tbl);
+    const uint8x16x3_t permute_tbl = vld1q_u8_x3(kDotProdPermuteTbl);
     // Filter values are even, so halve to reduce intermediate precision reqs.
     const int8x8_t x_filter = vshrn_n_s16(x_filter_s16, 1);
 
diff --git a/av1/common/arm/compound_convolve_neon_i8mm.c b/av1/common/arm/compound_convolve_neon_i8mm.c
index 41e6fc0..aa4438a 100644
--- a/av1/common/arm/compound_convolve_neon_i8mm.c
+++ b/av1/common/arm/compound_convolve_neon_i8mm.c
@@ -17,43 +17,8 @@
 #include "av1/common/arm/compound_convolve_neon.h"
 #include "config/aom_config.h"
 #include "config/av1_rtcd.h"
-
-DECLARE_ALIGNED(16, static const uint8_t, kDotProdPermuteTbl[48]) = {
-  0, 1, 2,  3,  1, 2,  3,  4,  2,  3,  4,  5,  3,  4,  5,  6,
-  4, 5, 6,  7,  5, 6,  7,  8,  6,  7,  8,  9,  7,  8,  9,  10,
-  8, 9, 10, 11, 9, 10, 11, 12, 10, 11, 12, 13, 11, 12, 13, 14
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kMatMul6PermuteTbl[32]) = {
-  // clang-format off
-  0,  1,  2,  3,  4,  5,  6,  7,  2,  3,  4,  5,  6,  7,  8,  9,
-  4,  5,  6,  7,  8,  9, 10, 11,  6,  7,  8,  9, 10, 11, 12, 13
-  // clang-format on
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kMatMul8PermuteTbl[32]) = {
-  // clang-format off
-  1,  2,  3,  4,  5,  6,  7,  8,  3,  4,  5,  6,  7,  8,  9, 10,
-  5,  6,  7,  8,  9, 10, 11, 12,  7,  8,  9, 10, 11, 12, 13, 14
-  // clang-format on
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kFilterPermuteTbl[16]) = {
-  // clang-format off
-  1,  2,  3,  4,  5,  6,  7, 16, 16,  1,  2,  3,  4,  5,  6,  7
-  // clang-format on
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kDotProdMergeBlockTbl[48]) = {
-  // clang-format off
-  // Shift left and insert new last column in transposed 4x4 block.
-  1, 2,  3,  16, 5, 6,  7,  20, 9,  10, 11, 24, 13, 14, 15, 28,
-  // Shift left and insert two new columns in transposed 4x4 block.
-  2, 3,  16, 17, 6, 7,  20, 21, 10, 11, 24, 25, 14, 15, 28, 29,
-  // Shift left and insert three new columns in transposed 4x4 block.
-  3, 16, 17, 18, 7, 20, 21, 22, 11, 24, 25, 26, 15, 28, 29, 30
-  // clang-format on
-};
+#include "convolve_neon_dotprod.h"
+#include "convolve_neon_i8mm.h"
 
 static inline int16x4_t convolve6_4_2d_h(uint8x16_t samples,
                                          const int8x16_t x_filter,
diff --git a/av1/common/arm/convolve_neon_dotprod.c b/av1/common/arm/convolve_neon_dotprod.c
index 446f661..35cdf9e 100644
--- a/av1/common/arm/convolve_neon_dotprod.c
+++ b/av1/common/arm/convolve_neon_dotprod.c
@@ -22,13 +22,13 @@
 #include "av1/common/convolve.h"
 #include "av1/common/filter.h"
 
-DECLARE_ALIGNED(16, static const uint8_t, kDotProdPermuteTbl[48]) = {
+DECLARE_ALIGNED(16, const uint8_t, kDotProdPermuteTbl[48]) = {
   0, 1, 2,  3,  1, 2,  3,  4,  2,  3,  4,  5,  3,  4,  5,  6,
   4, 5, 6,  7,  5, 6,  7,  8,  6,  7,  8,  9,  7,  8,  9,  10,
   8, 9, 10, 11, 9, 10, 11, 12, 10, 11, 12, 13, 11, 12, 13, 14
 };
 
-DECLARE_ALIGNED(16, static const uint8_t, kDotProdMergeBlockTbl[48]) = {
+DECLARE_ALIGNED(16, const uint8_t, kDotProdMergeBlockTbl[48]) = {
   // Shift left and insert new last column in transposed 4x4 block.
   1, 2, 3, 16, 5, 6, 7, 20, 9, 10, 11, 24, 13, 14, 15, 28,
   // Shift left and insert two new columns in transposed 4x4 block.
diff --git a/av1/common/arm/convolve_neon_dotprod.h b/av1/common/arm/convolve_neon_dotprod.h
new file mode 100644
index 0000000..2bdf365
--- /dev/null
+++ b/av1/common/arm/convolve_neon_dotprod.h
@@ -0,0 +1,19 @@
+/*
+ * 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_NEON_DOTPROD_H_
+#define AOM_AV1_COMMON_ARM_CONVOLVE_NEON_DOTPROD_H_
+
+#include "aom_ports/mem.h"
+
+DECLARE_ALIGNED(16, extern const uint8_t, kDotProdPermuteTbl[48]);
+DECLARE_ALIGNED(16, extern const uint8_t, kDotProdMergeBlockTbl[48]);
+
+#endif  // AOM_AV1_COMMON_ARM_CONVOLVE_NEON_DOTPROD_H_
diff --git a/av1/common/arm/convolve_neon_i8mm.c b/av1/common/arm/convolve_neon_i8mm.c
index 20b9af4..1452841 100644
--- a/av1/common/arm/convolve_neon_i8mm.c
+++ b/av1/common/arm/convolve_neon_i8mm.c
@@ -19,27 +19,26 @@
 #include "aom_dsp/arm/transpose_neon.h"
 #include "aom_ports/mem.h"
 #include "av1/common/arm/convolve_neon.h"
+#include "av1/common/arm/convolve_neon_dotprod.h"
 #include "av1/common/arm/convolve_neon_i8mm.h"
 #include "av1/common/convolve.h"
 #include "av1/common/filter.h"
 
-DECLARE_ALIGNED(16, static const uint8_t, kDotProdMergeBlockTbl[48]) = {
-  // Shift left and insert new last column in transposed 4x4 block.
-  1, 2, 3, 16, 5, 6, 7, 20, 9, 10, 11, 24, 13, 14, 15, 28,
-  // Shift left and insert two new columns in transposed 4x4 block.
-  2, 3, 16, 17, 6, 7, 20, 21, 10, 11, 24, 25, 14, 15, 28, 29,
-  // Shift left and insert three new columns in transposed 4x4 block.
-  3, 16, 17, 18, 7, 20, 21, 22, 11, 24, 25, 26, 15, 28, 29, 30
+DECLARE_ALIGNED(16, const uint8_t, kMatMul6PermuteTbl[32]) = {
+  // clang-format off
+  0,  1,  2,  3,  4,  5,  6,  7,  2,  3,  4,  5,  6,  7,  8,  9,
+  4,  5,  6,  7,  8,  9, 10, 11,  6,  7,  8,  9, 10, 11, 12, 13
+  // clang-format on
 };
 
-DECLARE_ALIGNED(16, static const uint8_t, kMatMul8PermuteTbl[32]) = {
+DECLARE_ALIGNED(16, const uint8_t, kMatMul8PermuteTbl[32]) = {
   // clang-format off
   1,  2,  3,  4,  5,  6,  7,  8,  3,  4,  5,  6,  7,  8,  9, 10,
   5,  6,  7,  8,  9, 10, 11, 12,  7,  8,  9, 10, 11, 12, 13, 14
   // clang-format on
 };
 
-DECLARE_ALIGNED(16, static const uint8_t, kFilterPermuteTbl[16]) = {
+DECLARE_ALIGNED(16, const uint8_t, kFilterPermuteTbl[16]) = {
   // clang-format off
   1,  2,  3,  4,  5,  6,  7, 16, 16,  1,  2,  3,  4,  5,  6,  7
   // clang-format on
diff --git a/av1/common/arm/convolve_neon_i8mm.h b/av1/common/arm/convolve_neon_i8mm.h
index 78dadec..38e651f 100644
--- a/av1/common/arm/convolve_neon_i8mm.h
+++ b/av1/common/arm/convolve_neon_i8mm.h
@@ -23,18 +23,9 @@
 #include "aom_dsp/arm/mem_neon.h"
 #include "aom_ports/mem.h"
 
-DECLARE_ALIGNED(16, static const uint8_t, kDotProdPermuteTbl[48]) = {
-  0, 1, 2,  3,  1, 2,  3,  4,  2,  3,  4,  5,  3,  4,  5,  6,
-  4, 5, 6,  7,  5, 6,  7,  8,  6,  7,  8,  9,  7,  8,  9,  10,
-  8, 9, 10, 11, 9, 10, 11, 12, 10, 11, 12, 13, 11, 12, 13, 14
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kMatMul6PermuteTbl[32]) = {
-  // clang-format off
-  0,  1,  2,  3,  4,  5,  6,  7,  2,  3,  4,  5,  6,  7,  8,  9,
-  4,  5,  6,  7,  8,  9, 10, 11,  6,  7,  8,  9, 10, 11, 12, 13
-  // clang-format on
-};
+DECLARE_ALIGNED(16, extern const uint8_t, kMatMul6PermuteTbl[32]);
+DECLARE_ALIGNED(16, extern const uint8_t, kMatMul8PermuteTbl[32]);
+DECLARE_ALIGNED(16, extern const uint8_t, kFilterPermuteTbl[16]);
 
 static inline int16x4_t convolve12_4_2d_h(uint8x16_t samples[2],
                                           const int8x16_t filter[2],
diff --git a/av1/common/arm/warp_plane_neon_i8mm.c b/av1/common/arm/warp_plane_neon_i8mm.c
index 3f16ddd..b75f5e7 100644
--- a/av1/common/arm/warp_plane_neon_i8mm.c
+++ b/av1/common/arm/warp_plane_neon_i8mm.c
@@ -10,28 +10,10 @@
  */
 
 #include "warp_plane_neon.h"
+#include "convolve_neon_dotprod.h"
+#include "convolve_neon_i8mm.h"
 
-DECLARE_ALIGNED(16, static const uint8_t, usdot_permute_idx[48]) = {
-  0, 1, 2,  3,  1, 2,  3,  4,  2,  3,  4,  5,  3,  4,  5,  6,
-  4, 5, 6,  7,  5, 6,  7,  8,  6,  7,  8,  9,  7,  8,  9,  10,
-  8, 9, 10, 11, 9, 10, 11, 12, 10, 11, 12, 13, 11, 12, 13, 14
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kMatMul6PermuteTbl[32]) = {
-  // clang-format off
-  0,  1,  2,  3,  4,  5,  6,  7,  2,  3,  4,  5,  6,  7,  8,  9,
-  4,  5,  6,  7,  8,  9, 10, 11,  6,  7,  8,  9, 10, 11, 12, 13
-  // clang-format on
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kMatMul8PermuteTbl[32]) = {
-  // clang-format off
-  1,  2,  3,  4,  5,  6,  7,  8,  3,  4,  5,  6,  7,  8,  9, 10,
-  5,  6,  7,  8,  9, 10, 11, 12,  7,  8,  9, 10, 11, 12, 13, 14
-  // clang-format on
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kTblIdx0_3[16]) = {
+DECLARE_ALIGNED(16, const uint8_t, kTblIdx0_3[16]) = {
   0, -1, -1, -1, 1, -1, -1, -1, 2, -1, -1, -1, 3, -1, -1, -1,
 };
 
@@ -150,8 +132,8 @@
   int16x8_t f_s16 = vld1q_s16(av1_warped_filter[sx >> WARPEDDIFF_PREC_BITS]);
   int8x16_t f_s8 = vcombine_s8(vmovn_s16(f_s16), vmovn_s16(f_s16));
 
-  uint8x16_t perm0 = vld1q_u8(&usdot_permute_idx[0]);
-  uint8x16_t perm1 = vld1q_u8(&usdot_permute_idx[16]);
+  uint8x16_t perm0 = vld1q_u8(&kDotProdPermuteTbl[0]);
+  uint8x16_t perm1 = vld1q_u8(&kDotProdPermuteTbl[16]);
 
   // Permute samples ready for dot product.
   // { 0,  1,  2,  3,  1,  2,  3,  4,  2,  3,  4,  5,  3,  4,  5,  6 }
@@ -221,9 +203,9 @@
   int16x8_t f_s16 = vld1q_s16(av1_warped_filter[sx >> WARPEDDIFF_PREC_BITS]);
   int8x16_t f_s8 = vcombine_s8(vmovn_s16(f_s16), vmovn_s16(f_s16));
 
-  uint8x16_t perm0 = vld1q_u8(&usdot_permute_idx[0]);
-  uint8x16_t perm1 = vld1q_u8(&usdot_permute_idx[16]);
-  uint8x16_t perm2 = vld1q_u8(&usdot_permute_idx[32]);
+  uint8x16_t perm0 = vld1q_u8(&kDotProdPermuteTbl[0]);
+  uint8x16_t perm1 = vld1q_u8(&kDotProdPermuteTbl[16]);
+  uint8x16_t perm2 = vld1q_u8(&kDotProdPermuteTbl[32]);
 
   // Permute samples ready for dot product.
   // { 0,  1,  2,  3,  1,  2,  3,  4,  2,  3,  4,  5,  3,  4,  5,  6 }
diff --git a/av1/common/arm/warp_plane_neon_i8mm.h b/av1/common/arm/warp_plane_neon_i8mm.h
new file mode 100644
index 0000000..99355dc
--- /dev/null
+++ b/av1/common/arm/warp_plane_neon_i8mm.h
@@ -0,0 +1,18 @@
+/*
+ * 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_WARP_PLANE_NEON_I8MM_H_
+#define AOM_AV1_COMMON_ARM_WARP_PLANE_NEON_I8MM_H_
+
+#include "aom_ports/mem.h"
+
+DECLARE_ALIGNED(16, extern const uint8_t, kTblIdx0_3[16]);
+
+#endif  // AOM_AV1_COMMON_ARM_WARP_PLANE_NEON_I8MM_H_
diff --git a/av1/common/arm/warp_plane_sve.c b/av1/common/arm/warp_plane_sve.c
index 01a3875..3d21072 100644
--- a/av1/common/arm/warp_plane_sve.c
+++ b/av1/common/arm/warp_plane_sve.c
@@ -12,31 +12,10 @@
 #include <arm_neon.h>
 
 #include "aom_dsp/arm/aom_neon_sve_bridge.h"
+#include "convolve_neon_dotprod.h"
+#include "convolve_neon_i8mm.h"
 #include "warp_plane_neon.h"
-
-DECLARE_ALIGNED(16, static const uint8_t, usdot_permute_idx[48]) = {
-  0, 1, 2,  3,  1, 2,  3,  4,  2,  3,  4,  5,  3,  4,  5,  6,
-  4, 5, 6,  7,  5, 6,  7,  8,  6,  7,  8,  9,  7,  8,  9,  10,
-  8, 9, 10, 11, 9, 10, 11, 12, 10, 11, 12, 13, 11, 12, 13, 14
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kMatMul6PermuteTbl[32]) = {
-  // clang-format off
-  0,  1,  2,  3,  4,  5,  6,  7,  2,  3,  4,  5,  6,  7,  8,  9,
-  4,  5,  6,  7,  8,  9, 10, 11,  6,  7,  8,  9, 10, 11, 12, 13
-  // clang-format on
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kMatMul8PermuteTbl[32]) = {
-  // clang-format off
-  1,  2,  3,  4,  5,  6,  7,  8,  3,  4,  5,  6,  7,  8,  9, 10,
-  5,  6,  7,  8,  9, 10, 11, 12,  7,  8,  9, 10, 11, 12, 13, 14
-  // clang-format on
-};
-
-DECLARE_ALIGNED(16, static const uint8_t, kTblIdx0_3[16]) = {
-  0, -1, -1, -1, 1, -1, -1, -1, 2, -1, -1, -1, 3, -1, -1, -1,
-};
+#include "warp_plane_neon_i8mm.h"
 
 static AOM_FORCE_INLINE int16x8_t horizontal_filter_4x1_f4(const uint8x16_t in,
                                                            int sx, int alpha) {
@@ -153,8 +132,8 @@
   int16x8_t f_s16 = vld1q_s16(av1_warped_filter[sx >> WARPEDDIFF_PREC_BITS]);
   int8x16_t f_s8 = vcombine_s8(vmovn_s16(f_s16), vmovn_s16(f_s16));
 
-  uint8x16_t perm0 = vld1q_u8(&usdot_permute_idx[0]);
-  uint8x16_t perm1 = vld1q_u8(&usdot_permute_idx[16]);
+  uint8x16_t perm0 = vld1q_u8(&kDotProdPermuteTbl[0]);
+  uint8x16_t perm1 = vld1q_u8(&kDotProdPermuteTbl[16]);
 
   // Permute samples ready for dot product.
   // { 0,  1,  2,  3,  1,  2,  3,  4,  2,  3,  4,  5,  3,  4,  5,  6 }
@@ -224,9 +203,9 @@
   int16x8_t f_s16 = vld1q_s16(av1_warped_filter[sx >> WARPEDDIFF_PREC_BITS]);
   int8x16_t f_s8 = vcombine_s8(vmovn_s16(f_s16), vmovn_s16(f_s16));
 
-  uint8x16_t perm0 = vld1q_u8(&usdot_permute_idx[0]);
-  uint8x16_t perm1 = vld1q_u8(&usdot_permute_idx[16]);
-  uint8x16_t perm2 = vld1q_u8(&usdot_permute_idx[32]);
+  uint8x16_t perm0 = vld1q_u8(&kDotProdPermuteTbl[0]);
+  uint8x16_t perm1 = vld1q_u8(&kDotProdPermuteTbl[16]);
+  uint8x16_t perm2 = vld1q_u8(&kDotProdPermuteTbl[32]);
 
   // Permute samples ready for dot product.
   // { 0,  1,  2,  3,  1,  2,  3,  4,  2,  3,  4,  5,  3,  4,  5,  6 }