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

Side by Side Diff: webrtc/modules/audio_processing/aec3/comfort_noise_generator.h

Issue 2678423005: Finalization of the first version of EchoCanceller 3 (Closed)
Patch Set: Created 3 years, 10 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
(Empty)
1 /*
2 * Copyright (c) 2017 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
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_COMFORT_NOISE_GENERATOR_H_
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_COMFORT_NOISE_GENERATOR_H_
13
14 #include <stdio.h>
ivoc 2017/02/10 13:52:33 Is this needed? For the uin32_t you could use stdi
peah-webrtc 2017/02/20 07:37:15 Done.
15 #include <memory>
16 #include <vector>
ivoc 2017/02/10 13:52:34 Can be removed
peah-webrtc 2017/02/20 07:37:15 Done.
17
18 #include "webrtc/base/array_view.h"
ivoc 2017/02/10 13:52:34 Looks like ArrayView is not used in this header, b
peah-webrtc 2017/02/20 07:37:15 I prefer array as it will give a compile-time warn
ivoc 2017/02/21 17:26:01 Ok, sounds good.
peah-webrtc 2017/02/21 23:00:39 Acknowledged.
19 #include "webrtc/base/constructormagic.h"
20 #include "webrtc/modules/audio_processing/aec3/aec3_constants.h"
21 #include "webrtc/modules/audio_processing/aec3/fft_data.h"
22 #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h"
ivoc 2017/02/10 13:52:34 Is this used?
peah-webrtc 2017/02/20 07:37:15 Done.
23
24 namespace webrtc {
25
26 // Generates the comfort noise.
27 class ComfortNoiseGenerator {
28 public:
29 ComfortNoiseGenerator();
30 ~ComfortNoiseGenerator();
31
32 // Computes the comfort noise.
33 void Compute(const std::array<float, kFftLengthBy2Plus1>& capture_spectrum,
ivoc 2017/02/10 13:52:34 #include <array> is missing.
peah-webrtc 2017/02/20 07:37:15 Done.
34 FftData* lower_band_noise,
35 FftData* upper_band_noise);
36
37 // Returns the estimate of the background noise spectrum.
38 const std::array<float, kFftLengthBy2Plus1>& NoiseSpectrum() const {
39 return N2_;
40 }
41
42 private:
43 uint32_t seed_;
44 std::unique_ptr<std::array<float, kFftLengthBy2Plus1>> N2_initial_;
45 std::array<float, kFftLengthBy2Plus1> Y2_smoothed_;
46 std::array<float, kFftLengthBy2Plus1> N2_;
47 int N2_counter_ = 0;
48
49 RTC_DISALLOW_COPY_AND_ASSIGN(ComfortNoiseGenerator);
50 };
51
52 } // namespace webrtc
53
54 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_COMFORT_NOISE_GENERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698