| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 noise_estimation_queue_(kMaxNumNoiseEstimatesToBuffer, | 86 noise_estimation_queue_(kMaxNumNoiseEstimatesToBuffer, |
| 87 std::vector<float>(num_noise_bins), | 87 std::vector<float>(num_noise_bins), |
| 88 RenderQueueItemVerifier<float>(num_noise_bins)) { | 88 RenderQueueItemVerifier<float>(num_noise_bins)) { |
| 89 RTC_DCHECK_LE(kRho, 1.f); | 89 RTC_DCHECK_LE(kRho, 1.f); |
| 90 | 90 |
| 91 const size_t erb_index = static_cast<size_t>( | 91 const size_t erb_index = static_cast<size_t>( |
| 92 ceilf(11.17f * logf((kClipFreqKhz + 0.312f) / (kClipFreqKhz + 14.6575f)) + | 92 ceilf(11.17f * logf((kClipFreqKhz + 0.312f) / (kClipFreqKhz + 14.6575f)) + |
| 93 43.f)); | 93 43.f)); |
| 94 start_freq_ = std::max(static_cast<size_t>(1), erb_index * kErbResolution); | 94 start_freq_ = std::max(static_cast<size_t>(1), erb_index * kErbResolution); |
| 95 | 95 |
| 96 size_t window_size = static_cast<size_t>(1 << RealFourier::FftOrder(freqs_)); | 96 size_t window_size = static_cast<size_t>(1) << RealFourier::FftOrder(freqs_); |
| 97 std::vector<float> kbd_window(window_size); | 97 std::vector<float> kbd_window(window_size); |
| 98 WindowGenerator::KaiserBesselDerived(kKbdAlpha, window_size, | 98 WindowGenerator::KaiserBesselDerived(kKbdAlpha, window_size, |
| 99 kbd_window.data()); | 99 kbd_window.data()); |
| 100 render_mangler_.reset(new LappedTransform( | 100 render_mangler_.reset(new LappedTransform( |
| 101 num_render_channels_, num_render_channels_, chunk_length_, | 101 num_render_channels_, num_render_channels_, chunk_length_, |
| 102 kbd_window.data(), window_size, window_size / 2, this)); | 102 kbd_window.data(), window_size, window_size / 2, this)); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void IntelligibilityEnhancer::SetCaptureNoiseEstimate( | 105 void IntelligibilityEnhancer::SetCaptureNoiseEstimate( |
| 106 std::vector<float> noise) { | 106 std::vector<float> noise) { |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 vad_.ProcessChunk(audio_s16_.data(), chunk_length_, sample_rate_hz_); | 306 vad_.ProcessChunk(audio_s16_.data(), chunk_length_, sample_rate_hz_); |
| 307 if (vad_.last_voice_probability() > kVoiceProbabilityThreshold) { | 307 if (vad_.last_voice_probability() > kVoiceProbabilityThreshold) { |
| 308 chunks_since_voice_ = 0; | 308 chunks_since_voice_ = 0; |
| 309 } else if (chunks_since_voice_ < kSpeechOffsetDelay) { | 309 } else if (chunks_since_voice_ < kSpeechOffsetDelay) { |
| 310 ++chunks_since_voice_; | 310 ++chunks_since_voice_; |
| 311 } | 311 } |
| 312 return chunks_since_voice_ < kSpeechOffsetDelay; | 312 return chunks_since_voice_ < kSpeechOffsetDelay; |
| 313 } | 313 } |
| 314 | 314 |
| 315 } // namespace webrtc | 315 } // namespace webrtc |
| OLD | NEW |