Asterisk - The Open Source Telephony Project  18.5.0
Macros | Functions | Variables
lpcdec.c File Reference
#include "f2c.h"
Include dependency graph for lpcdec.c:

Go to the source code of this file.

Macros

#define contrl_1   contrl_
 

Functions

int initlpcdec_ (void)
 
int lpc10_decode (integer *bits, real *speech, struct lpc10_decoder_state *st)
 
int lpcdec_ (integer *bits, real *speech)
 

Variables

static integer c__10 = 10
 
struct {
   logical   corrp
 
   integer   lframe
 
   integer   order
 
contrl_
 

Macro Definition Documentation

◆ contrl_1

#define contrl_1   contrl_

Definition at line 58 of file lpcdec.c.

Function Documentation

◆ initlpcdec_()

int initlpcdec_ ( void  )

◆ lpc10_decode()

int lpc10_decode ( integer bits,
real speech,
struct lpc10_decoder_state st 
)

Definition at line 113 of file lpcdec.c.

References c__10, chanrd_(), decode_(), len(), and synths_().

Referenced by lpc10tolin_framein().

115 {
116  integer irms, voice[2], pitch, ipitv;
117  extern /* Subroutine */ int decode_(integer *, integer *, integer *,
118  integer *, integer *, real *, real *, struct lpc10_decoder_state *);
119  real rc[10];
120  extern /* Subroutine */ int chanrd_(integer *, integer *, integer *,
121  integer *, integer *), synths_(integer *,
122  integer *, real *, real *, real *, integer *,
123  struct lpc10_decoder_state *);
124  integer irc[10], len;
125  real rms;
126 
127 /* $Log$
128  * Revision 1.15 2004/06/26 03:50:14 markster
129  * Merge source cleanups (bug #1911)
130  *
131  * Revision 1.14 2003/02/12 13:59:15 matteo
132  * mer feb 12 14:56:57 CET 2003
133  *
134  * Revision 1.1.1.1 2003/02/12 13:59:15 matteo
135  * mer feb 12 14:56:57 CET 2003
136  *
137  * Revision 1.2 2000/01/05 08:20:39 markster
138  * Some OSS fixes and a few lpc changes to make it actually work
139  *
140  * Revision 1.2 1996/08/20 20:30:11 jaf
141  * Removed all static local variables that were SAVE'd in the Fortran
142  * code, and put them in struct lpc10_encoder_state that is passed as an
143  * argument.
144  *
145  * Removed init function, since all initialization is now done in
146  * init_lpc10_encoder_state().
147  *
148  * Changed name of function from lpcenc_ to lpc10_encode, simply to make
149  * all lpc10 functions have more consistent naming with each other.
150  *
151  * Revision 1.1 1996/08/19 22:31:48 jaf
152  * Initial revision
153  * */
154 /* Revision 1.3 1996/03/29 22:03:47 jaf */
155 /* Removed definitions for any constants that were no longer used. */
156 
157 /* Revision 1.2 1996/03/26 19:34:33 jaf */
158 /* Added comments indicating which constants are not needed in an */
159 /* application that uses the LPC-10 coder. */
160 
161 /* Revision 1.1 1996/02/07 14:43:51 jaf */
162 /* Initial revision */
163 
164 /* LPC Configuration parameters: */
165 /* Frame size, Prediction order, Pitch period */
166 /* Arguments */
167 /* $Log$
168  * Revision 1.15 2004/06/26 03:50:14 markster
169  * Merge source cleanups (bug #1911)
170  *
171  * Revision 1.14 2003/02/12 13:59:15 matteo
172  * mer feb 12 14:56:57 CET 2003
173  *
174  * Revision 1.1.1.1 2003/02/12 13:59:15 matteo
175  * mer feb 12 14:56:57 CET 2003
176  *
177  * Revision 1.2 2000/01/05 08:20:39 markster
178  * Some OSS fixes and a few lpc changes to make it actually work
179  *
180  * Revision 1.2 1996/08/20 20:30:11 jaf
181  * Removed all static local variables that were SAVE'd in the Fortran
182  * code, and put them in struct lpc10_encoder_state that is passed as an
183  * argument.
184  *
185  * Removed init function, since all initialization is now done in
186  * init_lpc10_encoder_state().
187  *
188  * Changed name of function from lpcenc_ to lpc10_encode, simply to make
189  * all lpc10 functions have more consistent naming with each other.
190  *
191  * Revision 1.1 1996/08/19 22:31:48 jaf
192  * Initial revision
193  * */
194 /* Revision 1.3 1996/03/29 22:05:55 jaf */
195 /* Commented out the common block variables that are not needed by the */
196 /* embedded version. */
197 
198 /* Revision 1.2 1996/03/26 19:34:50 jaf */
199 /* Added comments indicating which constants are not needed in an */
200 /* application that uses the LPC-10 coder. */
201 
202 /* Revision 1.1 1996/02/07 14:44:09 jaf */
203 /* Initial revision */
204 
205 /* LPC Processing control variables: */
206 
207 /* *** Read-only: initialized in setup */
208 
209 /* Files for Speech, Parameter, and Bitstream Input & Output, */
210 /* and message and debug outputs. */
211 
212 /* Here are the only files which use these variables: */
213 
214 /* lpcsim.f setup.f trans.f error.f vqsetup.f */
215 
216 /* Many files which use fdebug are not listed, since it is only used in */
217 /* those other files conditionally, to print trace statements. */
218 /* integer fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
219 /* LPC order, Frame size, Quantization rate, Bits per frame, */
220 /* Error correction */
221 /* Subroutine SETUP is the only place where order is assigned a value, */
222 /* and that value is 10. It could increase efficiency 1% or so to */
223 /* declare order as a constant (i.e., a Fortran PARAMETER) instead of as
224 */
225 /* a variable in a COMMON block, since it is used in many places in the */
226 /* core of the coding and decoding routines. Actually, I take that back.
227 */
228 /* At least when compiling with f2c, the upper bound of DO loops is */
229 /* stored in a local variable before the DO loop begins, and then that is
230 */
231 /* compared against on each iteration. */
232 /* Similarly for lframe, which is given a value of MAXFRM in SETUP. */
233 /* Similarly for quant, which is given a value of 2400 in SETUP. quant */
234 /* is used in only a few places, and never in the core coding and */
235 /* decoding routines, so it could be eliminated entirely. */
236 /* nbits is similar to quant, and is given a value of 54 in SETUP. */
237 /* corrp is given a value of .TRUE. in SETUP, and is only used in the */
238 /* subroutines ENCODE and DECODE. It doesn't affect the speed of the */
239 /* coder significantly whether it is .TRUE. or .FALSE., or whether it is
240 */
241 /* a constant or a variable, since it is only examined once per frame. */
242 /* Leaving it as a variable that is set to .TRUE. seems like a good */
243 /* idea, since it does enable some error-correction capability for */
244 /* unvoiced frames, with no change in the coding rate, and no noticeable
245 */
246 /* quality difference in the decoded speech. */
247 /* integer quant, nbits */
248 /* *** Read/write: variables for debugging, not needed for LPC algorithm
249 */
250 
251 /* Current frame, Unstable frames, Output clip count, Max onset buffer,
252 */
253 /* Debug listing detail level, Line count on listing page */
254 
255 /* nframe is not needed for an embedded LPC10 at all. */
256 /* nunsfm is initialized to 0 in SETUP, and incremented in subroutine */
257 /* ERROR, which is only called from RCCHK. When LPC10 is embedded into */
258 /* an application, I would recommend removing the call to ERROR in RCCHK,
259 */
260 /* and remove ERROR and nunsfm completely. */
261 /* iclip is initialized to 0 in SETUP, and incremented in entry SWRITE in
262 */
263 /* sread.f. When LPC10 is embedded into an application, one might want */
264 /* to cause it to be incremented in a routine that takes the output of */
265 /* SYNTHS and sends it to an audio device. It could be optionally */
266 /* displayed, for those that might want to know what it is. */
267 /* maxosp is never initialized to 0 in SETUP, although it probably should
268 */
269 /* be, and it is updated in subroutine ANALYS. I doubt that its value */
270 /* would be of much interest to an application in which LPC10 is */
271 /* embedded. */
272 /* listl and lincnt are not needed for an embedded LPC10 at all. */
273 /* integer nframe, nunsfm, iclip, maxosp, listl, lincnt */
274 /* common /contrl/ fsi, fso, fpi, fpo, fbi, fbo, pbin, fmsg, fdebug */
275 /* common /contrl/ quant, nbits */
276 /* common /contrl/ nframe, nunsfm, iclip, maxosp, listl, lincnt */
277 /* Local variables that need not be saved */
278 /* Uncoded speech parameters */
279 /* Coded speech parameters */
280 /* Others */
281 /* Local state */
282 /* None */
283  /* Parameter adjustments */
284  if (bits) {
285  --bits;
286  }
287  if (speech) {
288  --speech;
289  }
290 
291  /* Function Body */
292 
293  chanrd_(&c__10, &ipitv, &irms, irc, &bits[1]);
294  decode_(&ipitv, &irms, irc, voice, &pitch, &rms, rc, st);
295  synths_(voice, &pitch, &rms, rc, &speech[1], &len, st);
296  return 0;
297 } /* lpcdec_ */
int decode_(integer *ipitv, integer *irms, integer *irc, integer *voice, integer *pitch, real *rms, real *rc, struct lpc10_decoder_state *st)
Definition: lpc10/decode.c:147
int chanrd_(integer *order, integer *ipitv, integer *irms, integer *irc, integer *ibits)
Definition: chanwr.c:229
int synths_(integer *voice, integer *pitch, real *rms, real *rc, real *speech, integer *k, struct lpc10_decoder_state *st)
Definition: synths.c:170
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
float real
Definition: lpc10.h:79
real voice[6]
Definition: lpc10.h:121
static integer c__10
Definition: lpcdec.c:62
INT32 integer
Definition: lpc10.h:80

◆ lpcdec_()

int lpcdec_ ( integer bits,
real speech 
)

Variable Documentation

◆ c__10

integer c__10 = 10
static

Definition at line 62 of file lpcdec.c.

Referenced by lpc10_decode().

◆ contrl_

struct { ... } contrl_

◆ corrp

logical corrp

Definition at line 55 of file lpcdec.c.

◆ lframe

integer lframe

Definition at line 54 of file lpcdec.c.

◆ order

integer order

Definition at line 54 of file lpcdec.c.