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

Side by Side Diff: webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc

Issue 1839603002: Remove webrtc::ScopedVector (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 complex_f normalization_factor = uniform_cov_mat_[i].elements()[0][0]; 327 complex_f normalization_factor = uniform_cov_mat_[i].elements()[0][0];
328 uniform_cov_mat_[i].Scale(1.f / normalization_factor); 328 uniform_cov_mat_[i].Scale(1.f / normalization_factor);
329 uniform_cov_mat_[i].Scale(1 - kBalance); 329 uniform_cov_mat_[i].Scale(1 - kBalance);
330 } 330 }
331 } 331 }
332 332
333 void NonlinearBeamformer::InitInterfCovMats() { 333 void NonlinearBeamformer::InitInterfCovMats() {
334 for (size_t i = 0; i < kNumFreqBins; ++i) { 334 for (size_t i = 0; i < kNumFreqBins; ++i) {
335 interf_cov_mats_[i].clear(); 335 interf_cov_mats_[i].clear();
336 for (size_t j = 0; j < interf_angles_radians_.size(); ++j) { 336 for (size_t j = 0; j < interf_angles_radians_.size(); ++j) {
337 interf_cov_mats_[i].push_back(new ComplexMatrixF(num_input_channels_, 337 interf_cov_mats_[i].push_back(std::unique_ptr<ComplexMatrixF>(
338 num_input_channels_)); 338 new ComplexMatrixF(num_input_channels_, num_input_channels_)));
339 ComplexMatrixF angled_cov_mat(num_input_channels_, num_input_channels_); 339 ComplexMatrixF angled_cov_mat(num_input_channels_, num_input_channels_);
340 CovarianceMatrixGenerator::AngledCovarianceMatrix( 340 CovarianceMatrixGenerator::AngledCovarianceMatrix(
341 kSpeedOfSoundMeterSeconds, 341 kSpeedOfSoundMeterSeconds,
342 interf_angles_radians_[j], 342 interf_angles_radians_[j],
343 i, 343 i,
344 kFftSize, 344 kFftSize,
345 kNumFreqBins, 345 kNumFreqBins,
346 sample_rate_hz_, 346 sample_rate_hz_,
347 array_geometry_, 347 array_geometry_,
348 &angled_cov_mat); 348 &angled_cov_mat);
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 new_mask_ + high_mean_end_bin_ + 1); 561 new_mask_ + high_mean_end_bin_ + 1);
562 if (new_mask_[quantile] > kMaskTargetThreshold) { 562 if (new_mask_[quantile] > kMaskTargetThreshold) {
563 is_target_present_ = true; 563 is_target_present_ = true;
564 interference_blocks_count_ = 0; 564 interference_blocks_count_ = 0;
565 } else { 565 } else {
566 is_target_present_ = interference_blocks_count_++ < hold_target_blocks_; 566 is_target_present_ = interference_blocks_count_++ < hold_target_blocks_;
567 } 567 }
568 } 568 }
569 569
570 } // namespace webrtc 570 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698