Commit 6d691cecc7 for aom

commit 6d691cecc715c3b9985d22a72932b07d0d82a8c6
Author: Wan-Teh Chang <wtc@google.com>
Date:   Fri Jun 26 07:05:39 2026 -0700

    Declare av1_lowbd_inv_txfm2d_add_neon in a header

    Declare the av1_lowbd_inv_txfm2d_add_neon() function in the new
    av1/common/av1_inv_txfm2d.h header. Also move the declarations of
    av1_lowbd_inv_txfm2d_add_ssse3() and av1_lowbd_inv_txfm2d_add_avx2()
    from av1/common/x86/av1_inv_txfm_ssse3.h and
    av1/common/x86/av1_inv_txfm_avx2.h to av1/common/av1_inv_txfm2d.h.

    Remove the manual declarations of av1_lowbd_inv_txfm2d_add_ssse3(),
    av1_lowbd_inv_txfm2d_add_avx2(), and av1_lowbd_inv_txfm2d_add_neon() in
    test/av1_inv_txfm2d_test.cc. Include av1/common/av1_inv_txfm2d.h
    instead.

    Change-Id: I5bc80847e25e9a2367f60fd5354bbc9ecb4fe9a8

diff --git a/av1/av1.cmake b/av1/av1.cmake
index 19bb1a7ca0..936573192f 100644
--- a/av1/av1.cmake
+++ b/av1/av1.cmake
@@ -26,6 +26,7 @@ list(APPEND AOM_AV1_COMMON_SOURCES
             "${AOM_ROOT}/av1/common/av1_inv_txfm1d.h"
             "${AOM_ROOT}/av1/common/av1_inv_txfm1d_cfg.h"
             "${AOM_ROOT}/av1/common/av1_inv_txfm2d.c"
+            "${AOM_ROOT}/av1/common/av1_inv_txfm2d.h"
             "${AOM_ROOT}/av1/common/av1_loopfilter.c"
             "${AOM_ROOT}/av1/common/av1_loopfilter.h"
             "${AOM_ROOT}/av1/common/av1_txfm.c"
diff --git a/av1/common/arm/av1_inv_txfm_neon.c b/av1/common/arm/av1_inv_txfm_neon.c
index 4b8c31f377..d7a83680d3 100644
--- a/av1/common/arm/av1_inv_txfm_neon.c
+++ b/av1/common/arm/av1_inv_txfm_neon.c
@@ -9,6 +9,8 @@
  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
  */

+#include "av1/common/arm/av1_inv_txfm_neon.h"
+
 #include <arm_neon.h>

 #include "config/aom_config.h"
@@ -18,10 +20,10 @@
 #include "aom_dsp/arm/transpose_neon.h"
 #include "av1/common/av1_inv_txfm1d.h"
 #include "av1/common/av1_inv_txfm1d_cfg.h"
+#include "av1/common/av1_inv_txfm2d.h"
 #include "av1/common/av1_txfm.h"
 #include "av1/common/enums.h"
 #include "av1/common/idct.h"
-#include "av1/common/arm/av1_inv_txfm_neon.h"

 // 1D itx types
 typedef enum ATTRIBUTE_PACKED {
@@ -4177,11 +4179,6 @@ static inline void lowbd_inv_txfm2d_add_universe_neon(
   }
 }

-// This function is used by av1_inv_txfm2d_test.cc.
-void av1_lowbd_inv_txfm2d_add_neon(const int32_t *input, uint8_t *output,
-                                   int stride, TX_TYPE tx_type, TX_SIZE tx_size,
-                                   int eob);
-
 void av1_lowbd_inv_txfm2d_add_neon(const int32_t *input, uint8_t *output,
                                    int stride, TX_TYPE tx_type, TX_SIZE tx_size,
                                    int eob) {
diff --git a/av1/common/arm/av1_inv_txfm_neon.h b/av1/common/arm/av1_inv_txfm_neon.h
index 4452aee3bf..87d48dd576 100644
--- a/av1/common/arm/av1_inv_txfm_neon.h
+++ b/av1/common/arm/av1_inv_txfm_neon.h
@@ -11,6 +11,8 @@
 #ifndef AOM_AV1_COMMON_ARM_AV1_INV_TXFM_NEON_H_
 #define AOM_AV1_COMMON_ARM_AV1_INV_TXFM_NEON_H_

+#include <arm_neon.h>
+
 #include "config/aom_config.h"
 #include "config/av1_rtcd.h"

@@ -20,6 +22,10 @@
 #include "av1/common/av1_inv_txfm1d_cfg.h"
 #include "av1/common/av1_txfm.h"

+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef void (*transform_1d_neon)(const int32_t *input, int32_t *output,
                                   const int8_t cos_bit,
                                   const int8_t *stage_ptr);
@@ -151,4 +157,8 @@ static inline void get_eobx_eoby_scan_h_identity(int *eobx, int *eoby,
   *eoby = eob_fill[temp_eoby];
 }

+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
 #endif  // AOM_AV1_COMMON_ARM_AV1_INV_TXFM_NEON_H_
diff --git a/av1/common/av1_inv_txfm2d.c b/av1/common/av1_inv_txfm2d.c
index fe0afe40fc..715fcb000f 100644
--- a/av1/common/av1_inv_txfm2d.c
+++ b/av1/common/av1_inv_txfm2d.c
@@ -9,6 +9,8 @@
  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
  */

+#include "av1/common/av1_inv_txfm2d.h"
+
 #include "config/aom_dsp_rtcd.h"
 #include "config/av1_rtcd.h"

diff --git a/av1/common/av1_inv_txfm2d.h b/av1/common/av1_inv_txfm2d.h
new file mode 100644
index 0000000000..7826e678d8
--- /dev/null
+++ b/av1/common/av1_inv_txfm2d.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2026, 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_AV1_INV_TXFM2D_H_
+#define AOM_AV1_COMMON_AV1_INV_TXFM2D_H_
+
+#include "config/aom_config.h"
+
+#include "aom_dsp/txfm_common.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if HAVE_SSSE3
+void av1_lowbd_inv_txfm2d_add_ssse3(const int32_t *input, uint8_t *output,
+                                    int stride, TX_TYPE tx_type,
+                                    TX_SIZE tx_size, int eob);
+#endif
+
+#if HAVE_AVX2
+void av1_lowbd_inv_txfm2d_add_avx2(const int32_t *input, uint8_t *output,
+                                   int stride, TX_TYPE tx_type, TX_SIZE tx_size,
+                                   int eob);
+#endif
+
+#if HAVE_NEON
+// This function is used by av1_inv_txfm2d_test.cc.
+void av1_lowbd_inv_txfm2d_add_neon(const int32_t *input, uint8_t *output,
+                                   int stride, TX_TYPE tx_type, TX_SIZE tx_size,
+                                   int eob);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // AOM_AV1_COMMON_AV1_INV_TXFM2D_H_
diff --git a/av1/common/x86/av1_inv_txfm_avx2.c b/av1/common/x86/av1_inv_txfm_avx2.c
index 78ea98a26b..0766210791 100644
--- a/av1/common/x86/av1_inv_txfm_avx2.c
+++ b/av1/common/x86/av1_inv_txfm_avx2.c
@@ -9,6 +9,8 @@
  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
  */

+#include "av1/common/x86/av1_inv_txfm_avx2.h"
+
 #include <assert.h>

 #include "config/aom_config.h"
@@ -16,8 +18,8 @@
 #include "config/av1_rtcd.h"

 #include "av1/common/av1_inv_txfm1d_cfg.h"
+#include "av1/common/av1_inv_txfm2d.h"
 #include "av1/common/x86/av1_txfm_sse2.h"
-#include "av1/common/x86/av1_inv_txfm_avx2.h"
 #include "av1/common/x86/av1_inv_txfm_ssse3.h"

 // TODO(venkatsanampudi@ittiam.com): move this to header file
diff --git a/av1/common/x86/av1_inv_txfm_avx2.h b/av1/common/x86/av1_inv_txfm_avx2.h
index 0be45e6c5f..b4e4384d38 100644
--- a/av1/common/x86/av1_inv_txfm_avx2.h
+++ b/av1/common/x86/av1_inv_txfm_avx2.h
@@ -61,9 +61,6 @@ static inline void lowbd_write_buffer_16xn_avx2(__m256i *in, uint8_t *output,
   }
 }

-void av1_lowbd_inv_txfm2d_add_avx2(const int32_t *input, uint8_t *output,
-                                   int stride, TX_TYPE tx_type, TX_SIZE tx_size,
-                                   int eob);
 #ifdef __cplusplus
 }
 #endif
diff --git a/av1/common/x86/av1_inv_txfm_ssse3.c b/av1/common/x86/av1_inv_txfm_ssse3.c
index d11f023751..863c9cae29 100644
--- a/av1/common/x86/av1_inv_txfm_ssse3.c
+++ b/av1/common/x86/av1_inv_txfm_ssse3.c
@@ -9,11 +9,13 @@
  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
  */

+#include "av1/common/x86/av1_inv_txfm_ssse3.h"
+
 #include "config/aom_config.h"
 #include "config/av1_rtcd.h"

 #include "av1/common/av1_inv_txfm1d_cfg.h"
-#include "av1/common/x86/av1_inv_txfm_ssse3.h"
+#include "av1/common/av1_inv_txfm2d.h"
 #include "av1/common/x86/av1_txfm_sse2.h"

 // TODO(venkatsanampudi@ittiam.com): move this to header file
diff --git a/av1/common/x86/av1_inv_txfm_ssse3.h b/av1/common/x86/av1_inv_txfm_ssse3.h
index 6e07021da2..c06f7a12f4 100644
--- a/av1/common/x86/av1_inv_txfm_ssse3.h
+++ b/av1/common/x86/av1_inv_txfm_ssse3.h
@@ -220,10 +220,6 @@ static inline void get_eobx_eoby_scan_v_identity(int *eobx, int *eoby,

 typedef void (*transform_1d_ssse3)(const __m128i *input, __m128i *output);

-void av1_lowbd_inv_txfm2d_add_ssse3(const int32_t *input, uint8_t *output,
-                                    int stride, TX_TYPE tx_type,
-                                    TX_SIZE tx_size, int eob);
-
 void av1_lowbd_inv_txfm2d_add_idtx_ssse3(const int32_t *input, uint8_t *output,
                                          int stride, TX_SIZE tx_size);

diff --git a/test/av1_inv_txfm2d_test.cc b/test/av1_inv_txfm2d_test.cc
index 86601bfd33..24e012c086 100644
--- a/test/av1_inv_txfm2d_test.cc
+++ b/test/av1_inv_txfm2d_test.cc
@@ -9,6 +9,8 @@
  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
  */

+#include "av1/common/av1_inv_txfm2d.h"
+
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -374,30 +376,16 @@ TEST_P(AV1LbdInvTxfm2d, DISABLED_Speed) {
 }

 #if HAVE_SSSE3
-extern "C" void av1_lowbd_inv_txfm2d_add_ssse3(const int32_t *input,
-                                               uint8_t *output, int stride,
-                                               TX_TYPE tx_type, TX_SIZE tx_size,
-                                               int eob);
 INSTANTIATE_TEST_SUITE_P(SSSE3, AV1LbdInvTxfm2d,
                          ::testing::Values(av1_lowbd_inv_txfm2d_add_ssse3));
 #endif  // HAVE_SSSE3

 #if HAVE_AVX2
-extern "C" void av1_lowbd_inv_txfm2d_add_avx2(const int32_t *input,
-                                              uint8_t *output, int stride,
-                                              TX_TYPE tx_type, TX_SIZE tx_size,
-                                              int eob);
-
 INSTANTIATE_TEST_SUITE_P(AVX2, AV1LbdInvTxfm2d,
                          ::testing::Values(av1_lowbd_inv_txfm2d_add_avx2));
 #endif  // HAVE_AVX2

 #if HAVE_NEON
-extern "C" void av1_lowbd_inv_txfm2d_add_neon(const int32_t *input,
-                                              uint8_t *output, int stride,
-                                              TX_TYPE tx_type, TX_SIZE tx_size,
-                                              int eob);
-
 // TODO(bug 528050364): Enable this test after issues with
 // arm-linux-gnueabi-gcc-14+ are addressed.
 #if defined(__GNUC__) && __GNUC__ >= 14 && defined(__ARM_ARCH) && __ARM_ARCH < 7