Sound Open Firmware
Loading...
Searching...
No Matches
fir_hifi2ep.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2017 Intel Corporation. All rights reserved.
4 *
5 * Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
6 */
7
8#ifndef __SOF_MATH_FIR_HIFI2EP_H__
9#define __SOF_MATH_FIR_HIFI2EP_H__
10
11#include <sof/math/fir_config.h>
12#include <sof/common.h>
13
14#if SOF_USE_HIFI(2, FILTER)
15
17#include <sof/audio/buffer.h>
18#include <user/fir.h>
19#include <xtensa/config/defs.h>
20#include <xtensa/tie/xt_hifi2.h>
21#include <stdint.h>
22
23struct comp_buffer;
24struct sof_eq_fir_coef_data;
25
26struct fir_state_32x16 {
27 ae_p24x2f *rwp; /* Circular read and write pointer */
28 ae_p24f *delay; /* Pointer to FIR delay line */
29 ae_p24f *delay_end; /* Pointer to FIR delay line end */
30 ae_p16x2s *coef; /* Pointer to FIR coefficients */
31 int taps; /* Number of FIR taps */
32 int length; /* Number of FIR taps plus input length (even) */
33 int out_shift; /* Amount of right shifts at output */
34};
35
36void fir_reset(struct fir_state_32x16 *fir);
37
38int fir_delay_size(struct sof_fir_coef_data *config);
39
40int fir_init_coef(struct fir_state_32x16 *fir,
41 struct sof_fir_coef_data *config);
42
43void fir_init_delay(struct fir_state_32x16 *fir, int32_t **data);
44
45/* Setup circular buffer for FIR input data delay */
46static inline void fir_hifiep_setup_circular(struct fir_state_32x16 *fir)
47{
48 AE_SETCBEGIN0(fir->delay);
49 AE_SETCEND0(fir->delay_end);
50}
51
52void fir_get_lrshifts(struct fir_state_32x16 *fir, int *lshift,
53 int *rshift);
54
55void fir_32x16(struct fir_state_32x16 *fir, int32_t x, int32_t *y, int lshift, int rshift);
56
57void fir_32x16_2x(struct fir_state_32x16 *fir, int32_t x0, int32_t x1,
58 int32_t *y0, int32_t *y1, int lshift, int rshift);
59
60#endif
61#endif /* __SOF_MATH_FIR_HIFI2EP_H__ */
Audio Stream API definition.
uint32_t data[]
Definition debug_stream_slot.h:2
Definition buffer.h:130
Definition fir.h:15
uint32_t length
Definition tlv.h:1