| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
#ifndef MODULES_AUDIO_PROCESSING_AGC2_ADAPTIVE_AGC_H_ |
| 12 |
#define MODULES_AUDIO_PROCESSING_AGC2_ADAPTIVE_AGC_H_ |
| 13 |
|
| 14 |
#include <memory> |
| 15 |
|
| 16 |
#include "modules/audio_processing/agc2/adaptive_digital_gain_applier.h" |
| 17 |
#include "modules/audio_processing/agc2/adaptive_mode_level_estimator.h" |
| 18 |
#include "modules/audio_processing/agc2/noise_level_estimator.h" |
| 19 |
#include "modules/audio_processing/agc2/saturation_protector.h" |
| 20 |
#include "modules/audio_processing/agc2/vad_with_level.h" |
| 21 |
#include "modules/audio_processing/include/audio_frame_view.h" |
| 22 |
#include "modules/audio_processing/include/audio_processing.h" |
| 23 |
|
| 24 |
namespace webrtc { |
| 25 |
class ApmDataDumper; |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
class AdaptiveAgc { |
| 30 |
public: |
| 31 |
explicit AdaptiveAgc(ApmDataDumper* apm_data_dumper); |
| 32 |
|
| 33 |
AdaptiveAgc( |
| 34 |
ApmDataDumper* apm_data_dumper, |
| 35 |
const AudioProcessing::Config::GainController2::AdaptiveDigital& config); |
| 36 |
~AdaptiveAgc(); |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
void Process(AudioFrameView<float> frame, float limiter_envelope); |
| 42 |
|
| 43 |
|
| 44 |
void HandleInputGainChange(); |
| 45 |
|
| 46 |
private: |
| 47 |
AdaptiveModeLevelEstimator speech_level_estimator_; |
| 48 |
VadLevelAnalyzer vad_; |
| 49 |
AdaptiveDigitalGainApplier gain_controller_; |
| 50 |
ApmDataDumper* const apm_data_dumper_; |
| 51 |
std::unique_ptr<NoiseLevelEstimator> noise_level_estimator_; |
| 52 |
std::unique_ptr<SaturationProtector> saturation_protector_; |
| 53 |
}; |
| 54 |
|
| 55 |
} |
| 56 |
|
| 57 |
#endif |