libg722_1 0.1.0
bv32externs.h
1/*
2 * broadvoice - a library for the BroadVoice 16 and 32 codecs
3 *
4 * bv32externs.h -
5 *
6 * Adapted by Steve Underwood <steveu@coppice.org> from code which is
7 * Copyright 2000-2009 Broadcom Corporation
8 *
9 * All rights reserved.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 2.1,
13 * as published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 * $Id: bv32externs.h,v 1.1.1.1 2009/11/19 12:10:48 steveu Exp $
25 */
26
27#include "typedef.h"
28#include "bv32cnst.h"
29#include "bvcommon.h"
30
31/* Pointers */
32extern const Float bv32_winl[];
33extern const Float bv32_sstwin[];
34extern const int bv32_idxord[];
35extern const Float bv32_hpfa[];
36extern const Float bv32_hpfb[];
37extern const Float bv32_adf[];
38extern const Float bv32_bdf[];
39extern const Float bv32_x[];
40extern const Float bv32_x2[];
41extern Float bv32_invk[];
42extern const Float bv32_MPTH[];
43
44
45/* LSP Quantization */
46extern const Float bv32_lspecb1[LSPECBSZ1*LPCO];
47extern const Float bv32_lspecb21[LSPECBSZ21*SVD1];
48extern const Float bv32_lspecb22[LSPECBSZ22*SVD2];
49extern const Float bv32_lspmean[LPCO];
50extern const Float bv32_lspp[LSPPORDER*LPCO];
51
52/* Pitch Predictor Codebook */
53extern const Float bv32_pp9cb[];
54
55/* Log-Gain Quantization */
56extern const Float bv32_lgpecb[LGPECBSZ];
57extern const Float bv32_lgp[LGPORDER];
58extern const Float bv32_lgmean;
59
60/* Log-Gain Limitation */
61extern const Float bv32_lgclimit[];
62
63/* Excitation Codebook */
64extern const Float bv32_cccb[CBSZ*VDIM];
65
66extern const Float bv32_lgpecb_nh[];
67extern const Float bv32_a_pre[];
68extern const Float bv32_b_pre[];
69
70/* Function Prototypes */
71
72extern Float bv32_estlevel(Float lg,
73 Float *level,
74 Float *lmax,
75 Float *lmin,
76 Float *lmean,
77 Float *x1);
78
79extern void bv32_excdec_w_LT_synth(Float *ltsymd, /* long-term synthesis filter memory at decoder*/
80 int16_t *idx, /* excitation codebook index array for current subframe */
81 Float *gainq, /* quantized linear gains for sub-subframes */
82 Float *b, /* coefficient of 3-tap pitch predictor */
83 int16_t pp, /* pitch period (# of 8 kHz samples) */
84 Float *EE);
85
86extern Float bv32_gaindec(Float *lgq,
87 int16_t gidx,
88 Float *lgpm,
89 Float *prevlg,
90 Float level,
91 int16_t *nclglim,
92 int16_t lctimer);
93
94extern void bv32_gainplc(Float E,
95 Float *lgeqm,
96 Float *lgqm);
97
98extern void bv32_lspdec(Float *lspq,
99 int16_t *lspidx,
100 Float *lsppm,
101 Float *lspq_last);
102
103extern void bv32_lspplc(Float *lspq,
104 Float *lsppm);
105
106extern int bv32_coarsepitch(Float *xw,
107 Float *xwd,
108 Float *dfm,
109 int cpplast);
110
111
112extern int bv32_refinepitch(Float *x,
113 int cpp,
114 Float *ppt);
115
116extern int bv32_pitchtapquan(Float *x,
117 int pp,
118 Float *b);
119
120extern void bv32_excquan(
121 Float *qv, /* output quantized excitation signal vector */
122 int16_t *idx, /* quantizer codebook index for uq[] vector */
123 Float *d, /* input prediction residual signal vector */
124 Float *h, /* noise feedback filter coefficient array */
125 Float *b, /* coefficient of 3-tap pitch predictor */
126 Float beta, /* coefficient of weighted 3-tap pitch predictor */
127 Float *ltsym, /* long-term synthesis filter memory */
128 Float *ltnfm, /* long-term noise feedback filter memory */
129 Float *stnfm, /* short-term noise feedback filter memory */
130 Float *cb, /* scalar quantizer codebook */
131 int pp); /* pitch period (# of 8 kHz samples) */
132
133extern int bv32_gainquan(Float *gainq,
134 Float lg,
135 Float *lgpm,
136 Float *prevlg,
137 Float level);
138
139extern void bv32_lspquan(Float *lspq,
140 int16_t *lspidx,
141 Float *lsp,
142 Float *lsppm);
143
144extern void bv32_pp3dec(int16_t idx, Float *b);