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

Side by Side Diff: webrtc/common_audio/resampler/sinc_resampler.cc

Issue 3007253002: Remove typedefs.h from webrtc/ root (part 1)
Patch Set: backwards compatible FALLTHROUGH #define Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 input_buffer_size_(request_frames_ + kKernelSize), 153 input_buffer_size_(request_frames_ + kKernelSize),
154 // Create input buffers with a 16-byte alignment for SSE optimizations. 154 // Create input buffers with a 16-byte alignment for SSE optimizations.
155 kernel_storage_(static_cast<float*>( 155 kernel_storage_(static_cast<float*>(
156 AlignedMalloc(sizeof(float) * kKernelStorageSize, 16))), 156 AlignedMalloc(sizeof(float) * kKernelStorageSize, 16))),
157 kernel_pre_sinc_storage_(static_cast<float*>( 157 kernel_pre_sinc_storage_(static_cast<float*>(
158 AlignedMalloc(sizeof(float) * kKernelStorageSize, 16))), 158 AlignedMalloc(sizeof(float) * kKernelStorageSize, 16))),
159 kernel_window_storage_(static_cast<float*>( 159 kernel_window_storage_(static_cast<float*>(
160 AlignedMalloc(sizeof(float) * kKernelStorageSize, 16))), 160 AlignedMalloc(sizeof(float) * kKernelStorageSize, 16))),
161 input_buffer_(static_cast<float*>( 161 input_buffer_(static_cast<float*>(
162 AlignedMalloc(sizeof(float) * input_buffer_size_, 16))), 162 AlignedMalloc(sizeof(float) * input_buffer_size_, 16))),
163 #if defined(WEBRTC_CPU_DETECTION) 163 #if (defined(WEBRTC_ARCH_X86_FAMILY) && !defined(__SSE2__))
164 convolve_proc_(nullptr), 164 convolve_proc_(nullptr),
165 #endif 165 #endif
166 r1_(input_buffer_.get()), 166 r1_(input_buffer_.get()),
167 r2_(input_buffer_.get() + kKernelSize / 2) { 167 r2_(input_buffer_.get() + kKernelSize / 2) {
168 #if defined(WEBRTC_CPU_DETECTION) 168 #if (defined(WEBRTC_ARCH_X86_FAMILY) && !defined(__SSE2__))
169 InitializeCPUSpecificFeatures(); 169 InitializeCPUSpecificFeatures();
170 RTC_DCHECK(convolve_proc_); 170 RTC_DCHECK(convolve_proc_);
171 #endif 171 #endif
172 RTC_DCHECK_GT(request_frames_, 0); 172 RTC_DCHECK_GT(request_frames_, 0);
173 Flush(); 173 Flush();
174 RTC_DCHECK_GT(block_size_, kKernelSize); 174 RTC_DCHECK_GT(block_size_, kKernelSize);
175 175
176 memset(kernel_storage_.get(), 0, 176 memset(kernel_storage_.get(), 0,
177 sizeof(*kernel_storage_.get()) * kKernelStorageSize); 177 sizeof(*kernel_storage_.get()) * kKernelStorageSize);
178 memset(kernel_pre_sinc_storage_.get(), 0, 178 memset(kernel_pre_sinc_storage_.get(), 0,
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 sum1 += *input_ptr * *k1++; 365 sum1 += *input_ptr * *k1++;
366 sum2 += *input_ptr++ * *k2++; 366 sum2 += *input_ptr++ * *k2++;
367 } 367 }
368 368
369 // Linearly interpolate the two "convolutions". 369 // Linearly interpolate the two "convolutions".
370 return static_cast<float>((1.0 - kernel_interpolation_factor) * sum1 + 370 return static_cast<float>((1.0 - kernel_interpolation_factor) * sum1 +
371 kernel_interpolation_factor * sum2); 371 kernel_interpolation_factor * sum2);
372 } 372 }
373 373
374 } // namespace webrtc 374 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_audio/resampler/sinc_resampler.h ('k') | webrtc/modules/audio_coding/neteq/neteq_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698