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

Side by Side Diff: webrtc/modules/audio_processing/agc2/gain_controller2.h

Issue 2848593002: AGC2 as a new APM sub-module operating with hard-coded gain. (Closed)
Patch Set: AudioBuffer only used at AGC2 API level, ArrayView<float> for internal impl Created 3 years, 7 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_AGC2_GAIN_CONTROLLER2_H_
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AGC2_GAIN_CONTROLLER2_H_
13
14 #include <memory>
15 #include <string>
16
17 #include "webrtc/base/constructormagic.h"
18 #include "webrtc/modules/audio_processing/include/audio_processing.h"
19 #include "webrtc/modules/audio_processing/agc2/digital_gain_applier.h"
20
21 namespace webrtc {
22
23 class ApmDataDumper;
24 class AudioBuffer;
25
26 // Gain Controller 2 aims to automatically adjusting levels by acting on the
aleloi 2017/05/18 15:01:17 adjusting -> adjust
AleBzk 2017/05/19 13:15:41 Done.
27 // microphone gain and/or applying digital gain.
28 //
29 // It temporarily implements a hard-coded gain mode only.
30 class GainController2 {
31 public:
32 explicit GainController2(int sample_rate_hz);
33 ~GainController2();
34
35 void Process(AudioBuffer* audio);
aleloi 2017/05/18 15:01:17 Do we want the GainController to depend on 'AudioB
peah-webrtc 2017/05/18 20:17:52 I also think that we should limit the AudioBuffer
AleBzk 2017/05/19 13:15:41 I used AudioBuffer for the first time recently and
peah-webrtc 2017/05/22 08:16:00 That sounds good I think. Replacing AudioBuffer is
36
37 static bool Validate(const AudioProcessing::Config::GainController2& config);
38 static std::string ToString(
39 const AudioProcessing::Config::GainController2& config);
40
41 private:
42 int sample_rate_hz_;
43 std::unique_ptr<ApmDataDumper> data_dumper_;
44 DigitalGainApplier digital_gain_applier_;
45 static int instance_count_;
46 // TODO(alessiob): Remove once a meaningful gain controller mode is
47 // implemented.
48 const float gain_;
49 RTC_DISALLOW_COPY_AND_ASSIGN(GainController2);
50 };
51
52 } // namespace webrtc
53
54 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AGC2_GAIN_CONTROLLER2_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698