libg722_1  0.1.0
bv16externs.h
1 /*****************************************************************************/
2 /* BroadVoice(R)16 (BV16) Floating-Point ANSI-C Source Code */
3 /* Revision Date: August 19, 2009 */
4 /* Version 1.0 */
5 /*****************************************************************************/
6 
7 /*****************************************************************************/
8 /* Copyright 2000-2009 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  bv16externs.c : BV16 Fixed-Point externs
24 
25  $Log: bv16externs.h,v $
26  Revision 1.1.1.1 2009/11/19 12:10:48 steveu
27  Start from Broadcom's code
28 
29  Revision 1.1.1.1 2009/11/17 14:06:02 steveu
30  start
31 
32 ******************************************************************************/
33 
34 #include "typedef.h"
35 #include "bv16cnst.h"
36 #include "bvcommon.h"
37 
38 /* POINTERS */
39 extern const Float bv16_winl[WINSZ];
40 extern const Float bv16_sstwin[1 + LPCO];
41 extern const Float bv16_gfsz[];
42 extern const Float bv16_gfsp[];
43 extern const int bv16_idxord[];
44 extern const Float bv16_hpfa[];
45 extern const Float bv16_hpfb[];
46 extern const Float bv16_adf[];
47 extern const Float bv16_bdf[];
48 extern const Float bv16_x[];
49 extern const Float bv16_x2[];
50 extern const Float bv16_MPTH[];
51 
52 /* LSP Quantization */
53 extern const Float bv16_lspecb1[LSPECBSZ1*LPCO];
54 extern const Float bv16_lspecb2[LSPECBSZ2*LPCO];
55 extern const Float bv16_lspmean[LPCO];
56 extern const Float bv16_lspp[LSPPORDER*LPCO];
57 
58 /* Pitch Predictor Codebook */
59 extern const Float bv16_pp9cb[PPCBSZ*9];
60 
61 /* Log-Gain Quantization */
62 extern const Float bv16_lgpecb[LGPECBSZ];
63 extern const Float bv16_lgp[LGPORDER];
64 extern const Float bv16_lgmean;
65 
66 /* Log-Gain Limitation */
67 extern const Float bv16_lgclimit[];
68 
69 /* Excitation Codebook */
70 extern const Float bv16_cccb[CBSZ*VDIM];
71 
72 extern const Float bv16_lgpecb_nh[];
73 
74 /* Function Prototypes */
75 extern Float estlevel(Float lg,
76  Float *level,
77  Float *lmax,
78  Float *lmin,
79  Float *lmean,
80  Float *x1,
81  int16_t ngfae,
82  int16_t nggalgc,
83  Float *estl_alpha_min);
84 
85 extern void excdec_w_LT_synth(
86  Float *ltsym, /* long-term synthesis filter memory at decoder*/
87  int16_t *idx, /* excitation codebook index array for current subframe */
88  Float gainq, /* quantized linear gains for sub-subframes */
89  Float *b, /* coefficient of 3-tap pitch predictor */
90  int16_t pp, /* pitch period */
91  const Float *cb, /* scalar quantizer codebook */
92  Float *EE);
93 
94 extern Float gaindec(Float *lgq,
95  int16_t gidx,
96  Float *lgpm,
97  Float *prevlg, /* previous log gains (last two frames) */
98  Float level,
99  int16_t *nggalgc,
100  Float *lg_el);
101 
102 extern Float gaindec_fe(Float lgq_last,
103  Float *lgpm);
104 
105 void gainplc(Float E,
106  Float *lgeqm,
107  Float *lgqm);
108 
109 extern void lspdec(
110  Float *lspq,
111  int16_t *lspidx,
112  Float *lsppm,
113  Float *lspq_last);
114 
115 extern void lspplc(
116  Float *lspq,
117  Float *lsppm);
118 
119 extern int coarsepitch(
120  Float *xw,
121  Float *xwd,
122  Float *dfm,
123  int cpplast);
124 
125 extern int refinepitch(
126  Float *x,
127  int cpp,
128  Float *ppt);
129 
130 extern int pitchtapquan(
131  Float *x,
132  int pp,
133  Float *b,
134  Float *re);
135 
136 extern void excquan(
137  int16_t *idx, /* quantizer codebook index for uq[] vector */
138  Float *s, /* input speech signal vector */
139  Float *aq, /* short-term predictor coefficient array */
140  Float *fsz, /* short-term noise feedback filter - numerator */
141  Float *fsp, /* short-term noise feedback filter - denominator */
142  Float *b, /* coefficient of 3-tap pitch predictor */
143  Float beta, /* coefficient of 1-tap LT noise feedback filter */
144  Float *stsym, /* filter memory before filtering of current vector */
145  Float *ltsym, /* long-term synthesis filter memory */
146  Float *ltnfm, /* long-term noise feedback filter memory */
147  Float *stnfz,
148  Float *stnfp,
149  Float *cb, /* scalar quantizer codebook */
150  int pp); /* pitch period (# of 8 kHz samples) */
151 
152 extern int gainquan(
153  Float *gainq,
154  Float lg,
155  Float *lgpm,
156  Float *prevlg,
157  Float level);
158 
159 extern void lspquan(
160  Float *lspq,
161  int16_t *lspidx,
162  Float *lsp,
163  Float *lsppm);
164 
165 extern void bv16_pp3dec(int16_t idx, Float *b);