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 14 matching lines...) Expand all Loading... |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
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 "platform/audio/Biquad.h" | 29 #include "platform/audio/Biquad.h" |
30 | 30 |
31 #include "platform/audio/AudioUtilities.h" | 31 #include "platform/audio/AudioUtilities.h" |
32 #include "platform/audio/DenormalDisabler.h" | 32 #include "platform/audio/DenormalDisabler.h" |
33 #include "wtf/MathExtras.h" | 33 #include "wtf/MathExtras.h" |
34 | 34 |
| 35 #include <stdio.h> |
35 #include <algorithm> | 36 #include <algorithm> |
36 #include <complex> | 37 #include <complex> |
37 #include <stdio.h> | |
38 #if OS(MACOSX) | 38 #if OS(MACOSX) |
39 #include <Accelerate/Accelerate.h> | 39 #include <Accelerate/Accelerate.h> |
40 #endif | 40 #endif |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 #if OS(MACOSX) | 44 #if OS(MACOSX) |
45 const int kBufferSize = 1024; | 45 const int kBufferSize = 1024; |
46 #endif | 46 #endif |
47 | 47 |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 std::complex<double> denominator = | 579 std::complex<double> denominator = |
580 std::complex<double>(1, 0) + (a1 + a2 * z) * z; | 580 std::complex<double>(1, 0) + (a1 + a2 * z) * z; |
581 std::complex<double> response = numerator / denominator; | 581 std::complex<double> response = numerator / denominator; |
582 magResponse[k] = static_cast<float>(abs(response)); | 582 magResponse[k] = static_cast<float>(abs(response)); |
583 phaseResponse[k] = | 583 phaseResponse[k] = |
584 static_cast<float>(atan2(imag(response), real(response))); | 584 static_cast<float>(atan2(imag(response), real(response))); |
585 } | 585 } |
586 } | 586 } |
587 | 587 |
588 } // namespace blink | 588 } // namespace blink |
OLD | NEW |