30 {
32 {(float)0.00635, (float)0.003175, (float)0.0015875,
33 (float)0.00079375};
34 float step;
35 int step_idx;
36 int lsp_index;
41 float old_p, old_q, *old;
42 float *pq_coef;
43 float omega, old_omega;
44 int i;
45 float hlp, hlp1, hlp2, hlp3, hlp4, hlp5;
46
50 }
51
52 p_pre[0] = (float)-1.0 - p[0];
53 p_pre[1] = - p_pre[0] - p[1];
54 p_pre[2] = - p_pre[1] - p[2];
55 p_pre[3] = - p_pre[2] - p[3];
56 p_pre[4] = - p_pre[3] - p[4];
57 p_pre[4] = p_pre[4] / 2;
58
59 q_pre[0] = (float)1.0 - q[0];
60 q_pre[1] = q_pre[0] - q[1];
61 q_pre[2] = q_pre[1] - q[2];
62 q_pre[3] = q_pre[2] - q[3];
63 q_pre[4] = q_pre[3] - q[4];
64 q_pre[4] = q_pre[4] / 2;
65
66 omega = 0.0;
67
68
69
70
71
72 old_omega = 0.0;
73
76
77
78
79
81
82
83
84
85
86 if ((lsp_index & 0x1) == 0) {
87 pq_coef = p_pre;
88 old = &old_p;
89 } else {
90 pq_coef = q_pre;
91 old = &old_q;
92 }
93
94
95
96 for (step_idx = 0, step = steps[step_idx];
98
99
100
101
103 hlp1 = (float)2.0 * hlp + pq_coef[0];
104 hlp2 = (float)2.0 * hlp * hlp1 - (float)1.0 +
105 pq_coef[1];
106 hlp3 = (float)2.0 * hlp * hlp2 - hlp1 + pq_coef[2];
107 hlp4 = (float)2.0 * hlp * hlp3 - hlp2 + pq_coef[3];
108 hlp5 = hlp * hlp4 - hlp3 + pq_coef[4];
109
110
111 if (((hlp5 * (*old)) <= 0.0) || (omega >= 0.5)){
112
114
115 if (fabs(hlp5) >= fabs(*old)) {
116 freq[lsp_index] = omega - step;
117 } else {
118 freq[lsp_index] = omega;
119 }
120
121
122
123
124
125
126
127 if ((*old) >= 0.0){
129 } else {
131 }
132
133 omega = old_omega;
134 step_idx = 0;
135
137 } else {
138
139 if (step_idx == 0) {
140 old_omega = omega;
141 }
142
143 step_idx++;
144 omega -= steps[step_idx];
145
146
147
148 step = steps[step_idx];
149 }
150 } else {
151
152
153
154
155 *old = hlp5;
156 omega += step;
157 }
158 }
159 }
160
162 freq[i] = freq[i] *
TWO_PI;
163 }
164 }
#define LSF_NUMBER_OF_STEPS