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

Side by Side Diff: Source/platform/audio/mac/FFTFrameMac.cpp

Issue 536843002: Change members's order and combine duplicated method for FFTFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Separated using VectorMatch::vsmul from FFTFrameMac.cpp Created 6 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/platform/audio/ipp/FFTFrameIPP.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 * 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 m_frame.imagp = 0; 73 m_frame.imagp = 0;
74 74
75 m_FFTSize = 0; 75 m_FFTSize = 0;
76 m_log2FFTSize = 0; 76 m_log2FFTSize = 0;
77 } 77 }
78 78
79 // Copy constructor 79 // Copy constructor
80 FFTFrame::FFTFrame(const FFTFrame& frame) 80 FFTFrame::FFTFrame(const FFTFrame& frame)
81 : m_FFTSize(frame.m_FFTSize) 81 : m_FFTSize(frame.m_FFTSize)
82 , m_log2FFTSize(frame.m_log2FFTSize) 82 , m_log2FFTSize(frame.m_log2FFTSize)
83 , m_FFTSetup(frame.m_FFTSetup)
84 , m_realData(frame.m_FFTSize) 83 , m_realData(frame.m_FFTSize)
85 , m_imagData(frame.m_FFTSize) 84 , m_imagData(frame.m_FFTSize)
85 , m_FFTSetup(frame.m_FFTSetup)
86 { 86 {
87 // Setup frame data 87 // Setup frame data
88 m_frame.realp = m_realData.data(); 88 m_frame.realp = m_realData.data();
89 m_frame.imagp = m_imagData.data(); 89 m_frame.imagp = m_imagData.data();
90 90
91 // Copy/setup frame data 91 // Copy/setup frame data
92 unsigned nbytes = sizeof(float) * m_FFTSize; 92 unsigned nbytes = sizeof(float) * m_FFTSize;
93 memcpy(realData(), frame.m_frame.realp, nbytes); 93 memcpy(realData(), frame.m_frame.realp, nbytes);
94 memcpy(imagData(), frame.m_frame.imagp, nbytes); 94 memcpy(imagData(), frame.m_frame.imagp, nbytes);
95 } 95 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 for (int i = 0; i < kMaxFFTPow2Size; ++i) { 147 for (int i = 0; i < kMaxFFTPow2Size; ++i) {
148 if (fftSetups[i]) 148 if (fftSetups[i])
149 vDSP_destroy_fftsetup(fftSetups[i]); 149 vDSP_destroy_fftsetup(fftSetups[i]);
150 } 150 }
151 151
152 free(fftSetups); 152 free(fftSetups);
153 fftSetups = 0; 153 fftSetups = 0;
154 } 154 }
155 155
156 float* FFTFrame::realData() const
157 {
158 return m_frame.realp;
159 }
160
161 float* FFTFrame::imagData() const
162 {
163 return m_frame.imagp;
164 }
165
166 } // namespace blink 156 } // namespace blink
167 157
168 #endif // #if OS(MACOSX) 158 #endif // #if OS(MACOSX)
169 159
170 #endif // ENABLE(WEB_AUDIO) 160 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/platform/audio/ipp/FFTFrameIPP.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698