spandsp: lpc10.h Source File

spandsp 0.0.6

private/lpc10.h
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * private/lpc10.h - LPC10 low bit rate speech codec.
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2006 Steve Underwood
9 *
10 * All rights reserved.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 2.1,
14 * as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#if !defined(_SPANDSP_PRIVATE_LPC10_H_)
27#define _SPANDSP_PRIVATE_LPC10_H_
28
29/*!
30 LPC10 codec encoder state descriptor. This defines the state of
31 a single working instance of the LPC10 encoder.
32*/
33 struct lpc10_encode_state_s
34{
35 /*! \brief ??? */
36 int error_correction;
37
38 /* State used only by function high_pass_100hz */
39 /*! \brief ??? */
40 float z11;
41 /*! \brief ??? */
42 float z21;
43 /*! \brief ??? */
44 float z12;
45 /*! \brief ??? */
46 float z22;
47
48 /* State used by function lpc10_analyse */
49 /*! \brief ??? */
50 float inbuf[LPC10_SAMPLES_PER_FRAME*3];
51 /*! \brief ??? */
52 float pebuf[LPC10_SAMPLES_PER_FRAME*3];
53 /*! \brief ??? */
54 float lpbuf[696];
55 /*! \brief ??? */
56 float ivbuf[312];
57 /*! \brief ??? */
58 float bias;
59 /*! \brief No initial value necessary */
60 int32_t osbuf[10];
61 /*! \brief Initial value 1 */
62 int32_t osptr;
63 /*! \brief ??? */
64 int32_t obound[3];
65 /*! \brief Initial value vwin[2][0] = 307; vwin[2][1] = 462; */
66 int32_t vwin[3][2];
67 /*! \brief Initial value awin[2][0] = 307; awin[2][1] = 462; */
68 int32_t awin[3][2];
69 /*! \brief ??? */
70 int32_t voibuf[4][2];
71 /*! \brief ??? */
72 float rmsbuf[3];
73 /*! \brief ??? */
74 float rcbuf[3][10];
75 /*! \brief ??? */
76 float zpre;
77
78 /* State used by function onset */
79 /*! \brief ??? */
80 float n;
81 /*! \brief Initial value 1.0f */
82 float d__;
83 /*! \brief No initial value necessary */
84 float fpc;
85 /*! \brief ??? */
86 float l2buf[16];
87 /*! \brief ??? */
88 float l2sum1;
89 /*! \brief Initial value 1 */
90 int32_t l2ptr1;
91 /*! \brief Initial value 9 */
92 int32_t l2ptr2;
93 /*! \brief No initial value necessary */
94 int32_t lasti;
95 /*! \brief Initial value FALSE */
96 int hyst;
97
98 /* State used by function lpc10_voicing */
99 /*! \brief Initial value 20.0f */
100 float dither;
101 /*! \brief ??? */
102 float snr;
103 /*! \brief ??? */
104 float maxmin;
105 /*! \brief Initial value is probably unnecessary */
106 float voice[3][2];
107 /*! \brief ??? */
108 int32_t lbve;
109 /*! \brief ??? */
110 int32_t lbue;
111 /*! \brief ??? */
112 int32_t fbve;
113 /*! \brief ??? */
114 int32_t fbue;
115 /*! \brief ??? */
116 int32_t ofbue;
117 /*! \brief ??? */
118 int32_t sfbue;
119 /*! \brief ??? */
120 int32_t olbue;
121 /*! \brief ??? */
122 int32_t slbue;
123
124 /* State used by function dynamic_pitch_tracking */
125 /*! \brief ??? */
126 float s[60];
127 /*! \brief ??? */
128 int32_t p[2][60];
129 /*! \brief ??? */
130 int32_t ipoint;
131 /*! \brief ??? */
132 float alphax;
133
134 /* State used by function lpc10_pack */
135 /*! \brief ??? */
136 int32_t isync;
137};
138
139/*!
140 LPC10 codec decoder state descriptor. This defines the state of
141 a single working instance of the LPC10 decoder.
142*/
143 struct lpc10_decode_state_s
144{
145 /*! \brief ??? */
146 int error_correction;
147
148 /* State used by function decode */
149 /*! \brief Initial value 60 */
150 int32_t iptold;
151 /*! \brief Initial value TRUE */
152 int first;
153 /*! \brief ??? */
154 int32_t ivp2h;
155 /*! \brief ??? */
156 int32_t iovoic;
157 /*! \brief Initial value 60. */
158 int32_t iavgp;
159 /*! \brief ??? */
160 int32_t erate;
161 /*! \brief ??? */
162 int32_t drc[10][3];
163 /*! \brief ??? */
164 int32_t dpit[3];
165 /*! \brief ??? */
166 int32_t drms[3];
167
168 /* State used by function synths */
169 /*! \brief ??? */
170 float buf[LPC10_SAMPLES_PER_FRAME*2];
171 /*! \brief Initial value LPC10_SAMPLES_PER_FRAME */
172 int32_t buflen;
173
174 /* State used by function pitsyn */
175 /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */
176 int32_t ivoico;
177 /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */
178 int32_t ipito;
179 /*! \brief Initial value 1.0f */
180 float rmso;
181 /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */
182 float rco[10];
183 /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */
184 int32_t jsamp;
185 /*! \brief Initial value TRUE */
186 int first_pitsyn;
187
188 /* State used by function bsynz */
189 /*! \brief ??? */
190 int32_t ipo;
191 /*! \brief ??? */
192 float exc[166];
193 /*! \brief ??? */
194 float exc2[166];
195 /*! \brief ??? */
196 float lpi[3];
197 /*! \brief ??? */
198 float hpi[3];
199 /*! \brief ??? */
200 float rmso_bsynz;
201
202 /* State used by function random */
203 /*! \brief ??? */
204 int32_t j;
205 /*! \brief ??? */
206 int32_t k;
207 /*! \brief ??? */
208 int16_t y[5];
209
210 /* State used by function deemp */
211 /*! \brief ??? */
212 float dei[2];
213 /*! \brief ??? */
214 float deo[3];
215};
216
217#endif
218/*- End of include ---------------------------------------------------------*/
lpc10_decode_state_s
Definition private/lpc10.h:144
lpc10_decode_state_s::ipito
int32_t ipito
No initial value necessary as long as first_pitsyn is initially TRUE.
Definition private/lpc10.h:178
lpc10_decode_state_s::lpi
float lpi[3]
???
Definition private/lpc10.h:196
lpc10_decode_state_s::jsamp
int32_t jsamp
No initial value necessary as long as first_pitsyn is initially TRUE.
Definition private/lpc10.h:184
lpc10_decode_state_s::erate
int32_t erate
???
Definition private/lpc10.h:160
lpc10_decode_state_s::hpi
float hpi[3]
???
Definition private/lpc10.h:198
lpc10_decode_state_s::iavgp
int32_t iavgp
Initial value 60.
Definition private/lpc10.h:158
lpc10_decode_state_s::first_pitsyn
int first_pitsyn
Initial value TRUE.
Definition private/lpc10.h:186
lpc10_decode_state_s::buflen
int32_t buflen
Initial value LPC10_SAMPLES_PER_FRAME.
Definition private/lpc10.h:172
lpc10_decode_state_s::ipo
int32_t ipo
???
Definition private/lpc10.h:190
lpc10_decode_state_s::buf
float buf[LPC10_SAMPLES_PER_FRAME *2]
???
Definition private/lpc10.h:170
lpc10_decode_state_s::deo
float deo[3]
???
Definition private/lpc10.h:214
lpc10_decode_state_s::exc
float exc[166]
???
Definition private/lpc10.h:192
lpc10_decode_state_s::error_correction
int error_correction
???
Definition private/lpc10.h:146
lpc10_decode_state_s::k
int32_t k
???
Definition private/lpc10.h:206
lpc10_decode_state_s::rmso
float rmso
Initial value 1.0f.
Definition private/lpc10.h:180
lpc10_decode_state_s::first
int first
Initial value TRUE.
Definition private/lpc10.h:152
lpc10_decode_state_s::dpit
int32_t dpit[3]
???
Definition private/lpc10.h:164
lpc10_decode_state_s::y
int16_t y[5]
???
Definition private/lpc10.h:208
lpc10_decode_state_s::exc2
float exc2[166]
???
Definition private/lpc10.h:194
lpc10_decode_state_s::drc
int32_t drc[10][3]
???
Definition private/lpc10.h:162
lpc10_decode_state_s::dei
float dei[2]
???
Definition private/lpc10.h:212
lpc10_decode_state_s::ivp2h
int32_t ivp2h
???
Definition private/lpc10.h:154
lpc10_decode_state_s::iovoic
int32_t iovoic
???
Definition private/lpc10.h:156
lpc10_decode_state_s::rco
float rco[10]
No initial value necessary as long as first_pitsyn is initially TRUE.
Definition private/lpc10.h:182
lpc10_decode_state_s::rmso_bsynz
float rmso_bsynz
???
Definition private/lpc10.h:200
lpc10_decode_state_s::iptold
int32_t iptold
Initial value 60.
Definition private/lpc10.h:150
lpc10_decode_state_s::j
int32_t j
???
Definition private/lpc10.h:204
lpc10_decode_state_s::ivoico
int32_t ivoico
No initial value necessary as long as first_pitsyn is initially TRUE.
Definition private/lpc10.h:176
lpc10_decode_state_s::drms
int32_t drms[3]
???
Definition private/lpc10.h:166
lpc10_encode_state_s
Definition private/lpc10.h:34
lpc10_encode_state_s::lbue
int32_t lbue
???
Definition private/lpc10.h:110
lpc10_encode_state_s::inbuf
float inbuf[LPC10_SAMPLES_PER_FRAME *3]
???
Definition private/lpc10.h:50
lpc10_encode_state_s::slbue
int32_t slbue
???
Definition private/lpc10.h:122
lpc10_encode_state_s::snr
float snr
???
Definition private/lpc10.h:102
lpc10_encode_state_s::z11
float z11
???
Definition private/lpc10.h:40
lpc10_encode_state_s::bias
float bias
???
Definition private/lpc10.h:58
lpc10_encode_state_s::ipoint
int32_t ipoint
???
Definition private/lpc10.h:130
lpc10_encode_state_s::dither
float dither
Initial value 20.0f.
Definition private/lpc10.h:100
lpc10_encode_state_s::l2ptr2
int32_t l2ptr2
Initial value 9.
Definition private/lpc10.h:92
lpc10_encode_state_s::lbve
int32_t lbve
???
Definition private/lpc10.h:108
lpc10_encode_state_s::sfbue
int32_t sfbue
???
Definition private/lpc10.h:118
lpc10_encode_state_s::lasti
int32_t lasti
No initial value necessary.
Definition private/lpc10.h:94
lpc10_encode_state_s::n
float n
???
Definition private/lpc10.h:80
lpc10_encode_state_s::s
float s[60]
???
Definition private/lpc10.h:126
lpc10_encode_state_s::pebuf
float pebuf[LPC10_SAMPLES_PER_FRAME *3]
???
Definition private/lpc10.h:52
lpc10_encode_state_s::voibuf
int32_t voibuf[4][2]
???
Definition private/lpc10.h:70
lpc10_encode_state_s::alphax
float alphax
???
Definition private/lpc10.h:132
lpc10_encode_state_s::maxmin
float maxmin
???
Definition private/lpc10.h:104
lpc10_encode_state_s::zpre
float zpre
???
Definition private/lpc10.h:76
lpc10_encode_state_s::l2sum1
float l2sum1
???
Definition private/lpc10.h:88
lpc10_encode_state_s::olbue
int32_t olbue
???
Definition private/lpc10.h:120
lpc10_encode_state_s::z12
float z12
???
Definition private/lpc10.h:44
lpc10_encode_state_s::osbuf
int32_t osbuf[10]
No initial value necessary.
Definition private/lpc10.h:60
lpc10_encode_state_s::z22
float z22
???
Definition private/lpc10.h:46
lpc10_encode_state_s::l2ptr1
int32_t l2ptr1
Initial value 1.
Definition private/lpc10.h:90
lpc10_encode_state_s::fbue
int32_t fbue
???
Definition private/lpc10.h:114
lpc10_encode_state_s::rmsbuf
float rmsbuf[3]
???
Definition private/lpc10.h:72
lpc10_encode_state_s::error_correction
int error_correction
???
Definition private/lpc10.h:36
lpc10_encode_state_s::p
int32_t p[2][60]
???
Definition private/lpc10.h:128
lpc10_encode_state_s::ivbuf
float ivbuf[312]
???
Definition private/lpc10.h:56
lpc10_encode_state_s::ofbue
int32_t ofbue
???
Definition private/lpc10.h:116
lpc10_encode_state_s::isync
int32_t isync
???
Definition private/lpc10.h:136
lpc10_encode_state_s::fbve
int32_t fbve
???
Definition private/lpc10.h:112
lpc10_encode_state_s::d__
float d__
Initial value 1.0f.
Definition private/lpc10.h:82
lpc10_encode_state_s::z21
float z21
???
Definition private/lpc10.h:42
lpc10_encode_state_s::rcbuf
float rcbuf[3][10]
???
Definition private/lpc10.h:74
lpc10_encode_state_s::vwin
int32_t vwin[3][2]
Initial value vwin[2][0] = 307; vwin[2][1] = 462;.
Definition private/lpc10.h:66
lpc10_encode_state_s::awin
int32_t awin[3][2]
Initial value awin[2][0] = 307; awin[2][1] = 462;.
Definition private/lpc10.h:68
lpc10_encode_state_s::l2buf
float l2buf[16]
???
Definition private/lpc10.h:86
lpc10_encode_state_s::voice
float voice[3][2]
Initial value is probably unnecessary.
Definition private/lpc10.h:106
lpc10_encode_state_s::lpbuf
float lpbuf[696]
???
Definition private/lpc10.h:54
lpc10_encode_state_s::hyst
int hyst
Initial value FALSE.
Definition private/lpc10.h:96
lpc10_encode_state_s::obound
int32_t obound[3]
???
Definition private/lpc10.h:64
lpc10_encode_state_s::fpc
float fpc
No initial value necessary.
Definition private/lpc10.h:84
lpc10_encode_state_s::osptr
int32_t osptr
Initial value 1.
Definition private/lpc10.h:62