OLD | NEW |
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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 float smoothed_mask = old_high_pass_mask_; | 414 float smoothed_mask = old_high_pass_mask_; |
415 for (size_t j = 0; j < data->num_frames_per_band(); ++j) { | 415 for (size_t j = 0; j < data->num_frames_per_band(); ++j) { |
416 smoothed_mask += ramp_increment; | 416 smoothed_mask += ramp_increment; |
417 for (size_t k = 0; k < num_postfilter_channels_; ++k) { | 417 for (size_t k = 0; k < num_postfilter_channels_; ++k) { |
418 data->channels(i)[k][j] *= smoothed_mask; | 418 data->channels(i)[k][j] *= smoothed_mask; |
419 } | 419 } |
420 } | 420 } |
421 } | 421 } |
422 } | 422 } |
423 | 423 |
424 void NonlinearBeamformer::ProcessChunk(const ChannelBuffer<float>& input, | |
425 ChannelBuffer<float>* output) { | |
426 RTC_DCHECK_GT(output->num_channels(), 0u); | |
427 RTC_DCHECK_EQ(output->num_frames_per_band(), input.num_frames_per_band()); | |
428 AnalyzeChunk(input); | |
429 for (size_t i = 0u; i < input.num_bands(); ++i) { | |
430 std::memcpy(output->channels(i)[0], input.channels(i)[0], | |
431 sizeof(input.channels(0)[0][0]) * input.num_frames_per_band()); | |
432 } | |
433 PostFilter(output); | |
434 } | |
435 | |
436 void NonlinearBeamformer::AimAt(const SphericalPointf& target_direction) { | 424 void NonlinearBeamformer::AimAt(const SphericalPointf& target_direction) { |
437 target_angle_radians_ = target_direction.azimuth(); | 425 target_angle_radians_ = target_direction.azimuth(); |
438 InitHighFrequencyCorrectionRanges(); | 426 InitHighFrequencyCorrectionRanges(); |
439 InitInterfAngles(); | 427 InitInterfAngles(); |
440 InitDelaySumMasks(); | 428 InitDelaySumMasks(); |
441 InitTargetCovMats(); | 429 InitTargetCovMats(); |
442 InitInterfCovMats(); | 430 InitInterfCovMats(); |
443 NormalizeCovMats(); | 431 NormalizeCovMats(); |
444 } | 432 } |
445 | 433 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 new_mask_ + high_mean_end_bin_ + 1); | 584 new_mask_ + high_mean_end_bin_ + 1); |
597 if (new_mask_[quantile] > kMaskTargetThreshold) { | 585 if (new_mask_[quantile] > kMaskTargetThreshold) { |
598 is_target_present_ = true; | 586 is_target_present_ = true; |
599 interference_blocks_count_ = 0; | 587 interference_blocks_count_ = 0; |
600 } else { | 588 } else { |
601 is_target_present_ = interference_blocks_count_++ < hold_target_blocks_; | 589 is_target_present_ = interference_blocks_count_++ < hold_target_blocks_; |
602 } | 590 } |
603 } | 591 } |
604 | 592 |
605 } // namespace webrtc | 593 } // namespace webrtc |
OLD | NEW |