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 "config.h" | 29 #include "config.h" |
30 | 30 |
31 #if ENABLE(WEB_AUDIO) | 31 #if ENABLE(WEB_AUDIO) |
32 | 32 |
33 #include "core/platform/audio/HRTFKernel.h" | 33 #include "core/platform/audio/HRTFKernel.h" |
34 | 34 |
35 #include "core/platform/FloatConversion.h" | |
36 #include "core/platform/audio/AudioChannel.h" | 35 #include "core/platform/audio/AudioChannel.h" |
37 #include "core/platform/audio/FFTFrame.h" | 36 #include "core/platform/audio/FFTFrame.h" |
| 37 #include "platform/FloatConversion.h" |
38 #include "wtf/MathExtras.h" | 38 #include "wtf/MathExtras.h" |
39 | 39 |
40 using namespace std; | 40 using namespace std; |
41 | 41 |
42 namespace WebCore { | 42 namespace WebCore { |
43 | 43 |
44 // Takes the input AudioChannel as an input impulse response and calculates the
average group delay. | 44 // Takes the input AudioChannel as an input impulse response and calculates the
average group delay. |
45 // This represents the initial delay before the most energetic part of the impul
se response. | 45 // This represents the initial delay before the most energetic part of the impul
se response. |
46 // The sample-frame delay is removed from the impulseP impulse response, and thi
s value is returned. | 46 // The sample-frame delay is removed from the impulseP impulse response, and thi
s value is returned. |
47 // the length of the passed in AudioChannel must be a power of 2. | 47 // the length of the passed in AudioChannel must be a power of 2. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 float frameDelay = (1 - x) * kernel1->frameDelay() + x * kernel2->frameDelay
(); | 128 float frameDelay = (1 - x) * kernel1->frameDelay() + x * kernel2->frameDelay
(); |
129 | 129 |
130 OwnPtr<FFTFrame> interpolatedFrame = FFTFrame::createInterpolatedFrame(*kern
el1->fftFrame(), *kernel2->fftFrame(), x); | 130 OwnPtr<FFTFrame> interpolatedFrame = FFTFrame::createInterpolatedFrame(*kern
el1->fftFrame(), *kernel2->fftFrame(), x); |
131 return HRTFKernel::create(interpolatedFrame.release(), frameDelay, sampleRat
e1); | 131 return HRTFKernel::create(interpolatedFrame.release(), frameDelay, sampleRat
e1); |
132 } | 132 } |
133 | 133 |
134 } // namespace WebCore | 134 } // namespace WebCore |
135 | 135 |
136 #endif // ENABLE(WEB_AUDIO) | 136 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |