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

Side by Side Diff: Source/WebCore/webaudio/RealtimeAnalyser.cpp

Issue 7745029: Merge 92408 - Make sure that AudioArray is 16-byte aligned (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 3 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 | « Source/WebCore/webaudio/DelayDSPKernel.cpp ('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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 unsigned log2size = static_cast<unsigned>(log2(size)); 83 unsigned log2size = static_cast<unsigned>(log2(size));
84 bool isPOT(1UL << log2size == size); 84 bool isPOT(1UL << log2size == size);
85 85
86 if (!isPOT || size > MaxFFTSize) { 86 if (!isPOT || size > MaxFFTSize) {
87 // FIXME: It would be good to also set an exception. 87 // FIXME: It would be good to also set an exception.
88 return; 88 return;
89 } 89 }
90 90
91 if (m_fftSize != size) { 91 if (m_fftSize != size) {
92 m_analysisFrame = adoptPtr(new FFTFrame(m_fftSize)); 92 m_analysisFrame = adoptPtr(new FFTFrame(m_fftSize));
93 m_magnitudeBuffer.resize(size); 93 m_magnitudeBuffer.allocate(size);
94 m_fftSize = size; 94 m_fftSize = size;
95 } 95 }
96 } 96 }
97 97
98 void RealtimeAnalyser::writeInput(AudioBus* bus, size_t framesToProcess) 98 void RealtimeAnalyser::writeInput(AudioBus* bus, size_t framesToProcess)
99 { 99 {
100 bool isBusGood = bus && bus->numberOfChannels() > 0 && bus->channel(0)->leng th() >= framesToProcess; 100 bool isBusGood = bus && bus->numberOfChannels() > 0 && bus->channel(0)->leng th() >= framesToProcess;
101 ASSERT(isBusGood); 101 ASSERT(isBusGood);
102 if (!isBusGood) 102 if (!isBusGood)
103 return; 103 return;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 scaledValue = UCHAR_MAX; 285 scaledValue = UCHAR_MAX;
286 286
287 destination[i] = static_cast<unsigned char>(scaledValue); 287 destination[i] = static_cast<unsigned char>(scaledValue);
288 } 288 }
289 } 289 }
290 } 290 }
291 291
292 } // namespace WebCore 292 } // namespace WebCore
293 293
294 #endif // ENABLE(WEB_AUDIO) 294 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/WebCore/webaudio/DelayDSPKernel.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698