1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
/*****************************************************************************/
/* BroadVoice(R)16 (BV16) Fixed-Point ANSI-C Source Code */
/* Revision Date: November 13, 2009 */
/* Version 1.1 */
/*****************************************************************************/
/*****************************************************************************/
/* Copyright 2000-2009 Broadcom Corporation */
/* */
/* This software is provided under the GNU Lesser General Public License, */
/* version 2.1, as published by the Free Software Foundation ("LGPL"). */
/* This program is distributed in the hope that it will be useful, but */
/* WITHOUT ANY SUPPORT OR WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LGPL for */
/* more details. A copy of the LGPL is available at */
/* http://www.broadcom.com/licenses/LGPLv2.1.php, */
/* or by writing to the Free Software Foundation, Inc., */
/* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*****************************************************************************/
/*****************************************************************************
bv16externs.c : BV16 Fixed-Point externs
$Log$
******************************************************************************/
/* POINTERS */
extern Word16 winl[WINSZ];
extern Word16 sstwinl_h[];
extern Word16 sstwinl_l[];
extern Word16 gfsz[];
extern Word16 gfsp[];
extern Word16 idxord[];
extern Word16 hpfa[];
extern Word16 hpfb[];
extern Word16 adf_h[];
extern Word16 adf_l[];
extern Word16 bdf[];
extern Word16 x[];
extern Word16 x2[];
extern Word16 MPTH[];
/* LSP Quantization */
extern Word16 lspecb1[];
extern Word16 lspecb2[];
extern Word16 lspmean[];
extern Word16 lspp[];
/* Log-Gain Quantization */
extern Word16 lgpecb[];
extern Word16 lgp[];
extern Word16 lgmean;
/* Log-Gain Limitation */
extern Word16 lgclimit[];
/* Excitation Codebook */
extern Word16 cccb[];
/* Function Prototypes */
Word32 estlevel(
Word32 lg,
Word32 *level,
Word32 *lmax,
Word32 *lmin,
Word32 *lmean,
Word32 *x1,
Word16 ngfae,
Word16 nggalgc,
Word16 *estl_alpha_min); /* Q15 */
void excdec_w_synth(
Word16 *xq, /* (o) Q0 quantized signal vector */
Word16 *ltsym, /* (i/o) Q16 quantized excitation signal vector */
Word16 *stsym, /* (i/o) Q0 short-term predictor memory */
Word16 *idx, /* (o) quantizer codebook index for uq[] vector */
Word16 *b, /* (i) Q15 coefficient of 3-tap pitch predictor */
Word16 *cb, /* (i) Q0 codebook */
Word16 pp, /* pitch period (# of 8 kHz samples) */
Word16 *aq, /* (i) Q12 short-term predictor coefficients */
Word16 gain_exp, /* gain_exp of current sub-frame */
Word32 *EE
);
Word32 gaindec(
Word32 *lgq, /* Q25 */
Word16 gidx,
Word16 *lgpm, /* Q11 */
Word32 *prevlg, /* Q25 */
Word32 level, /* Q25 */
Word16 *nggalgc,
Word32 *lg_el);
void gainplc(Word32 E, Word16 *lgeqm, Word32 *lgqm);
void lspdec(
Word16 *lspq, /* Q15 */
Word16 *lspidx,
Word16 *lsppm, /* Q15 */
Word16 *lspqlast);
void lspdecplc(
Word16 *lspq, /* Q15 */
Word16 *lsppm); /* Q15 */
Word16 coarsepitch(
Word16 *xw, /* (i) Q1 weighted low-band signal frame */
struct BV16_Encoder_State *c); /* (i/o) coder state */
Word16 refinepitch(
Word16 *x,
Word16 cpp,
Word16 *ppt);
Word16 pitchtapquan(
Word16 *x,
Word16 pp,
Word16 *b,
Word32 *re);
void excquan(
Word16 *idx, /* quantizer codebook index for uq[] vector */
Word16 *s, /* (i) Q0 input signal vector */
Word16 *aq, /* (i) Q12 noise feedback filter coefficient array */
Word16 *fsz, /* (i) Q12 short-term noise feedback filter - numerator */
Word16 *fsp, /* (i) Q12 short-term noise feedback filter - denominator */
Word16 *b, /* (i) Q15 coefficient of 3-tap pitch predictor */
Word16 beta, /* (i) Q13 coefficient of pitch feedback filter */
Word16 *stsym, /* (i/o) Q0 filter memory */
Word16 *ltsym, /* (i/0) Q0 long-term synthesis filter memory */
Word16 *ltnfm, /* (i/o) Q0 long-term noise feedback filter memory */
Word16 *stnfz, /* (i/o) Q0 filter memory */
Word16 *stnfp, /* (i/o) Q0 filter memory */
Word16 *cb, /* (i) scalar quantizer codebook - normalized by gain_exp */
Word16 pp, /* pitch period (# of 8 kHz samples) */
Word16 gain_exp
);
Word16 gainquan(
Word32 *gainq, /* Q18 */
Word32 *ee, /* Q3 */
Word16 *lgpm, /* Q11 */
Word32 *prevlg, /* Q25 */
Word32 level); /* Q25 */
void lspquan(
Word16 *lspq,
Word16 *lspidx,
Word16 *lsp,
Word16 *lsppm);
void preprocess(
struct BV16_Encoder_State *cs,
Word16 *output, /* (o) Q0 output signal, less factor 1.5 */
Word16 *input, /* (i) Q0 input signal */
Word16 N); /* length of signal */
|