| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 #include "webrtc/modules/audio_processing/aec3/echo_remover.h" | 10 #include "webrtc/modules/audio_processing/aec3/echo_remover.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 const int sample_rate_hz_; | 37 const int sample_rate_hz_; |
| 38 | 38 |
| 39 RTC_DISALLOW_COPY_AND_ASSIGN(EchoRemoverImpl); | 39 RTC_DISALLOW_COPY_AND_ASSIGN(EchoRemoverImpl); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 // TODO(peah): Add functionality. | 42 // TODO(peah): Add functionality. |
| 43 EchoRemoverImpl::EchoRemoverImpl(int sample_rate_hz) | 43 EchoRemoverImpl::EchoRemoverImpl(int sample_rate_hz) |
| 44 : sample_rate_hz_(sample_rate_hz) { | 44 : sample_rate_hz_(sample_rate_hz) { |
| 45 RTC_DCHECK(sample_rate_hz == 8000 || sample_rate_hz == 16000 || | 45 RTC_DCHECK(ValidFullBandRate(sample_rate_hz_)); |
| 46 sample_rate_hz == 32000 || sample_rate_hz == 48000); | |
| 47 } | 46 } |
| 48 | 47 |
| 49 EchoRemoverImpl::~EchoRemoverImpl() = default; | 48 EchoRemoverImpl::~EchoRemoverImpl() = default; |
| 50 | 49 |
| 51 // TODO(peah): Add functionality. | 50 // TODO(peah): Add functionality. |
| 52 void EchoRemoverImpl::ProcessBlock( | 51 void EchoRemoverImpl::ProcessBlock( |
| 53 const rtc::Optional<size_t>& echo_path_delay_samples, | 52 const rtc::Optional<size_t>& echo_path_delay_samples, |
| 54 const EchoPathVariability& echo_path_variability, | 53 const EchoPathVariability& echo_path_variability, |
| 55 bool capture_signal_saturation, | 54 bool capture_signal_saturation, |
| 56 const std::vector<std::vector<float>>& render, | 55 const std::vector<std::vector<float>>& render, |
| 57 std::vector<std::vector<float>>* capture) { | 56 std::vector<std::vector<float>>* capture) { |
| 58 RTC_DCHECK(capture); | 57 RTC_DCHECK(capture); |
| 59 RTC_DCHECK_EQ(render.size(), NumBandsForRate(sample_rate_hz_)); | 58 RTC_DCHECK_EQ(render.size(), NumBandsForRate(sample_rate_hz_)); |
| 60 RTC_DCHECK_EQ(capture->size(), NumBandsForRate(sample_rate_hz_)); | 59 RTC_DCHECK_EQ(capture->size(), NumBandsForRate(sample_rate_hz_)); |
| 61 RTC_DCHECK_EQ(render[0].size(), kBlockSize); | 60 RTC_DCHECK_EQ(render[0].size(), kBlockSize); |
| 62 RTC_DCHECK_EQ((*capture)[0].size(), kBlockSize); | 61 RTC_DCHECK_EQ((*capture)[0].size(), kBlockSize); |
| 63 } | 62 } |
| 64 | 63 |
| 65 // TODO(peah): Add functionality. | 64 // TODO(peah): Add functionality. |
| 66 void EchoRemoverImpl::UpdateEchoLeakageStatus(bool leakage_detected) {} | 65 void EchoRemoverImpl::UpdateEchoLeakageStatus(bool leakage_detected) {} |
| 67 | 66 |
| 68 } // namespace | 67 } // namespace |
| 69 | 68 |
| 70 EchoRemover* EchoRemover::Create(int sample_rate_hz) { | 69 EchoRemover* EchoRemover::Create(int sample_rate_hz) { |
| 71 return new EchoRemoverImpl(sample_rate_hz); | 70 return new EchoRemoverImpl(sample_rate_hz); |
| 72 } | 71 } |
| 73 | 72 |
| 74 } // namespace webrtc | 73 } // namespace webrtc |
| OLD | NEW |