Repository navigation
Expand file tree
/
Copy pathfir_hifi2ep.h
More file actions
61 lines (46 loc) · 1.74 KB
/
Copy pathfir_hifi2ep.h
File metadata and controls
61 lines (46 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2017 Intel Corporation. All rights reserved.
*
* Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
*/
#ifndef __SOF_MATH_FIR_HIFI2EP_H__
#define __SOF_MATH_FIR_HIFI2EP_H__
#include <sof/math/fir_config.h>
#if FIR_HIFIEP
#include <sof/audio/audio_stream.h>
#include <sof/audio/buffer.h>
#include <user/fir.h>
#include <xtensa/config/defs.h>
#include <xtensa/tie/xt_hifi2.h>
#include <stdint.h>
struct comp_buffer;
struct sof_eq_fir_coef_data;
struct fir_state_32x16 {
ae_p24x2f *rwp; /* Circular read and write pointer */
ae_p24f *delay; /* Pointer to FIR delay line */
ae_p24f *delay_end; /* Pointer to FIR delay line end */
ae_p16x2s *coef; /* Pointer to FIR coefficients */
int taps; /* Number of FIR taps */
int length; /* Number of FIR taps plus input length (even) */
int in_shift; /* Amount of right shifts at input */
int out_shift; /* Amount of right shifts at output */
};
void fir_reset(struct fir_state_32x16 *fir);
int fir_delay_size(struct sof_fir_coef_data *config);
int fir_init_coef(struct fir_state_32x16 *fir,
struct sof_fir_coef_data *config);
void fir_init_delay(struct fir_state_32x16 *fir, int32_t **data);
/* Setup circular buffer for FIR input data delay */
static inline void fir_hifiep_setup_circular(struct fir_state_32x16 *fir)
{
AE_SETCBEGIN0(fir->delay);
AE_SETCEND0(fir->delay_end);
}
void fir_get_lrshifts(struct fir_state_32x16 *fir, int *lshift,
int *rshift);
void fir_32x16_hifiep(struct fir_state_32x16 *fir, int32_t x, int32_t *y, int lshift, int rshift);
void fir_32x16_2x_hifiep(struct fir_state_32x16 *fir, int32_t x0, int32_t x1,
int32_t *y0, int32_t *y1, int lshift, int rshift);
#endif
#endif /* __SOF_MATH_FIR_HIFI2EP_H__ */