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

Side by Side Diff: webrtc/modules/audio_processing/residual_echo_detector.cc

Issue 2419563003: Add algorithm for Residual Echo Detector. (Closed)
Patch Set: Per's comments. Created 4 years, 2 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 27 matching lines...) Expand all
38 } 38 }
39 39
40 void ResidualEchoDetector::AnalyzeCaptureAudio(const AudioBuffer* audio) { 40 void ResidualEchoDetector::AnalyzeCaptureAudio(const AudioBuffer* audio) {
41 RTC_DCHECK_GE(160u, audio->num_frames_per_band()); 41 RTC_DCHECK_GE(160u, audio->num_frames_per_band());
42 42
43 detector_->Process( 43 detector_->Process(
44 rtc::ArrayView<const float>(audio->split_bands_const_f(0)[kBand0To8kHz], 44 rtc::ArrayView<const float>(audio->split_bands_const_f(0)[kBand0To8kHz],
45 audio->num_frames_per_band())); 45 audio->num_frames_per_band()));
46 } 46 }
47 47
48 void ResidualEchoDetector::Initialize(int sample_rate_hz) { 48 void ResidualEchoDetector::Initialize() {
49 RTC_DCHECK(sample_rate_hz == AudioProcessing::kSampleRate8kHz || 49 detector_->Initialize();
50 sample_rate_hz == AudioProcessing::kSampleRate16kHz ||
51 sample_rate_hz == AudioProcessing::kSampleRate32kHz ||
52 sample_rate_hz == AudioProcessing::kSampleRate48kHz);
53
54 detector_->Initialize(sample_rate_hz);
55 } 50 }
56 51
57 void ResidualEchoDetector::ReadQueuedRenderData() { 52 void ResidualEchoDetector::ReadQueuedRenderData() {
58 while (render_signal_queue_->Remove(&capture_queue_buffer_)) { 53 while (render_signal_queue_->Remove(&capture_queue_buffer_)) {
59 const size_t num_frames_per_band = capture_queue_buffer_.size(); 54 const size_t num_frames_per_band = capture_queue_buffer_.size();
60 detector_->BufferFarend(rtc::ArrayView<const float>( 55 detector_->BufferRender(rtc::ArrayView<const float>(
61 capture_queue_buffer_.data(), num_frames_per_band)); 56 capture_queue_buffer_.data(), num_frames_per_band));
62 } 57 }
63 } 58 }
64 59
65 float ResidualEchoDetector::get_echo_likelihood() const { 60 float ResidualEchoDetector::get_echo_likelihood() const {
66 return 0.0f; 61 return 0.0f;
67 } 62 }
68 63
69 } // namespace webrtc 64 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698