xref: /aosp_15_r20/external/pffft/pf_cic.h (revision 3f1979aa0d7ad34fcf3763de7b7b8f8cd67e5bdd)
1*3f1979aaSAndroid Build Coastguard Worker /*
2*3f1979aaSAndroid Build Coastguard Worker This software is part of pffft/pfdsp, a set of simple DSP routines.
3*3f1979aaSAndroid Build Coastguard Worker 
4*3f1979aaSAndroid Build Coastguard Worker Copyright (c) 2014, Andras Retzler <[email protected]>
5*3f1979aaSAndroid Build Coastguard Worker Copyright (c) 2020  Hayati Ayguen <[email protected]>
6*3f1979aaSAndroid Build Coastguard Worker All rights reserved.
7*3f1979aaSAndroid Build Coastguard Worker 
8*3f1979aaSAndroid Build Coastguard Worker Redistribution and use in source and binary forms, with or without
9*3f1979aaSAndroid Build Coastguard Worker modification, are permitted provided that the following conditions are met:
10*3f1979aaSAndroid Build Coastguard Worker     * Redistributions of source code must retain the above copyright
11*3f1979aaSAndroid Build Coastguard Worker       notice, this list of conditions and the following disclaimer.
12*3f1979aaSAndroid Build Coastguard Worker     * Redistributions in binary form must reproduce the above copyright
13*3f1979aaSAndroid Build Coastguard Worker       notice, this list of conditions and the following disclaimer in the
14*3f1979aaSAndroid Build Coastguard Worker       documentation and/or other materials provided with the distribution.
15*3f1979aaSAndroid Build Coastguard Worker     * Neither the name of the copyright holder nor the
16*3f1979aaSAndroid Build Coastguard Worker       names of its contributors may be used to endorse or promote products
17*3f1979aaSAndroid Build Coastguard Worker       derived from this software without specific prior written permission.
18*3f1979aaSAndroid Build Coastguard Worker 
19*3f1979aaSAndroid Build Coastguard Worker THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20*3f1979aaSAndroid Build Coastguard Worker ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21*3f1979aaSAndroid Build Coastguard Worker WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22*3f1979aaSAndroid Build Coastguard Worker DISCLAIMED. IN NO EVENT SHALL ANDRAS RETZLER BE LIABLE FOR ANY
23*3f1979aaSAndroid Build Coastguard Worker DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24*3f1979aaSAndroid Build Coastguard Worker (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25*3f1979aaSAndroid Build Coastguard Worker LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26*3f1979aaSAndroid Build Coastguard Worker ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27*3f1979aaSAndroid Build Coastguard Worker (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28*3f1979aaSAndroid Build Coastguard Worker SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29*3f1979aaSAndroid Build Coastguard Worker */
30*3f1979aaSAndroid Build Coastguard Worker 
31*3f1979aaSAndroid Build Coastguard Worker #pragma once
32*3f1979aaSAndroid Build Coastguard Worker 
33*3f1979aaSAndroid Build Coastguard Worker #include <stdint.h>
34*3f1979aaSAndroid Build Coastguard Worker 
35*3f1979aaSAndroid Build Coastguard Worker #ifdef __cplusplus
36*3f1979aaSAndroid Build Coastguard Worker extern "C" {
37*3f1979aaSAndroid Build Coastguard Worker #endif
38*3f1979aaSAndroid Build Coastguard Worker 
39*3f1979aaSAndroid Build Coastguard Worker /*
40*3f1979aaSAndroid Build Coastguard Worker    ____ ___ ____   ____  ____   ____
41*3f1979aaSAndroid Build Coastguard Worker   / ___|_ _/ ___| |  _ \|  _ \ / ___|
42*3f1979aaSAndroid Build Coastguard Worker  | |    | | |     | | | | | | | |
43*3f1979aaSAndroid Build Coastguard Worker  | |___ | | |___  | |_| | |_| | |___
44*3f1979aaSAndroid Build Coastguard Worker   \____|___\____| |____/|____/ \____|
45*3f1979aaSAndroid Build Coastguard Worker */
46*3f1979aaSAndroid Build Coastguard Worker 
47*3f1979aaSAndroid Build Coastguard Worker typedef struct complexf_s { float i; float q; } complexf;
48*3f1979aaSAndroid Build Coastguard Worker 
49*3f1979aaSAndroid Build Coastguard Worker void *cicddc_init(int factor);
50*3f1979aaSAndroid Build Coastguard Worker void cicddc_free(void *state);
51*3f1979aaSAndroid Build Coastguard Worker void cicddc_s16_c(void *state, int16_t *input, complexf *output, int outsize, float rate);
52*3f1979aaSAndroid Build Coastguard Worker void cicddc_cs16_c(void *state, int16_t *input, complexf *output, int outsize, float rate);
53*3f1979aaSAndroid Build Coastguard Worker void cicddc_cu8_c(void *state, uint8_t *input, complexf *output, int outsize, float rate);
54*3f1979aaSAndroid Build Coastguard Worker 
55*3f1979aaSAndroid Build Coastguard Worker #ifdef __cplusplus
56*3f1979aaSAndroid Build Coastguard Worker }
57*3f1979aaSAndroid Build Coastguard Worker #endif
58*3f1979aaSAndroid Build Coastguard Worker 
59