OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 15 matching lines...) Expand all Loading... |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #include "config.h" | 29 #include "config.h" |
30 | 30 |
31 #if ENABLE(WEB_AUDIO) | 31 #if ENABLE(WEB_AUDIO) |
32 | 32 |
33 #include "platform/audio/FFTFrame.h" | 33 #include "platform/audio/FFTFrame.h" |
34 | 34 |
35 #include "platform/audio/VectorMath.h" | 35 #include "platform/audio/VectorMath.h" |
| 36 #include "platform/Logging.h" |
| 37 #include "wtf/Complex.h" |
| 38 #include "wtf/MathExtras.h" |
| 39 #include "wtf/OwnPtr.h" |
36 | 40 |
37 #ifndef NDEBUG | 41 #ifndef NDEBUG |
38 #include <stdio.h> | 42 #include <stdio.h> |
39 #endif | 43 #endif |
40 | 44 |
41 #include "platform/Logging.h" | |
42 #include "wtf/Complex.h" | |
43 #include "wtf/MathExtras.h" | |
44 #include "wtf/OwnPtr.h" | |
45 | |
46 namespace blink { | 45 namespace blink { |
47 | 46 |
48 void FFTFrame::doPaddedFFT(const float* data, size_t dataSize) | 47 void FFTFrame::doPaddedFFT(const float* data, size_t dataSize) |
49 { | 48 { |
50 // Zero-pad the impulse response | 49 // Zero-pad the impulse response |
51 AudioFloatArray paddedResponse(fftSize()); // zero-initialized | 50 AudioFloatArray paddedResponse(fftSize()); // zero-initialized |
52 paddedResponse.copyToRange(data, 0, dataSize); | 51 paddedResponse.copyToRange(data, 0, dataSize); |
53 | 52 |
54 // Get the frequency-domain version of padded response | 53 // Get the frequency-domain version of padded response |
55 doFFT(paddedResponse.data()); | 54 doFFT(paddedResponse.data()); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 | 287 |
289 WTF_LOG(WebAudio, "[%d] (%f %f)\n", i, mag, phase); | 288 WTF_LOG(WebAudio, "[%d] (%f %f)\n", i, mag, phase); |
290 } | 289 } |
291 WTF_LOG(WebAudio, "****\n"); | 290 WTF_LOG(WebAudio, "****\n"); |
292 } | 291 } |
293 #endif // NDEBUG | 292 #endif // NDEBUG |
294 | 293 |
295 } // namespace blink | 294 } // namespace blink |
296 | 295 |
297 #endif // ENABLE(WEB_AUDIO) | 296 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |