OLD | NEW |
1 /* Copyright (c) 2009-2010 Xiph.Org Foundation | 1 /* Copyright (c) 2009-2010 Xiph.Org Foundation |
2 Written by Jean-Marc Valin */ | 2 Written by Jean-Marc Valin */ |
3 /* | 3 /* |
4 Redistribution and use in source and binary forms, with or without | 4 Redistribution and use in source and binary forms, with or without |
5 modification, are permitted provided that the following conditions | 5 modification, are permitted provided that the following conditions |
6 are met: | 6 are met: |
7 | 7 |
8 - Redistributions of source code must retain the above copyright | 8 - Redistributions of source code must retain the above copyright |
9 notice, this list of conditions and the following disclaimer. | 9 notice, this list of conditions and the following disclaimer. |
10 | 10 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 RESTORE_STACK; | 219 RESTORE_STACK; |
220 #endif | 220 #endif |
221 } | 221 } |
222 | 222 |
223 int _celt_autocorr( | 223 int _celt_autocorr( |
224 const opus_val16 *x, /* in: [0...n-1] samples x */ | 224 const opus_val16 *x, /* in: [0...n-1] samples x */ |
225 opus_val32 *ac, /* out: [0...lag-1] ac values */ | 225 opus_val32 *ac, /* out: [0...lag-1] ac values */ |
226 const opus_val16 *window, | 226 const opus_val16 *window, |
227 int overlap, | 227 int overlap, |
228 int lag, | 228 int lag, |
229 int n | 229 int n, |
| 230 int arch |
230 ) | 231 ) |
231 { | 232 { |
232 opus_val32 d; | 233 opus_val32 d; |
233 int i, k; | 234 int i, k; |
234 int fastN=n-lag; | 235 int fastN=n-lag; |
235 int shift; | 236 int shift; |
236 const opus_val16 *xptr; | 237 const opus_val16 *xptr; |
237 VARDECL(opus_val16, xx); | 238 VARDECL(opus_val16, xx); |
238 SAVE_STACK; | 239 SAVE_STACK; |
239 ALLOC(xx, n, opus_val16); | 240 ALLOC(xx, n, opus_val16); |
(...skipping 28 matching lines...) Expand all Loading... |
268 shift = (shift)/2; | 269 shift = (shift)/2; |
269 if (shift>0) | 270 if (shift>0) |
270 { | 271 { |
271 for(i=0;i<n;i++) | 272 for(i=0;i<n;i++) |
272 xx[i] = PSHR32(xptr[i], shift); | 273 xx[i] = PSHR32(xptr[i], shift); |
273 xptr = xx; | 274 xptr = xx; |
274 } else | 275 } else |
275 shift = 0; | 276 shift = 0; |
276 } | 277 } |
277 #endif | 278 #endif |
278 celt_pitch_xcorr(xptr, xptr, ac, fastN, lag+1); | 279 celt_pitch_xcorr(xptr, xptr, ac, fastN, lag+1, arch); |
279 for (k=0;k<=lag;k++) | 280 for (k=0;k<=lag;k++) |
280 { | 281 { |
281 for (i = k+fastN, d = 0; i < n; i++) | 282 for (i = k+fastN, d = 0; i < n; i++) |
282 d = MAC16_16(d, xptr[i], xptr[i-k]); | 283 d = MAC16_16(d, xptr[i], xptr[i-k]); |
283 ac[k] += d; | 284 ac[k] += d; |
284 } | 285 } |
285 #ifdef FIXED_POINT | 286 #ifdef FIXED_POINT |
286 shift = 2*shift; | 287 shift = 2*shift; |
287 if (shift<=0) | 288 if (shift<=0) |
288 ac[0] += SHL32((opus_int32)1, -shift); | 289 ac[0] += SHL32((opus_int32)1, -shift); |
(...skipping 10 matching lines...) Expand all Loading... |
299 shift2++; | 300 shift2++; |
300 for (i=0;i<=lag;i++) | 301 for (i=0;i<=lag;i++) |
301 ac[i] = SHR32(ac[i], shift2); | 302 ac[i] = SHR32(ac[i], shift2); |
302 shift += shift2; | 303 shift += shift2; |
303 } | 304 } |
304 #endif | 305 #endif |
305 | 306 |
306 RESTORE_STACK; | 307 RESTORE_STACK; |
307 return shift; | 308 return shift; |
308 } | 309 } |
OLD | NEW |