#include "modules/audio_processing/agc2/saturation_protector.h"
#include "modules/audio_processing/agc2/agc2_common.h"
#include "modules/audio_processing/logging/apm_data_dumper.h"
#include "rtc_base/gunit.h"
namespace webrtc {
namespace {
constexpr float kInitialHeadroomDb = …;
constexpr int kNoAdjacentSpeechFramesRequired = …;
constexpr float kMaxSpeechProbability = …;
float RunOnConstantLevel(int num_iterations,
float speech_probability,
float peak_dbfs,
float speech_level_dbfs,
SaturationProtector& saturation_protector) { … }
TEST(GainController2SaturationProtector, Reset) { … }
TEST(GainController2SaturationProtector, EstimatesCrestRatio) { … }
TEST(GainController2SaturationProtector, ChangeSlowly) { … }
class SaturationProtectorParametrization
: public ::testing::TestWithParam<int> { … };
TEST_P(SaturationProtectorParametrization, DoNotAdaptToShortSpeechSegments) { … }
TEST_P(SaturationProtectorParametrization, AdaptToEnoughSpeechSegments) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}