Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: third_party/WebKit/Source/platform/audio/FFTFrame.h

Issue 2689213002: Use FFT from FFMpeg for OSX (Closed)
Patch Set: Remove OSX support. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 18 matching lines...) Expand all
29 #ifndef FFTFrame_h 29 #ifndef FFTFrame_h
30 #define FFTFrame_h 30 #define FFTFrame_h
31 31
32 #include "platform/PlatformExport.h" 32 #include "platform/PlatformExport.h"
33 #include "platform/audio/AudioArray.h" 33 #include "platform/audio/AudioArray.h"
34 #include "wtf/Allocator.h" 34 #include "wtf/Allocator.h"
35 #include "wtf/Forward.h" 35 #include "wtf/Forward.h"
36 #include "wtf/Threading.h" 36 #include "wtf/Threading.h"
37 #include <memory> 37 #include <memory>
38 38
39 #if OS(MACOSX) 39 #if USE(WEBAUDIO_OPENMAX_DL_FFT)
40 #include <Accelerate/Accelerate.h>
41 #elif USE(WEBAUDIO_OPENMAX_DL_FFT)
42 #include <dl/sp/api/omxSP.h> 40 #include <dl/sp/api/omxSP.h>
43 #elif USE(WEBAUDIO_FFMPEG) 41 #elif USE(WEBAUDIO_FFMPEG)
44 struct RDFTContext; 42 struct RDFTContext;
45 #endif 43 #endif
46 44
47 namespace blink { 45 namespace blink {
48 46
49 // Defines the interface for an "FFT frame", an object which is able to perform 47 // Defines the interface for an "FFT frame", an object which is able to perform
50 // a forward and reverse FFT, internally storing the resultant frequency-domain 48 // a forward and reverse FFT, internally storing the resultant frequency-domain
51 // data. 49 // data.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 private: 90 private:
93 void interpolateFrequencyComponents(const FFTFrame& frame1, 91 void interpolateFrequencyComponents(const FFTFrame& frame1,
94 const FFTFrame& frame2, 92 const FFTFrame& frame2,
95 double x); 93 double x);
96 94
97 unsigned m_FFTSize; 95 unsigned m_FFTSize;
98 unsigned m_log2FFTSize; 96 unsigned m_log2FFTSize;
99 AudioFloatArray m_realData; 97 AudioFloatArray m_realData;
100 AudioFloatArray m_imagData; 98 AudioFloatArray m_imagData;
101 99
102 #if OS(MACOSX) 100 #if USE(WEBAUDIO_FFMPEG)
103 DSPSplitComplex& dspSplitComplex() { return m_frame; }
104 DSPSplitComplex dspSplitComplex() const { return m_frame; }
105 static FFTSetup fftSetupForSize(unsigned fftSize);
106 static FFTSetup* fftSetups;
107 FFTSetup m_FFTSetup;
108 DSPSplitComplex m_frame;
109 #elif USE(WEBAUDIO_FFMPEG)
110 static RDFTContext* contextForSize(unsigned fftSize, int trans); 101 static RDFTContext* contextForSize(unsigned fftSize, int trans);
111 RDFTContext* m_forwardContext; 102 RDFTContext* m_forwardContext;
112 RDFTContext* m_inverseContext; 103 RDFTContext* m_inverseContext;
113 float* getUpToDateComplexData(); 104 float* getUpToDateComplexData();
114 AudioFloatArray m_complexData; 105 AudioFloatArray m_complexData;
115 #elif USE(WEBAUDIO_OPENMAX_DL_FFT) 106 #elif USE(WEBAUDIO_OPENMAX_DL_FFT)
116 static OMXFFTSpec_R_F32* contextForSize(unsigned log2FFTSize); 107 static OMXFFTSpec_R_F32* contextForSize(unsigned log2FFTSize);
117 OMXFFTSpec_R_F32* m_forwardContext; 108 OMXFFTSpec_R_F32* m_forwardContext;
118 OMXFFTSpec_R_F32* m_inverseContext; 109 OMXFFTSpec_R_F32* m_inverseContext;
119 AudioFloatArray m_complexData; 110 AudioFloatArray m_complexData;
120 #endif 111 #endif
121 }; 112 };
122 113
123 } // namespace blink 114 } // namespace blink
124 115
125 #endif // FFTFrame_h 116 #endif // FFTFrame_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698