FreeCalypso > hg > gsm-codec-lib
comparison libgsmefr/q_gains.c @ 200:33487966077e
libgsmefr/q_gains.c: perf opt
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 04 Jan 2023 04:42:28 +0000 |
parents | 03599300d2db |
children |
comparison
equal
deleted
inserted
replaced
199:b4531e7227ca | 200:33487966077e |
---|---|
36 for (i = 1; i < NB_QUA_PITCH; i++) | 36 for (i = 1; i < NB_QUA_PITCH; i++) |
37 { | 37 { |
38 err = abs_s (sub (gain_q14, qua_gain_pitch[i])); | 38 err = abs_s (sub (gain_q14, qua_gain_pitch[i])); |
39 | 39 |
40 test (); | 40 test (); |
41 if (sub (err, err_min) < 0) | 41 if (err < err_min) |
42 { | 42 { |
43 err_min = err; move16 (); | 43 err_min = err; move16 (); |
44 index = i; move16 (); | 44 index = i; move16 (); |
45 } | 45 } |
46 } | 46 } |
126 for (i = 1; i < NB_QUA_CODE; i++) | 126 for (i = 1; i < NB_QUA_CODE; i++) |
127 { | 127 { |
128 err = abs_s (sub (*gain, mult (gcode0, qua_gain_code[i]))); | 128 err = abs_s (sub (*gain, mult (gcode0, qua_gain_code[i]))); |
129 | 129 |
130 test (); | 130 test (); |
131 if (sub (err, err_min) < 0) | 131 if (err < err_min) |
132 { | 132 { |
133 err_min = err; move16 (); | 133 err_min = err; move16 (); |
134 index = i; move16 (); | 134 index = i; move16 (); |
135 } | 135 } |
136 } | 136 } |
182 for (i = 1; i < NB_QUA_CODE; i++) | 182 for (i = 1; i < NB_QUA_CODE; i++) |
183 { | 183 { |
184 err = abs_s (sub (aver_gain, | 184 err = abs_s (sub (aver_gain, |
185 mult (st->gcode0_CN, qua_gain_code[i]))); | 185 mult (st->gcode0_CN, qua_gain_code[i]))); |
186 | 186 |
187 if (sub (err, err_min) < 0) | 187 if (err < err_min) |
188 { | 188 { |
189 err_min = err; move16 (); | 189 err_min = err; move16 (); |
190 index = i; move16 (); | 190 index = i; move16 (); |
191 } | 191 } |
192 } | 192 } |