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

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

Issue 1981823002: Remove OwnPtr::release() calls in platform/ (part 1). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 // In the time-domain, the 2nd half of the response must be zero, to avoid c ircular convolution aliasing... 58 // In the time-domain, the 2nd half of the response must be zero, to avoid c ircular convolution aliasing...
59 int fftSize = newFrame->fftSize(); 59 int fftSize = newFrame->fftSize();
60 AudioFloatArray buffer(fftSize); 60 AudioFloatArray buffer(fftSize);
61 newFrame->doInverseFFT(buffer.data()); 61 newFrame->doInverseFFT(buffer.data());
62 buffer.zeroRange(fftSize / 2, fftSize); 62 buffer.zeroRange(fftSize / 2, fftSize);
63 63
64 // Put back into frequency domain. 64 // Put back into frequency domain.
65 newFrame->doFFT(buffer.data()); 65 newFrame->doFFT(buffer.data());
66 66
67 return newFrame.release(); 67 return newFrame;
68 } 68 }
69 69
70 void FFTFrame::interpolateFrequencyComponents(const FFTFrame& frame1, const FFTF rame& frame2, double interp) 70 void FFTFrame::interpolateFrequencyComponents(const FFTFrame& frame1, const FFTF rame& frame2, double interp)
71 { 71 {
72 // FIXME : with some work, this method could be optimized 72 // FIXME : with some work, this method could be optimized
73 73
74 float* realP = realData(); 74 float* realP = realData();
75 float* imagP = imagData(); 75 float* imagP = imagData();
76 76
77 const float* realP1 = frame1.realData(); 77 const float* realP1 = frame1.realData();
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 VectorMath::zvmul(realP1, imagP1, realP2, imagP2, realP1, imagP1, halfSize); 261 VectorMath::zvmul(realP1, imagP1, realP2, imagP2, realP1, imagP1, halfSize);
262 262
263 // Multiply the packed DC/nyquist component 263 // Multiply the packed DC/nyquist component
264 realP1[0] = real0 * realP2[0]; 264 realP1[0] = real0 * realP2[0];
265 imagP1[0] = imag0 * imagP2[0]; 265 imagP1[0] = imag0 * imagP2[0];
266 } 266 }
267 267
268 } // namespace blink 268 } // namespace blink
269 269
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/TracedValueTest.cpp ('k') | third_party/WebKit/Source/platform/audio/HRTFDatabase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698