| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "config.h" | 30 #include "config.h" |
| 31 | 31 |
| 32 #if ENABLE(WEB_AUDIO) | 32 #if ENABLE(WEB_AUDIO) |
| 33 | 33 |
| 34 #if USE(WEBAUDIO_IPP) | 34 #if USE(WEBAUDIO_IPP) |
| 35 | 35 |
| 36 #include "platform/audio/FFTFrame.h" | 36 #include "platform/audio/FFTFrame.h" |
| 37 | 37 |
| 38 #include "wtf/MathExtras.h" | 38 #include "wtf/MathExtras.h" |
| 39 | 39 |
| 40 namespace WebCore { | 40 namespace blink { |
| 41 | 41 |
| 42 const unsigned maximumFFTPower2Size = 24; | 42 const unsigned maximumFFTPower2Size = 24; |
| 43 | 43 |
| 44 // Normal constructor: allocates for a given fftSize. | 44 // Normal constructor: allocates for a given fftSize. |
| 45 FFTFrame::FFTFrame(unsigned fftSize) | 45 FFTFrame::FFTFrame(unsigned fftSize) |
| 46 : m_FFTSize(fftSize) | 46 : m_FFTSize(fftSize) |
| 47 , m_log2FFTSize(static_cast<unsigned>(log2(fftSize))) | 47 , m_log2FFTSize(static_cast<unsigned>(log2(fftSize))) |
| 48 , m_complexData(fftSize) | 48 , m_complexData(fftSize) |
| 49 , m_realData(fftSize / 2) | 49 , m_realData(fftSize / 2) |
| 50 , m_imagData(fftSize / 2) | 50 , m_imagData(fftSize / 2) |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 int len = m_FFTSize >> 1; | 139 int len = m_FFTSize >> 1; |
| 140 // Merge the real and imagimary vectors to complex vector. | 140 // Merge the real and imagimary vectors to complex vector. |
| 141 Ipp32f* realP = m_realData.data(); | 141 Ipp32f* realP = m_realData.data(); |
| 142 Ipp32f* imagP = m_imagData.data(); | 142 Ipp32f* imagP = m_imagData.data(); |
| 143 Ipp32fc* complexP = reinterpret_cast<Ipp32fc*>(m_complexData.data()); | 143 Ipp32fc* complexP = reinterpret_cast<Ipp32fc*>(m_complexData.data()); |
| 144 ippsRealToCplx_32f(realP, imagP, complexP, len); | 144 ippsRealToCplx_32f(realP, imagP, complexP, len); |
| 145 | 145 |
| 146 return const_cast<float*>(m_complexData.data()); | 146 return const_cast<float*>(m_complexData.data()); |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace WebCore | 149 } // namespace blink |
| 150 | 150 |
| 151 #endif // USE(WEBAUDIO_IPP) | 151 #endif // USE(WEBAUDIO_IPP) |
| 152 | 152 |
| 153 #endif // ENABLE(WEB_AUDIO) | 153 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |