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

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/base/atomicops.h"
13 #include "webrtc/system_wrappers/include/logging.h"
14
15 namespace webrtc {
16
17 int EchoCanceller3::instance_count_ = 0;
18
19 EchoCanceller3::EchoCanceller3(int sample_rate_hz, bool use_anti_hum_filter) {
20 int band_sample_rate_hz = (sample_rate_hz == 8000 ? sample_rate_hz : 16000);
21 frame_length_ = rtc::CheckedDivExact(band_sample_rate_hz, 100);
22
23 LOG(LS_INFO) << "AEC3 created : "
24 << "{ instance_count: " << instance_count_ << "}";
25 instance_count_ = rtc::AtomicOps::Increment(&instance_count_);
26 }
27
28 EchoCanceller3::~EchoCanceller3() = default;
29
30 bool EchoCanceller3::AnalyzeRender(AudioBuffer* render) {
31 RTC_DCHECK_EQ(1u, render->num_channels());
32 RTC_DCHECK_EQ(frame_length_, render->num_frames_per_band());
33 return true;
34 }
35
36 void EchoCanceller3::AnalyzeCapture(AudioBuffer* capture) {}
37
38 void EchoCanceller3::ProcessCapture(AudioBuffer* capture,
39 bool known_echo_path_change) {
40 RTC_DCHECK_EQ(1u, capture->num_channels());
41 RTC_DCHECK_EQ(frame_length_, capture->num_frames_per_band());
42 }
43
44 std::string EchoCanceller3::ToString(
45 const AudioProcessing::Config::EchoCanceller3& config) {
46 std::stringstream ss;
47 ss << "{"
48 << "enabled: " << (config.enabled ? "true" : "false") << "}";
49 return ss.str();
50 }
51
52 bool EchoCanceller3::Validate(
53 const AudioProcessing::Config::EchoCanceller3& config) {
54 return true;
55 }
56
57 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/aec3/echo_canceller3.h ('k') | webrtc/modules/audio_processing/audio_processing_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698