xref: /aosp_15_r20/external/XNNPACK/src/xnnpack/filterbank.h (revision 4bdc94577ba0e567308109d787f7fec7b531ce36)
1 // Copyright 2022 Google LLC
2 //
3 // This source code is licensed under the BSD-style license found in the
4 // LICENSE file in the root directory of this source tree.
5 
6 #pragma once
7 
8 #include <stddef.h>
9 #include <stdint.h>
10 
11 #include <xnnpack/common.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 
18 #define DECLARE_U32_FILTERBANK_ACCUMULATE_UKERNEL_FUNCTION(fn_name) \
19   XNN_INTERNAL void fn_name(                                        \
20     size_t rows,                                                    \
21     const uint32_t* input,                                          \
22     const uint8_t* weight_widths,                                   \
23     const uint16_t* weights,                                        \
24     uint64_t* output);
25 
26 DECLARE_U32_FILTERBANK_ACCUMULATE_UKERNEL_FUNCTION(xnn_u32_filterbank_accumulate_ukernel__aarch32_arm_x1)
27 DECLARE_U32_FILTERBANK_ACCUMULATE_UKERNEL_FUNCTION(xnn_u32_filterbank_accumulate_ukernel__aarch32_neon_x1)
28 DECLARE_U32_FILTERBANK_ACCUMULATE_UKERNEL_FUNCTION(xnn_u32_filterbank_accumulate_ukernel__aarch32_neon_x2)
29 DECLARE_U32_FILTERBANK_ACCUMULATE_UKERNEL_FUNCTION(xnn_u32_filterbank_accumulate_ukernel__neon_x1)
30 DECLARE_U32_FILTERBANK_ACCUMULATE_UKERNEL_FUNCTION(xnn_u32_filterbank_accumulate_ukernel__neon_x2)
31 DECLARE_U32_FILTERBANK_ACCUMULATE_UKERNEL_FUNCTION(xnn_u32_filterbank_accumulate_ukernel__scalar_x1)
32 
33 
34 #define DECLARE_U32_FILTERBANK_SUBTRACT_UKERNEL_FUNCTION(fn_name) \
35   XNN_INTERNAL void fn_name(                                      \
36     size_t batch_size,                                            \
37     const uint32_t* input,                                        \
38     uint32_t smoothing,                                           \
39     uint32_t alternate_smoothing,                                 \
40     uint32_t one_minus_smoothing,                                 \
41     uint32_t alternate_one_minus_smoothing,                       \
42     uint32_t min_signal_remaining,                                \
43     uint32_t smoothing_bits,                                      \
44     uint32_t spectral_subtraction_bits,                           \
45     uint32_t* noise_estimate,                                     \
46     uint32_t* output);
47 
48 
49 DECLARE_U32_FILTERBANK_SUBTRACT_UKERNEL_FUNCTION(xnn_u32_filterbank_subtract_ukernel__scalar_x2)
50 
51 #ifdef __cplusplus
52 }  // extern "C"
53 #endif
54