* Onda VX747: add browse screen, pitchscreen, context menu, quickscreen, rewind...
[kugel-rb.git] / apps / codecs / libspeex / filterbank.h
blob3e889a22f7913ada9949d62e714fb71db332b081
1 /* Copyright (C) 2006 Jean-Marc Valin */
2 /**
3 @file filterbank.h
4 @brief Converting between psd and filterbank
5 */
6 /*
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are
9 met:
11 1. Redistributions of source code must retain the above copyright notice,
12 this list of conditions and the following disclaimer.
14 2. Redistributions in binary form must reproduce the above copyright
15 notice, this list of conditions and the following disclaimer in the
16 documentation and/or other materials provided with the distribution.
18 3. The name of the author may not be used to endorse or promote products
19 derived from this software without specific prior written permission.
21 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
25 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 POSSIBILITY OF SUCH DAMAGE.
34 #ifndef FILTERBANK_H
35 #define FILTERBANK_H
37 #include "arch.h"
39 typedef struct {
40 int *bank_left;
41 int *bank_right;
42 spx_word16_t *filter_left;
43 spx_word16_t *filter_right;
44 #ifndef FIXED_POINT
45 float *scaling;
46 #endif
47 int nb_banks;
48 int len;
49 } FilterBank;
52 FilterBank *filterbank_new(int banks, spx_word32_t sampling, int len, int type);
54 void filterbank_destroy(FilterBank *bank);
56 void filterbank_compute_bank32(FilterBank *bank, spx_word32_t *ps, spx_word32_t *mel);
58 void filterbank_compute_psd16(FilterBank *bank, spx_word16_t *mel, spx_word16_t *psd);
60 #ifndef FIXED_POINT
61 void filterbank_compute_bank(FilterBank *bank, float *psd, float *mel);
62 void filterbank_compute_psd(FilterBank *bank, float *mel, float *psd);
63 #endif
66 #endif