3 * Revision 1.2 1996/08/20 20:31:21 jaf
4 * Removed all static local variables that were SAVE'd in the Fortran
5 * code, and put them in struct lpc10_encoder_state that is passed as an
8 * Removed init function, since all initialization is now done in
9 * init_lpc10_encoder_state().
11 * Changed name of function from lpcenc_ to lpc10_encode, simply to make
12 * all lpc10 functions have more consistent naming with each other.
14 * Revision 1.1 1996/08/19 22:31:44 jaf
20 /* -- translated by f2c (version 19951025).
21 You must link the resulting object file with the libraries:
22 -lf2c -lm (in that order)
27 extern int lpcenc_(real
*speech
, integer
*bits
);
28 extern int initlpcenc_(void);
30 /* Table of constant values */
32 static integer c__180
= 180;
33 static integer c__10
= 10;
35 /* ***************************************************************** */
38 * Revision 1.2 1996/08/20 20:31:21 jaf
39 * Removed all static local variables that were SAVE'd in the Fortran
40 * code, and put them in struct lpc10_encoder_state that is passed as an
43 * Removed init function, since all initialization is now done in
44 * init_lpc10_encoder_state().
46 * Changed name of function from lpcenc_ to lpc10_encode, simply to make
47 * all lpc10 functions have more consistent naming with each other.
49 * Revision 1.1 1996/08/19 22:31:44 jaf
52 /* Revision 1.2 1996/03/28 00:01:22 jaf */
53 /* Commented out some trace statements. */
55 /* Revision 1.1 1996/03/28 00:00:27 jaf */
56 /* Initial revision */
59 /* ***************************************************************** */
61 /* Encode one frame of 180 speech samples to 54 bits. */
64 /* SPEECH - Speech encoded as real values in the range [-1,+1]. */
65 /* Indices 1 through 180 read, and modified (by PREPRO). */
67 /* BITS - 54 encoded bits, stored 1 per array element. */
68 /* Indices 1 through 54 written. */
70 /* This subroutine maintains local state from one call to the next. If */
71 /* you want to switch to using a new audio stream for this filter, or */
72 /* reinitialize its state for any other reason, call the ENTRY */
75 /* Subroutine */ int lpc10_encode(real
*speech
, integer
*bits
,
76 struct lpc10_encoder_state
*st
)
78 integer irms
, voice
[2], pitch
, ipitv
;
80 extern /* Subroutine */ int encode_(integer
*, integer
*, real
*, real
*,
81 integer
*, integer
*, integer
*), chanwr_(integer
*, integer
*,
82 integer
*, integer
*, integer
*, struct lpc10_encoder_state
*),
83 analys_(real
*, integer
*,
84 integer
*, real
*, real
*, struct lpc10_encoder_state
*),
85 prepro_(real
*, integer
*, struct lpc10_encoder_state
*);
91 /* LPC Configuration parameters: */
92 /* Frame size, Prediction order, Pitch period */
93 /* Local variables that need not be saved */
94 /* Uncoded speech parameters */
95 /* Coded speech parameters */
98 /* Parameter adjustments */
107 prepro_(&speech
[1], &c__180
, st
);
108 analys_(&speech
[1], voice
, &pitch
, &rms
, rc
, st
);
109 encode_(voice
, &pitch
, &rms
, rc
, &ipitv
, &irms
, irc
);
110 chanwr_(&c__10
, &ipitv
, &irms
, irc
, &bits
[1], st
);