FreeCalypso > hg > gsm-codec-lib
comparison libgsmefr/pitch_f6.c @ 198:d714168fb6dc
libgsmefr/pitch_f6.c: perf opt
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 04 Jan 2023 04:10:35 +0000 |
parents | e0e53bfe1a8a |
children |
comparison
equal
deleted
inserted
replaced
197:bcd337afa0f1 | 198:d714168fb6dc |
---|---|
68 lag = t0_min; move16 (); | 68 lag = t0_min; move16 (); |
69 | 69 |
70 for (i = t0_min + 1; i <= t0_max; i++) | 70 for (i = t0_min + 1; i <= t0_max; i++) |
71 { | 71 { |
72 test (); | 72 test (); |
73 if (sub (corr[i], max) >= 0) | 73 if (corr[i] >= max) |
74 { | 74 { |
75 max = corr[i]; move16 (); | 75 max = corr[i]; move16 (); |
76 lag = i; move16 (); | 76 lag = i; move16 (); |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 /* If first subframe and lag > 94 do not search fractional pitch */ | 80 /* If first subframe and lag > 94 do not search fractional pitch */ |
81 | 81 |
82 test (); test (); | 82 test (); test (); |
83 if ((i_subfr == 0) && (sub (lag, 94) > 0)) | 83 if ((i_subfr == 0) && (lag > 94)) |
84 { | 84 { |
85 *pit_frac = 0; move16 (); | 85 *pit_frac = 0; move16 (); |
86 return (lag); | 86 return (lag); |
87 } | 87 } |
88 /* Test the fractions around T0 and choose the one which maximizes */ | 88 /* Test the fractions around T0 and choose the one which maximizes */ |
93 | 93 |
94 for (i = -2; i <= 3; i++) | 94 for (i = -2; i <= 3; i++) |
95 { | 95 { |
96 corr_int = Interpol_6 (&corr[lag], i); move16 (); | 96 corr_int = Interpol_6 (&corr[lag], i); move16 (); |
97 test (); | 97 test (); |
98 if (sub (corr_int, max) > 0) | 98 if (corr_int > max) |
99 { | 99 { |
100 max = corr_int; move16 (); | 100 max = corr_int; move16 (); |
101 frac = i; move16 (); | 101 frac = i; move16 (); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 /* Limit the fraction value in the interval [-2,-1,0,1,2,3] */ | 105 /* Limit the fraction value in the interval [-2,-1,0,1,2,3] */ |
106 | 106 |
107 test (); | 107 test (); |
108 if (sub (frac, -3) == 0) | 108 if (frac == -3) |
109 { | 109 { |
110 frac = 3; move16 (); | 110 frac = 3; move16 (); |
111 lag = sub (lag, 1); | 111 lag = sub (lag, 1); |
112 } | 112 } |
113 *pit_frac = frac; move16 (); | 113 *pit_frac = frac; move16 (); |
163 for (j = 0; j < L_subfr; j++) | 163 for (j = 0; j < L_subfr; j++) |
164 { | 164 { |
165 s = L_mac (s, excf[j], excf[j]); | 165 s = L_mac (s, excf[j], excf[j]); |
166 } | 166 } |
167 test (); | 167 test (); |
168 if (L_sub (s, 67108864L) <= 0) /* if (s <= 2^26) */ | 168 if (s <= 67108864L) /* if (s <= 2^26) */ |
169 { | 169 { |
170 s_excf = excf; move16 (); | 170 s_excf = excf; move16 (); |
171 h_fac = 15 - 12; move16 (); | 171 h_fac = 15 - 12; move16 (); |
172 scaling = 0; move16 (); | 172 scaling = 0; move16 (); |
173 } | 173 } |
211 move16 (); | 211 move16 (); |
212 | 212 |
213 /* modify the filtered excitation excf[] for the next iteration */ | 213 /* modify the filtered excitation excf[] for the next iteration */ |
214 | 214 |
215 test (); | 215 test (); |
216 if (sub (i, t_max) != 0) | 216 if (i != t_max) |
217 { | 217 { |
218 k--; | 218 k--; |
219 for (j = L_subfr - 1; j > 0; j--) | 219 for (j = L_subfr - 1; j > 0; j--) |
220 { | 220 { |
221 s = L_mult (exc[k], h[j]); | 221 s = L_mult (exc[k], h[j]); |