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

Unified Diff: webrtc/modules/audio_processing/agc2/gain_controller2.h

Issue 2995043002: AGC2 dummy module: fixed gain param, APM integration, audioproc_f adaptation (Closed)
Patch Set: comments addressed Created 3 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/agc2/gain_controller2.h
diff --git a/webrtc/modules/audio_processing/agc2/gain_controller2.h b/webrtc/modules/audio_processing/agc2/gain_controller2.h
index 1a8bb7f39c28be3753793a09af83f8154e201121..9a141b827034d1ad6f42353a300be77734e9b420 100644
--- a/webrtc/modules/audio_processing/agc2/gain_controller2.h
+++ b/webrtc/modules/audio_processing/agc2/gain_controller2.h
@@ -14,7 +14,6 @@
#include <memory>
#include <string>
-#include "webrtc/modules/audio_processing/agc2/digital_gain_applier.h"
#include "webrtc/modules/audio_processing/include/audio_processing.h"
#include "webrtc/rtc_base/constructormagic.h"
@@ -26,28 +25,29 @@ class AudioBuffer;
// Gain Controller 2 aims to automatically adjust levels by acting on the
// microphone gain and/or applying digital gain.
//
-// It temporarily implements a hard-coded gain mode only.
+// It temporarily implements a fixed gain mode with hard-clipping.
peah-webrtc 2017/09/15 07:44:25 It temporarily -> Temporarily
AleBzk 2017/09/29 09:39:06 Done.
class GainController2 {
public:
- explicit GainController2(int sample_rate_hz);
+ explicit GainController2();
~GainController2();
int sample_rate_hz() { return sample_rate_hz_; }
+ float fixed_gain() { return fixed_gain_; }
+ void Initialize(int sample_rate_hz);
void Process(AudioBuffer* audio);
+ void ApplyConfig(const AudioProcessing::Config::GainController2& config);
static bool Validate(const AudioProcessing::Config::GainController2& config);
static std::string ToString(
const AudioProcessing::Config::GainController2& config);
private:
- int sample_rate_hz_;
std::unique_ptr<ApmDataDumper> data_dumper_;
- DigitalGainApplier digital_gain_applier_;
+ int sample_rate_hz_;
+ float fixed_gain_;
static int instance_count_;
peah-webrtc 2017/09/15 07:44:25 Please move this declaration to before data_dumper
AleBzk 2017/09/29 09:39:06 Done.
- // TODO(alessiob): Remove once a meaningful gain controller mode is
- // implemented.
- const float gain_;
+
RTC_DISALLOW_COPY_AND_ASSIGN(GainController2);
};

Powered by Google App Engine
This is Rietveld 408576698