Changeset 84968 in webkit
- Timestamp:
- Apr 26, 2011 4:01:36 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r84958 r84968 1 2011-04-26 Chris Rogers <crogers@google.com> 2 3 Reviewed by Kenneth Russell. 4 5 Add FFTFrame implementation for FFmpeg 6 https://bugs.webkit.org/show_bug.cgi?id=59408 7 8 No new tests since audio API is not yet implemented. 9 10 * WebCore.gyp/WebCore.gyp: 11 * WebCore.gypi: 12 * platform/audio/FFTFrame.h: 13 * platform/audio/FFTFrameStub.cpp: 14 * platform/audio/ffmpeg: Added. 15 * platform/audio/ffmpeg/FFTFrameFFMPEG.cpp: Added. 16 (WebCore::FFTFrame::FFTFrame): 17 (WebCore::FFTFrame::initialize): 18 (WebCore::FFTFrame::cleanup): 19 (WebCore::FFTFrame::~FFTFrame): 20 (WebCore::FFTFrame::multiply): 21 (WebCore::FFTFrame::doFFT): 22 (WebCore::FFTFrame::doInverseFFT): 23 (WebCore::FFTFrame::realData): 24 (WebCore::FFTFrame::imagData): 25 (WebCore::FFTFrame::getUpToDateComplexData): 26 (WebCore::FFTFrame::contextForSize): 27 * platform/audio/mac/FFTFrameMac.cpp: 28 * webaudio/ConvolverNode.cpp: 29 1 30 2011-04-26 Jeff Miller <jeffm@apple.com> 2 31 -
trunk/Source/WebCore/WebCore.gyp/WebCore.gyp
r84426 r84968 1166 1166 }, 1167 1167 }], 1168 ['(OS=="linux" or OS=="win") and branding=="Chrome"', {1169 'dependencies': [1170 '<(chromium_src_dir)/third_party/mkl/google/mkl.gyp:mkl_libs',1171 ],1172 }],1173 1168 ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_FFTW=1" in feature_defines', { 1174 1169 # This directory needs to be on the include path for multiple sub-targets of webcore. … … 1178 1173 ], 1179 1174 }, 1175 }], 1176 ['(OS=="mac" or OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_FFMPEG=1" in feature_defines', { 1177 # This directory needs to be on the include path for multiple sub-targets of webcore. 1178 'direct_dependent_settings': { 1179 'include_dirs': [ 1180 '<(chromium_src_dir)/third_party/ffmpeg/patched-ffmpeg-mt', 1181 ], 1182 }, 1183 'dependencies': [ 1184 '<(chromium_src_dir)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg', 1185 ], 1180 1186 }], 1181 1187 ['"ENABLE_LEVELDB=1" in feature_defines', { -
trunk/Source/WebCore/WebCore.gypi
r84857 r84968 3711 3711 'platform/audio/mac/AudioFileReaderMac.cpp', 3712 3712 'platform/audio/mac/AudioFileReaderMac.h', 3713 'platform/audio/ffmpeg/FFTFrameFFMPEG.cpp', 3713 3714 'platform/audio/mac/FFTFrameMac.cpp', 3714 3715 'platform/audio/mkl/FFTFrameMKL.cpp', -
trunk/Source/WebCore/platform/audio/FFTFrame.h
r78102 r84968 32 32 #include "AudioArray.h" 33 33 34 #if OS(DARWIN) 34 #if OS(DARWIN) && !USE(WEBAUDIO_FFMPEG) 35 #define USE_ACCELERATE_FFT 1 36 #else 37 #define USE_ACCELERATE_FFT 0 38 #endif 39 40 #if USE_ACCELERATE_FFT 35 41 #include <Accelerate/Accelerate.h> 36 42 #endif 37 43 38 #if !OS(DARWIN) 44 #if !USE_ACCELERATE_FFT 45 39 46 #if USE(WEBAUDIO_MKL) 40 47 #include "mkl_dfti.h" 41 48 #endif // USE(WEBAUDIO_MKL) 49 42 50 #if USE(WEBAUDIO_FFTW) 43 51 #include "fftw3.h" 44 52 #endif // USE(WEBAUDIO_FFTW) 45 #endif 53 54 #if USE(WEBAUDIO_FFMPEG) 55 struct RDFTContext; 56 #endif // USE(WEBAUDIO_FFMPEG) 57 58 #endif // !USE_ACCELERATE_FFT 46 59 47 60 #include <wtf/PassOwnPtr.h> … … 93 106 void interpolateFrequencyComponents(const FFTFrame& frame1, const FFTFrame& frame2, double x); 94 107 95 #if OS(DARWIN)108 #if USE_ACCELERATE_FFT 96 109 DSPSplitComplex& dspSplitComplex() { return m_frame; } 97 110 DSPSplitComplex dspSplitComplex() const { return m_frame; } … … 106 119 AudioFloatArray m_realData; 107 120 AudioFloatArray m_imagData; 108 #else // !OS(DARWIN) 121 #else // !USE_ACCELERATE_FFT 122 109 123 #if USE(WEBAUDIO_MKL) 110 124 // Interleaves the planar real and imaginary data and returns a … … 124 138 AudioFloatArray m_imagData; 125 139 #endif // USE(WEBAUDIO_MKL) 140 141 #if USE(WEBAUDIO_FFMPEG) 142 static RDFTContext* contextForSize(unsigned fftSize, int trans); 143 144 RDFTContext* m_forwardContext; 145 RDFTContext* m_inverseContext; 146 147 float* getUpToDateComplexData(); 148 AudioFloatArray m_complexData; 149 AudioFloatArray m_realData; 150 AudioFloatArray m_imagData; 151 #endif // USE(WEBAUDIO_FFMPEG) 152 126 153 #if USE(WEBAUDIO_FFTW) 127 154 fftwf_plan m_forwardPlan; … … 147 174 float*, float*, float*); 148 175 #endif // USE(WEBAUDIO_FFTW) 149 #endif // !OS(DARWIN) 176 177 #endif // !USE_ACCELERATE_FFT 150 178 }; 151 179 -
trunk/Source/WebCore/platform/audio/FFTFrameStub.cpp
r83875 r84968 30 30 #if ENABLE(WEB_AUDIO) 31 31 32 #if !OS(DARWIN) && !USE(WEBAUDIO_MKL) && !USE(WEBAUDIO_FFTW) 32 #if !OS(DARWIN) && !USE(WEBAUDIO_MKL) && !USE(WEBAUDIO_FFTW) && !USE(WEBAUDIO_FFMPEG) 33 33 34 34 #include "FFTFrame.h" -
trunk/Source/WebCore/platform/audio/mac/FFTFrameMac.cpp
r78102 r84968 32 32 33 33 #if ENABLE(WEB_AUDIO) 34 35 #if OS(DARWIN) && !USE(WEBAUDIO_FFMPEG) 34 36 35 37 #include "FFTFrame.h" … … 193 195 } // namespace WebCore 194 196 197 #endif // #if OS(DARWIN) && !USE(WEBAUDIO_FFMPEG) 198 195 199 #endif // ENABLE(WEB_AUDIO) -
trunk/Source/WebCore/webaudio/ConvolverNode.cpp
r82963 r84968 40 40 // it's important not to make this too high. In this case 8192 is a good value. 41 41 // But, the Reverb object is multi-threaded, so we want this as high as possible without losing too much accuracy. 42 // Very large FFTs will have worse phase errors. Given these constraints 16384is a good compromise.43 const size_t MaxFFTSize = 16384;42 // Very large FFTs will have worse phase errors. Given these constraints 32768 is a good compromise. 43 const size_t MaxFFTSize = 32768; 44 44 45 45 namespace WebCore {
Note: See TracChangeset
for help on using the changeset viewer.