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 29 matching lines...) Expand all Loading... |
40 const unsigned maximumFFTPower2Size = 24; | 40 const unsigned maximumFFTPower2Size = 24; |
41 | 41 |
42 // Normal constructor: allocates for a given fftSize. | 42 // Normal constructor: allocates for a given fftSize. |
43 FFTFrame::FFTFrame(unsigned fftSize) | 43 FFTFrame::FFTFrame(unsigned fftSize) |
44 : m_FFTSize(fftSize), | 44 : m_FFTSize(fftSize), |
45 m_log2FFTSize(static_cast<unsigned>(log2(fftSize))), | 45 m_log2FFTSize(static_cast<unsigned>(log2(fftSize))), |
46 m_realData(fftSize / 2), | 46 m_realData(fftSize / 2), |
47 m_imagData(fftSize / 2), | 47 m_imagData(fftSize / 2), |
48 m_complexData(fftSize) { | 48 m_complexData(fftSize) { |
49 // We only allow power of two. | 49 // We only allow power of two. |
50 ASSERT(1UL << m_log2FFTSize == m_FFTSize); | 50 DCHECK_EQ(1UL << m_log2FFTSize, m_FFTSize); |
51 ASSERT(m_log2FFTSize <= maximumFFTPower2Size); | 51 DCHECK_LE(m_log2FFTSize, maximumFFTPower2Size); |
52 | 52 |
53 ippsDFTInitAlloc_R_32f(&m_DFTSpec, m_FFTSize, IPP_FFT_NODIV_BY_ANY, | 53 ippsDFTInitAlloc_R_32f(&m_DFTSpec, m_FFTSize, IPP_FFT_NODIV_BY_ANY, |
54 ippAlgHintFast); | 54 ippAlgHintFast); |
55 int bufferSize = 0; | 55 int bufferSize = 0; |
56 ippsDFTGetBufSize_R_32f(m_DFTSpec, &bufferSize); | 56 ippsDFTGetBufSize_R_32f(m_DFTSpec, &bufferSize); |
57 m_buffer = ippsMalloc_8u(bufferSize); | 57 m_buffer = ippsMalloc_8u(bufferSize); |
58 } | 58 } |
59 | 59 |
60 // Creates a blank/empty frame (interpolate() must later be called). | 60 // Creates a blank/empty frame (interpolate() must later be called). |
61 FFTFrame::FFTFrame() : m_FFTSize(0), m_log2FFTSize(0) {} | 61 FFTFrame::FFTFrame() : m_FFTSize(0), m_log2FFTSize(0) {} |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 Ipp32f* imagP = m_imagData.data(); | 121 Ipp32f* imagP = m_imagData.data(); |
122 Ipp32fc* complexP = reinterpret_cast<Ipp32fc*>(m_complexData.data()); | 122 Ipp32fc* complexP = reinterpret_cast<Ipp32fc*>(m_complexData.data()); |
123 ippsRealToCplx_32f(realP, imagP, complexP, len); | 123 ippsRealToCplx_32f(realP, imagP, complexP, len); |
124 | 124 |
125 return const_cast<float*>(m_complexData.data()); | 125 return const_cast<float*>(m_complexData.data()); |
126 } | 126 } |
127 | 127 |
128 } // namespace blink | 128 } // namespace blink |
129 | 129 |
130 #endif // USE(WEBAUDIO_IPP) | 130 #endif // USE(WEBAUDIO_IPP) |
OLD | NEW |