Sound Open Firmware
Loading...
Searching...
No Matches
iir_df1_hifi3.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2022 Intel Corporation. All rights reserved.
4 *
5 * Author: Andrula Song <andrula.song@intel.com>
6 */
7
8#ifndef __IIR_DF1_HIFI3_H__
9#define __IIR_DF1_HIFI3_H__
10
11#include <xtensa/tie/xt_hifi3.h>
12#include <stdint.h>
13
14static inline int16_t iir_df1_s16(struct iir_state_df1 *iir, int16_t x)
15{
16 ae_f32x2 y = iir_df1(iir, ((int32_t)x) << 16);
17
18 return AE_ROUND16X4F32SSYM(y, y);
19}
20
21static inline int32_t iir_df1_s24(struct iir_state_df1 *iir, int32_t x)
22{
23 ae_f32x2 y = iir_df1(iir, x << 8);
24
25 return AE_SRAI32(AE_SLAI32S(AE_SRAI32R(y, 8), 8), 8);
26}
27
28static inline int16_t iir_df1_s32_s16(struct iir_state_df1 *iir, int32_t x)
29{
30 ae_f32x2 y = iir_df1(iir, x);
31
32 return AE_ROUND16X4F32SSYM(y, y);
33}
34
35static inline int32_t iir_df1_s32_s24(struct iir_state_df1 *iir, int32_t x)
36{
37 ae_f32x2 y = iir_df1(iir, x);
38
39 return AE_SRAI32(AE_SLAI32S(AE_SRAI32R(y, 8), 8), 8);
40}
41
42#endif /* __IIR_DF1_HIFI3_H__ */
43
int32_t iir_df1(struct iir_state_df1 *iir, int32_t x)
Calculate IIR filter consisting of biquads.
static int16_t iir_df1_s32_s16(struct iir_state_df1 *iir, int32_t x)
Definition iir_df1_hifi3.h:28
static int32_t iir_df1_s24(struct iir_state_df1 *iir, int32_t x)
Definition iir_df1_hifi3.h:21
static int32_t iir_df1_s32_s24(struct iir_state_df1 *iir, int32_t x)
Definition iir_df1_hifi3.h:35
static int16_t iir_df1_s16(struct iir_state_df1 *iir, int16_t x)
Definition iir_df1_hifi3.h:14
Definition iir_df1.h:18