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

Side by Side Diff: webrtc/modules/audio_processing/aec3/echo_canceller3.cc

Issue 2567513003: Added basic framework for AEC3 in the audio processing module (Closed)
Patch Set: Changes in response to reviewer comments Created 4 years 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
(Empty)
1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10 #include "webrtc/modules/audio_processing/aec3/echo_canceller3.h"
11
12 #include "webrtc/system_wrappers/include/logging.h"
13
14 namespace webrtc {
15
16 int EchoCanceller3::instance_count_ = 0;
hlundin-webrtc 2016/12/12 21:35:21 Is this thread-safe? See https://sites.google.com/
peah-webrtc 2016/12/13 11:23:02 I added an atomic operation for this. That should
17
18 EchoCanceller3::EchoCanceller3(int sample_rate_hz, bool use_anti_hum_filter) {
19 int band_sample_rate_hz = (sample_rate_hz == 8000 ? sample_rate_hz : 16000);
20 frame_length_ = rtc::CheckedDivExact(band_sample_rate_hz, 100);
21
22 LOG(LS_INFO) << "AEC3 created : "
23 << "{ instance_count: " << instance_count_ << "}";
24 ++instance_count_;
25 }
26
27 EchoCanceller3::~EchoCanceller3() = default;
28
29 bool EchoCanceller3::AnalyzeRender(AudioBuffer* render) const {
hlundin-webrtc 2016/12/12 21:35:21 It's hard to tell from this dummy implementation,
peah-webrtc 2016/12/13 11:23:02 In a perfect world, it shouldn't. But the AudioBuf
hlundin-webrtc 2016/12/14 08:15:56 Acknowledged.
30 RTC_DCHECK_EQ(1u, render->num_channels());
31 RTC_DCHECK_EQ(frame_length_, render->num_frames_per_band());
32 return true;
33 }
34
35 void EchoCanceller3::AnalyzeCapture(AudioBuffer* capture) {}
hlundin-webrtc 2016/12/12 21:35:21 Same here: Can you make the input const? The name
peah-webrtc 2016/12/13 11:23:02 That would make sense. But with the current AudioB
36
37 void EchoCanceller3::ProcessCapture(AudioBuffer* capture,
38 bool known_echo_path_change) {
39 RTC_DCHECK_EQ(1u, capture->num_channels());
40 RTC_DCHECK_EQ(frame_length_, capture->num_frames_per_band());
41 }
42
43 std::string EchoCanceller3::ToString(
44 const AudioProcessing::Config::EchoCanceller3& config) {
45 std::stringstream ss;
46 ss << "{"
47 << "enabled: " << (config.enabled ? "true" : "false") << "}";
48 return ss.str();
49 }
50
51 bool EchoCanceller3::Validate(
52 const AudioProcessing::Config::EchoCanceller3& config) {
53 return true;
54 }
55
56 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698