Properly play a holdtime message if the announce-holdtime option is
[asterisk-bristuff.git] / codecs / lpc10 / irc2pc.c
blobb96ff0d66dd894f22469f59bee18faa09aa8b66f
1 /*
3 $Log$
4 Revision 1.15 2004/06/26 03:50:14 markster
5 Merge source cleanups (bug #1911)
7 Revision 1.14 2003/02/12 13:59:15 matteo
8 mer feb 12 14:56:57 CET 2003
10 Revision 1.1.1.1 2003/02/12 13:59:15 matteo
11 mer feb 12 14:56:57 CET 2003
13 Revision 1.2 2000/01/05 08:20:39 markster
14 Some OSS fixes and a few lpc changes to make it actually work
16 * Revision 1.1 1996/08/19 22:31:56 jaf
17 * Initial revision
22 /* -- translated by f2c (version 19951025).
23 You must link the resulting object file with the libraries:
24 -lf2c -lm (in that order)
27 #include "f2c.h"
29 #ifdef P_R_O_T_O_T_Y_P_E_S
30 extern int irc2pc_(real *rc, real *pc, integer *order, real *gprime, real *g2pass);
31 #endif
33 /* ***************************************************************** */
35 /* IRC2PC Version 48 */
37 /* $Log$
38 * Revision 1.15 2004/06/26 03:50:14 markster
39 * Merge source cleanups (bug #1911)
41 * Revision 1.14 2003/02/12 13:59:15 matteo
42 * mer feb 12 14:56:57 CET 2003
44 * Revision 1.1.1.1 2003/02/12 13:59:15 matteo
45 * mer feb 12 14:56:57 CET 2003
47 * Revision 1.2 2000/01/05 08:20:39 markster
48 * Some OSS fixes and a few lpc changes to make it actually work
50 * Revision 1.1 1996/08/19 22:31:56 jaf
51 * Initial revision
52 * */
53 /* Revision 1.3 1996/03/20 15:47:19 jaf */
54 /* Added comments about which indices of array arguments are read or */
55 /* written. */
57 /* Revision 1.2 1996/03/14 16:59:04 jaf */
58 /* Comments added explaining that none of the local variables of this */
59 /* subroutine need to be saved from one invocation to the next. */
61 /* Revision 1.1 1996/02/07 14:47:27 jaf */
62 /* Initial revision */
65 /* ***************************************************************** */
67 /* Convert Reflection Coefficients to Predictor Coeficients */
69 /* Inputs: */
70 /* RC - Reflection coefficients */
71 /* Indices 1 through ORDER read. */
72 /* ORDER - Number of RC's */
73 /* GPRIME - Excitation modification gain */
74 /* Outputs: */
75 /* PC - Predictor coefficients */
76 /* Indices 1 through ORDER written. */
77 /* Indices 1 through ORDER-1 are read after being written. */
78 /* G2PASS - Excitation modification sharpening factor */
80 /* This subroutine has no local state. */
82 /* Subroutine */ int irc2pc_(real *rc, real *pc, integer *order, real *gprime,
83 real *g2pass)
85 /* System generated locals */
86 integer i__1, i__2;
88 /* Builtin functions */
89 double sqrt(doublereal);
91 /* Local variables */
92 real temp[10];
93 integer i__, j;
95 /* Arguments */
96 /* $Log$
97 * Revision 1.15 2004/06/26 03:50:14 markster
98 * Merge source cleanups (bug #1911)
100 * Revision 1.14 2003/02/12 13:59:15 matteo
101 * mer feb 12 14:56:57 CET 2003
103 * Revision 1.1.1.1 2003/02/12 13:59:15 matteo
104 * mer feb 12 14:56:57 CET 2003
106 * Revision 1.2 2000/01/05 08:20:39 markster
107 * Some OSS fixes and a few lpc changes to make it actually work
109 * Revision 1.1 1996/08/19 22:31:56 jaf
110 * Initial revision
111 * */
112 /* Revision 1.3 1996/03/29 22:03:47 jaf */
113 /* Removed definitions for any constants that were no longer used. */
115 /* Revision 1.2 1996/03/26 19:34:33 jaf */
116 /* Added comments indicating which constants are not needed in an */
117 /* application that uses the LPC-10 coder. */
119 /* Revision 1.1 1996/02/07 14:43:51 jaf */
120 /* Initial revision */
122 /* LPC Configuration parameters: */
123 /* Frame size, Prediction order, Pitch period */
124 /* Local variables that need not be saved */
125 /* Parameter adjustments */
126 --pc;
127 --rc;
129 /* Function Body */
130 *g2pass = 1.f;
131 i__1 = *order;
132 for (i__ = 1; i__ <= i__1; ++i__) {
133 *g2pass *= 1.f - rc[i__] * rc[i__];
135 *g2pass = *gprime * (real)sqrt(*g2pass);
136 pc[1] = rc[1];
137 i__1 = *order;
138 for (i__ = 2; i__ <= i__1; ++i__) {
139 i__2 = i__ - 1;
140 for (j = 1; j <= i__2; ++j) {
141 temp[j - 1] = pc[j] - rc[i__] * pc[i__ - j];
143 i__2 = i__ - 1;
144 for (j = 1; j <= i__2; ++j) {
145 pc[j] = temp[j - 1];
147 pc[i__] = rc[i__];
149 return 0;
150 } /* irc2pc_ */