blob: 1316d8495eee2b64b6064d19372c389aec1864a3
1 | /*****************************************************************************/ |
2 | /* BroadVoice(R)32 (BV32) Floating-Point ANSI-C Source Code */ |
3 | /* Revision Date: October 5, 2012 */ |
4 | /* Version 1.2 */ |
5 | /*****************************************************************************/ |
6 | |
7 | /*****************************************************************************/ |
8 | /* Copyright 2000-2012 Broadcom Corporation */ |
9 | /* */ |
10 | /* This software is provided under the GNU Lesser General Public License, */ |
11 | /* version 2.1, as published by the Free Software Foundation ("LGPL"). */ |
12 | /* This program is distributed in the hope that it will be useful, but */ |
13 | /* WITHOUT ANY SUPPORT OR WARRANTY; without even the implied warranty of */ |
14 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LGPL for */ |
15 | /* more details. A copy of the LGPL is available at */ |
16 | /* http://www.broadcom.com/licenses/LGPLv2.1.php, */ |
17 | /* or by writing to the Free Software Foundation, Inc., */ |
18 | /* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
19 | /*****************************************************************************/ |
20 | |
21 | |
22 | /***************************************************************************** |
23 | bvcommon.h : Common #defines and prototypes |
24 | |
25 | $Log$ |
26 | ******************************************************************************/ |
27 | |
28 | #ifndef BVCOMMON_H |
29 | #define BVCOMMON_H |
30 | |
31 | /* Function Prototypes */ |
32 | |
33 | |
34 | void pp3dec( |
35 | short idx, |
36 | Float *b); |
37 | |
38 | void apfilter( |
39 | Float *a, /* (i) a[m+1] prediction coefficients (m=10) */ |
40 | int m, /* (i) LPC order */ |
41 | Float *x, /* (i) input signal */ |
42 | Float *y, /* (o) output signal */ |
43 | int lg, /* (i) size of filtering */ |
44 | Float *mem, /* (i/o) input memory */ |
45 | short update);/* (i) flag for memory update */ |
46 | |
47 | void azfilter( |
48 | Float *a, /* (i) prediction coefficients */ |
49 | int m, /* (i) LPC order */ |
50 | Float *x, /* (i) input signal vector */ |
51 | Float *y, /* (o) output signal vector */ |
52 | int lg, /* (i) size of filtering */ |
53 | Float *mem, /* (i/o) filter memory before filtering */ |
54 | short update); /* (i) flag for memory update */ |
55 | |
56 | void Autocor( |
57 | Float *r, /* (o) : Autocorrelations */ |
58 | Float *x, /* (i) : Input signal */ |
59 | Float *window, /* (i) : LPC Analysis window */ |
60 | int l_window,/* (i) : window length */ |
61 | int m); /* (i) : LPC order */ |
62 | |
63 | void Levinson( |
64 | Float *r, /* (i): autocorrelation coefficients */ |
65 | Float *a, /* (o): LPC coefficients */ |
66 | Float *old_a, /* (i/o): LPC coefficients of previous frame */ |
67 | int m); /* (i): LPC order */ |
68 | |
69 | void a2lsp( |
70 | Float pc[], /* (i) input the np+1 predictor coeff. */ |
71 | Float lsp[], /* (o) line spectral pairs */ |
72 | Float old_lsp[]); /* (i/o) old lsp[] (in case not found 10 roots) */ |
73 | |
74 | void lsp2a( |
75 | Float *lsp, /* (i) LSP vector */ |
76 | Float *a); /* (o) LPC coefficients */ |
77 | |
78 | void stblz_lsp(Float *lsp, int order); |
79 | int stblchck(Float *x, int vdim); |
80 | |
81 | /* LPC to LSP Conversion */ |
82 | extern Float grid[]; |
83 | |
84 | /* LPC bandwidth expansion */ |
85 | extern Float bwel[]; |
86 | |
87 | /* LPC WEIGHTING FILTER */ |
88 | extern Float STWAL[]; |
89 | |
90 | /* ----- Basic Codec Parameters ----- */ |
91 | #define LPCO 8 /* LPC Order */ |
92 | #define Ngrd 60 /* LPC to LSP Conversion */ |
93 | |
94 | #define LSPMIN 0.00150f /* minimum lsp frequency, 6/12 Hz for BV16/BV32 */ |
95 | #define LSPMAX 0.99775f /* maximum lsp frequency, 3991/7982 Hz for BV16/BV32 */ |
96 | #define DLSPMIN 0.01250f /* minimum lsp spacing, 50/100 Hz for BV16/BV32 */ |
97 | #define STBLDIM 3 /* dimension of stability enforcement */ |
98 | |
99 | extern Float pp9cb[]; |
100 | |
101 | #endif /* BVCOMMON_H */ |
102 | |
103 |