comparison libgsmefr/dec_12k2.c @ 189:7dd6336e15b2

libgsmefr/dec_12k2.c: perf opt
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 03 Jan 2023 03:58:56 +0000
parents d80e9f12a1d1
children
comparison
equal deleted inserted replaced
188:9b07190a6d08 189:7dd6336e15b2
128 128
129 /* Set state machine */ 129 /* Set state machine */
130 130
131 if (bfi != 0) 131 if (bfi != 0)
132 { 132 {
133 st->bf_state = add (st->bf_state, 1); 133 st->bf_state++;
134 } 134 }
135 else if (sub (st->bf_state, 6) == 0) 135 else if (st->bf_state == 6)
136 { 136 {
137 st->bf_state = 5; 137 st->bf_state = 5;
138 } 138 }
139 else 139 else
140 { 140 {
141 st->bf_state = 0; 141 st->bf_state = 0;
142 } 142 }
143 143
144 if (sub (st->bf_state, 6) > 0) 144 if (st->bf_state > 6)
145 { 145 {
146 st->bf_state = 6; 146 st->bf_state = 6;
147 } 147 }
148 rx_dtx (st, TAF, bfi, SID_flag); 148 rx_dtx (st, TAF, bfi, SID_flag);
149 149
279 } 279 }
280 280
281 /* post processing of excitation elements */ 281 /* post processing of excitation elements */
282 282
283 test (); /* This test is not passed when SP_FLAG is 0 */ 283 test (); /* This test is not passed when SP_FLAG is 0 */
284 if (sub (pit_sharp, 16384) > 0) 284 if (pit_sharp > 16384)
285 { 285 {
286 for (i = 0; i < L_SUBFR; i++) 286 for (i = 0; i < L_SUBFR; i++)
287 { 287 {
288 temp = mult (exc[i + i_subfr], pit_sharp); 288 temp = mult (exc[i + i_subfr], pit_sharp);
289 L_temp = L_mult (temp, gain_pit); 289 L_temp = L_mult (temp, gain_pit);
315 315
316 exc[i + i_subfr] = round (L_temp); 316 exc[i + i_subfr] = round (L_temp);
317 move16 (); 317 move16 ();
318 } 318 }
319 319
320 if (sub (pit_sharp, 16384) > 0) 320 if (pit_sharp > 16384)
321 { 321 {
322 for (i = 0; i < L_SUBFR; i++) 322 for (i = 0; i < L_SUBFR; i++)
323 { 323 {
324 excp[i] = add (excp[i], exc[i + i_subfr]); 324 excp[i] = add (excp[i], exc[i + i_subfr]);
325 } 325 }