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

Unified Diff: third_party/WebKit/Source/platform/audio/ffmpeg/FFTFrameFFMPEG.cpp

Issue 2384073002: reflow comments in platform/audio (Closed)
Patch Set: comments (heh!) Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/audio/ffmpeg/FFTFrameFFMPEG.cpp
diff --git a/third_party/WebKit/Source/platform/audio/ffmpeg/FFTFrameFFMPEG.cpp b/third_party/WebKit/Source/platform/audio/ffmpeg/FFTFrameFFMPEG.cpp
index 7731f6cdc550d9abf38d7f62c97c2fd50bbc2ab8..22175ec932379b030b1ae4019fd658ff4c6c37a0 100644
--- a/third_party/WebKit/Source/platform/audio/ffmpeg/FFTFrameFFMPEG.cpp
+++ b/third_party/WebKit/Source/platform/audio/ffmpeg/FFTFrameFFMPEG.cpp
@@ -43,7 +43,8 @@ extern "C" {
namespace blink {
#if ENABLE(ASSERT)
-// Max FFT size for FFMPEG. WebAudio currently only uses FFTs up to size 15 (2^15 points).
+// Max FFT size for FFMPEG. WebAudio currently only uses FFTs up to size 15
+// (2^15 points).
const int kMaxFFTPow2Size = 16;
#endif
@@ -112,8 +113,8 @@ void FFTFrame::doFFT(const float* data) {
float* imag = m_imagData.data();
for (int i = 0; i < len; ++i) {
int baseComplexIndex = 2 * i;
- // m_realData[0] is the DC component and m_imagData[0] is the nyquist component
- // since the interleaved complex data is packed.
+ // m_realData[0] is the DC component and m_imagData[0] is the nyquist
+ // component since the interleaved complex data is packed.
real[i] = p[baseComplexIndex];
imag[i] = p[baseComplexIndex + 1];
}
@@ -126,8 +127,9 @@ void FFTFrame::doInverseFFT(float* data) {
// Compute inverse transform.
av_rdft_calc(m_inverseContext, interleavedData);
- // Scale so that a forward then inverse FFT yields exactly the original data. For some reason
- // av_rdft_calc above returns values that are half of what I expect. Hence make the scale factor
+ // Scale so that a forward then inverse FFT yields exactly the original data.
+ // For some reason av_rdft_calc above returns values that are half of what I
+ // expect. Hence make the scale factor
// twice as large to compensate for that.
const float scale = 2.0 / m_FFTSize;
VectorMath::vsmul(interleavedData, 1, &scale, data, 1, m_FFTSize);
@@ -149,9 +151,10 @@ float* FFTFrame::getUpToDateComplexData() {
}
RDFTContext* FFTFrame::contextForSize(unsigned fftSize, int trans) {
- // FIXME: This is non-optimal. Ideally, we'd like to share the contexts for FFTFrames of the same size.
- // But FFmpeg's RDFT uses a scratch buffer inside the context and so they are not thread-safe.
- // We could improve this by sharing the FFTFrames on a per-thread basis.
+ // FIXME: This is non-optimal. Ideally, we'd like to share the contexts for
+ // FFTFrames of the same size. But FFmpeg's RDFT uses a scratch buffer
+ // inside the context and so they are not thread-safe. We could improve this
+ // by sharing the FFTFrames on a per-thread basis.
ASSERT(fftSize);
int pow2size = static_cast<int>(log2(fftSize));
ASSERT(pow2size < kMaxFFTPow2Size);
« no previous file with comments | « third_party/WebKit/Source/platform/audio/VectorMath.cpp ('k') | third_party/WebKit/Source/platform/audio/mac/FFTFrameMac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698