| 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 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 #include <math.h> | 35 #include <math.h> |
| 36 #include <algorithm> | 36 #include <algorithm> |
| 37 #include "platform/audio/AudioBus.h" | 37 #include "platform/audio/AudioBus.h" |
| 38 #include "platform/audio/HRTFPanner.h" | 38 #include "platform/audio/HRTFPanner.h" |
| 39 #include "wtf/ThreadingPrimitives.h" | 39 #include "wtf/ThreadingPrimitives.h" |
| 40 #include "wtf/text/StringHash.h" | 40 #include "wtf/text/StringHash.h" |
| 41 | 41 |
| 42 using namespace std; | 42 using namespace std; |
| 43 | 43 |
| 44 namespace WebCore { | 44 namespace blink { |
| 45 | 45 |
| 46 const unsigned HRTFElevation::AzimuthSpacing = 15; | 46 const unsigned HRTFElevation::AzimuthSpacing = 15; |
| 47 const unsigned HRTFElevation::NumberOfRawAzimuths = 360 / AzimuthSpacing; | 47 const unsigned HRTFElevation::NumberOfRawAzimuths = 360 / AzimuthSpacing; |
| 48 const unsigned HRTFElevation::InterpolationFactor = 8; | 48 const unsigned HRTFElevation::InterpolationFactor = 8; |
| 49 const unsigned HRTFElevation::NumberOfTotalAzimuths = NumberOfRawAzimuths * Inte
rpolationFactor; | 49 const unsigned HRTFElevation::NumberOfTotalAzimuths = NumberOfRawAzimuths * Inte
rpolationFactor; |
| 50 | 50 |
| 51 // Total number of components of an HRTF database. | 51 // Total number of components of an HRTF database. |
| 52 const size_t TotalNumberOfResponses = 240; | 52 const size_t TotalNumberOfResponses = 240; |
| 53 | 53 |
| 54 // Number of frames in an individual impulse response. | 54 // Number of frames in an individual impulse response. |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 330 |
| 331 int azimuthIndex2 = (azimuthIndex + 1) % numKernels; | 331 int azimuthIndex2 = (azimuthIndex + 1) % numKernels; |
| 332 double frameDelay2L = m_kernelListL->at(azimuthIndex2)->frameDelay(); | 332 double frameDelay2L = m_kernelListL->at(azimuthIndex2)->frameDelay(); |
| 333 double frameDelay2R = m_kernelListR->at(azimuthIndex2)->frameDelay(); | 333 double frameDelay2R = m_kernelListR->at(azimuthIndex2)->frameDelay(); |
| 334 | 334 |
| 335 // Linearly interpolate delays. | 335 // Linearly interpolate delays. |
| 336 frameDelayL = (1.0 - azimuthBlend) * frameDelayL + azimuthBlend * frameDelay
2L; | 336 frameDelayL = (1.0 - azimuthBlend) * frameDelayL + azimuthBlend * frameDelay
2L; |
| 337 frameDelayR = (1.0 - azimuthBlend) * frameDelayR + azimuthBlend * frameDelay
2R; | 337 frameDelayR = (1.0 - azimuthBlend) * frameDelayR + azimuthBlend * frameDelay
2R; |
| 338 } | 338 } |
| 339 | 339 |
| 340 } // namespace WebCore | 340 } // namespace blink |
| 341 | 341 |
| 342 #endif // ENABLE(WEB_AUDIO) | 342 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |