alessiob | 3ec96df | 2017-05-22 06:57:06 -0700 | [diff] [blame] | 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 | |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 11 | #include "modules/audio_processing/gain_controller2.h" |
| 12 | |
Alessio Bazzica | 270f7b5 | 2017-10-13 11:05:17 +0200 | [diff] [blame] | 13 | #include <algorithm> |
Alessio Bazzica | 980c460 | 2021-04-14 19:09:17 +0200 | [diff] [blame] | 14 | #include <cmath> |
Mirko Bonadei | 317a1f0 | 2019-09-17 17:06:18 +0200 | [diff] [blame] | 15 | #include <memory> |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 16 | #include <numeric> |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 17 | #include <tuple> |
alessiob | 3ec96df | 2017-05-22 06:57:06 -0700 | [diff] [blame] | 18 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 19 | #include "api/array_view.h" |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 20 | #include "modules/audio_processing/agc2/agc2_testing_common.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 21 | #include "modules/audio_processing/audio_buffer.h" |
Alex Loiko | 5e78461 | 2018-11-01 14:51:56 +0100 | [diff] [blame] | 22 | #include "modules/audio_processing/test/audio_buffer_tools.h" |
| 23 | #include "modules/audio_processing/test/bitexactness_tools.h" |
Alessio Bazzica | 270f7b5 | 2017-10-13 11:05:17 +0200 | [diff] [blame] | 24 | #include "rtc_base/checks.h" |
Hanna Silen | d7cfbe3 | 2022-11-02 19:12:20 +0100 | [diff] [blame^] | 25 | #include "test/gmock.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 26 | #include "test/gtest.h" |
alessiob | 3ec96df | 2017-05-22 06:57:06 -0700 | [diff] [blame] | 27 | |
| 28 | namespace webrtc { |
| 29 | namespace test { |
alessiob | 3ec96df | 2017-05-22 06:57:06 -0700 | [diff] [blame] | 30 | namespace { |
| 31 | |
Hanna Silen | d7cfbe3 | 2022-11-02 19:12:20 +0100 | [diff] [blame^] | 32 | using ::testing::Eq; |
| 33 | using ::testing::Optional; |
| 34 | |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 35 | using Agc2Config = AudioProcessing::Config::GainController2; |
| 36 | |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 37 | // Sets all the samples in `ab` to `value`. |
| 38 | void SetAudioBufferSamples(float value, AudioBuffer& ab) { |
| 39 | for (size_t k = 0; k < ab.num_channels(); ++k) { |
| 40 | std::fill(ab.channels()[k], ab.channels()[k] + ab.num_frames(), value); |
alessiob | 3ec96df | 2017-05-22 06:57:06 -0700 | [diff] [blame] | 41 | } |
| 42 | } |
| 43 | |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 44 | float RunAgc2WithConstantInput(GainController2& agc2, |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 45 | float input_level, |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 46 | int num_frames, |
Hanna Silen | d7cfbe3 | 2022-11-02 19:12:20 +0100 | [diff] [blame^] | 47 | int sample_rate_hz, |
| 48 | int num_channels = 1, |
| 49 | int applied_initial_volume = 0) { |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 50 | const int num_samples = rtc::CheckedDivExact(sample_rate_hz, 100); |
Hanna Silen | d7cfbe3 | 2022-11-02 19:12:20 +0100 | [diff] [blame^] | 51 | AudioBuffer ab(sample_rate_hz, num_channels, sample_rate_hz, num_channels, |
| 52 | sample_rate_hz, num_channels); |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 53 | |
| 54 | // Give time to the level estimator to converge. |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 55 | for (int i = 0; i < num_frames + 1; ++i) { |
| 56 | SetAudioBufferSamples(input_level, ab); |
Hanna Silen | d7cfbe3 | 2022-11-02 19:12:20 +0100 | [diff] [blame^] | 57 | const auto applied_volume = agc2.GetRecommendedInputVolume(); |
| 58 | agc2.Analyze(i > 0 && applied_volume.has_value() ? *applied_volume |
| 59 | : applied_initial_volume, |
| 60 | ab); |
Alessio Bazzica | fcf1af3 | 2022-09-07 17:14:26 +0200 | [diff] [blame] | 61 | agc2.Process(/*speech_probability=*/absl::nullopt, |
| 62 | /*input_volume_changed=*/false, &ab); |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | // Return the last sample from the last processed frame. |
Per Ã…hgren | d47941e | 2019-08-22 11:51:13 +0200 | [diff] [blame] | 66 | return ab.channels()[0][num_samples - 1]; |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 67 | } |
| 68 | |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 69 | std::unique_ptr<GainController2> CreateAgc2FixedDigitalMode( |
| 70 | float fixed_gain_db, |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 71 | int sample_rate_hz) { |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 72 | Agc2Config config; |
| 73 | config.adaptive_digital.enabled = false; |
| 74 | config.fixed_digital.gain_db = fixed_gain_db; |
| 75 | EXPECT_TRUE(GainController2::Validate(config)); |
| 76 | return std::make_unique<GainController2>(config, sample_rate_hz, |
Hanna Silen | 0c1ad29 | 2022-06-16 16:35:45 +0200 | [diff] [blame] | 77 | /*num_channels=*/1, |
| 78 | /*use_internal_vad=*/true); |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 79 | } |
| 80 | |
alessiob | 3ec96df | 2017-05-22 06:57:06 -0700 | [diff] [blame] | 81 | } // namespace |
| 82 | |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 83 | TEST(GainController2, CheckDefaultConfig) { |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 84 | Agc2Config config; |
Alessio Bazzica | 270f7b5 | 2017-10-13 11:05:17 +0200 | [diff] [blame] | 85 | EXPECT_TRUE(GainController2::Validate(config)); |
alessiob | 3ec96df | 2017-05-22 06:57:06 -0700 | [diff] [blame] | 86 | } |
| 87 | |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 88 | TEST(GainController2, CheckFixedDigitalConfig) { |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 89 | Agc2Config config; |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 90 | // Attenuation is not allowed. |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 91 | config.fixed_digital.gain_db = -5.0f; |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 92 | EXPECT_FALSE(GainController2::Validate(config)); |
| 93 | // No gain is allowed. |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 94 | config.fixed_digital.gain_db = 0.0f; |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 95 | EXPECT_TRUE(GainController2::Validate(config)); |
| 96 | // Positive gain is allowed. |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 97 | config.fixed_digital.gain_db = 15.0f; |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 98 | EXPECT_TRUE(GainController2::Validate(config)); |
| 99 | } |
alessiob | 3ec96df | 2017-05-22 06:57:06 -0700 | [diff] [blame] | 100 | |
Alessio Bazzica | a850e6c | 2021-10-04 13:35:55 +0200 | [diff] [blame] | 101 | TEST(GainController2, CheckHeadroomDb) { |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 102 | Agc2Config config; |
Alessio Bazzica | a850e6c | 2021-10-04 13:35:55 +0200 | [diff] [blame] | 103 | config.adaptive_digital.headroom_db = -1.0f; |
| 104 | EXPECT_FALSE(GainController2::Validate(config)); |
| 105 | config.adaptive_digital.headroom_db = 0.0f; |
| 106 | EXPECT_TRUE(GainController2::Validate(config)); |
| 107 | config.adaptive_digital.headroom_db = 5.0f; |
| 108 | EXPECT_TRUE(GainController2::Validate(config)); |
| 109 | } |
| 110 | |
| 111 | TEST(GainController2, CheckMaxGainDb) { |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 112 | Agc2Config config; |
Alessio Bazzica | a850e6c | 2021-10-04 13:35:55 +0200 | [diff] [blame] | 113 | config.adaptive_digital.max_gain_db = -1.0f; |
| 114 | EXPECT_FALSE(GainController2::Validate(config)); |
| 115 | config.adaptive_digital.max_gain_db = 0.0f; |
| 116 | EXPECT_FALSE(GainController2::Validate(config)); |
| 117 | config.adaptive_digital.max_gain_db = 5.0f; |
| 118 | EXPECT_TRUE(GainController2::Validate(config)); |
| 119 | } |
| 120 | |
| 121 | TEST(GainController2, CheckInitialGainDb) { |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 122 | Agc2Config config; |
Alessio Bazzica | a850e6c | 2021-10-04 13:35:55 +0200 | [diff] [blame] | 123 | config.adaptive_digital.initial_gain_db = -1.0f; |
| 124 | EXPECT_FALSE(GainController2::Validate(config)); |
| 125 | config.adaptive_digital.initial_gain_db = 0.0f; |
| 126 | EXPECT_TRUE(GainController2::Validate(config)); |
| 127 | config.adaptive_digital.initial_gain_db = 5.0f; |
| 128 | EXPECT_TRUE(GainController2::Validate(config)); |
| 129 | } |
| 130 | |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 131 | TEST(GainController2, CheckAdaptiveDigitalMaxGainChangeSpeedConfig) { |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 132 | Agc2Config config; |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 133 | config.adaptive_digital.max_gain_change_db_per_second = -1.0f; |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 134 | EXPECT_FALSE(GainController2::Validate(config)); |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 135 | config.adaptive_digital.max_gain_change_db_per_second = 0.0f; |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 136 | EXPECT_FALSE(GainController2::Validate(config)); |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 137 | config.adaptive_digital.max_gain_change_db_per_second = 5.0f; |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 138 | EXPECT_TRUE(GainController2::Validate(config)); |
| 139 | } |
| 140 | |
| 141 | TEST(GainController2, CheckAdaptiveDigitalMaxOutputNoiseLevelConfig) { |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 142 | Agc2Config config; |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 143 | config.adaptive_digital.max_output_noise_level_dbfs = 5.0f; |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 144 | EXPECT_FALSE(GainController2::Validate(config)); |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 145 | config.adaptive_digital.max_output_noise_level_dbfs = 0.0f; |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 146 | EXPECT_TRUE(GainController2::Validate(config)); |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 147 | config.adaptive_digital.max_output_noise_level_dbfs = -5.0f; |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 148 | EXPECT_TRUE(GainController2::Validate(config)); |
| 149 | } |
| 150 | |
Hanna Silen | d7cfbe3 | 2022-11-02 19:12:20 +0100 | [diff] [blame^] | 151 | TEST(GainController2, |
| 152 | CheckGetRecommendedInputVolumeWhenInputVolumeControllerNotEnabled) { |
| 153 | constexpr float kHighInputLevel = 32767.0f; |
| 154 | constexpr float kLowInputLevel = 1000.0f; |
| 155 | constexpr int kInitialInputVolume = 100; |
| 156 | constexpr int kNumChannels = 2; |
| 157 | constexpr int kNumFrames = 5; |
| 158 | constexpr int kSampleRateHz = 16000; |
| 159 | |
| 160 | Agc2Config config; |
| 161 | config.input_volume_controller.enabled = false; |
| 162 | auto gain_controller = |
| 163 | std::make_unique<GainController2>(config, kSampleRateHz, kNumChannels, |
| 164 | /*use_internal_vad=*/true); |
| 165 | |
| 166 | EXPECT_FALSE(gain_controller->GetRecommendedInputVolume().has_value()); |
| 167 | |
| 168 | // Run AGC for a signal with no clipping or detected speech. |
| 169 | RunAgc2WithConstantInput(*gain_controller, kLowInputLevel, kNumFrames, |
| 170 | kSampleRateHz, kNumChannels, kInitialInputVolume); |
| 171 | |
| 172 | EXPECT_FALSE(gain_controller->GetRecommendedInputVolume().has_value()); |
| 173 | |
| 174 | // Run AGC for a signal with clipping. |
| 175 | RunAgc2WithConstantInput(*gain_controller, kHighInputLevel, kNumFrames, |
| 176 | kSampleRateHz, kNumChannels, kInitialInputVolume); |
| 177 | |
| 178 | EXPECT_FALSE(gain_controller->GetRecommendedInputVolume().has_value()); |
| 179 | } |
| 180 | |
| 181 | TEST(GainController2, |
| 182 | CheckGetRecommendedInputVolumeWhenInputVolumeControllerEnabled) { |
| 183 | constexpr float kHighInputLevel = 32767.0f; |
| 184 | constexpr float kLowInputLevel = 1000.0f; |
| 185 | constexpr int kInitialInputVolume = 100; |
| 186 | constexpr int kNumChannels = 2; |
| 187 | constexpr int kNumFrames = 5; |
| 188 | constexpr int kSampleRateHz = 16000; |
| 189 | |
| 190 | Agc2Config config; |
| 191 | config.input_volume_controller.enabled = true; |
| 192 | auto gain_controller = |
| 193 | std::make_unique<GainController2>(config, kSampleRateHz, kNumChannels, |
| 194 | /*use_internal_vad=*/true); |
| 195 | |
| 196 | EXPECT_TRUE(gain_controller->GetRecommendedInputVolume().has_value()); |
| 197 | |
| 198 | // Run AGC for a signal with no clipping or detected speech. |
| 199 | RunAgc2WithConstantInput(*gain_controller, kLowInputLevel, kNumFrames, |
| 200 | kSampleRateHz, kNumChannels, kInitialInputVolume); |
| 201 | |
| 202 | EXPECT_TRUE(gain_controller->GetRecommendedInputVolume().has_value()); |
| 203 | |
| 204 | // Run AGC for a signal with clipping. |
| 205 | RunAgc2WithConstantInput(*gain_controller, kHighInputLevel, kNumFrames, |
| 206 | kSampleRateHz, kNumChannels, kInitialInputVolume); |
| 207 | |
| 208 | EXPECT_TRUE(gain_controller->GetRecommendedInputVolume().has_value()); |
| 209 | } |
| 210 | |
Alessio Bazzica | 0c83e15 | 2020-10-14 12:49:54 +0200 | [diff] [blame] | 211 | // Checks that the default config is applied. |
| 212 | TEST(GainController2, ApplyDefaultConfig) { |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 213 | auto gain_controller2 = std::make_unique<GainController2>( |
Hanna Silen | 0c1ad29 | 2022-06-16 16:35:45 +0200 | [diff] [blame] | 214 | Agc2Config{}, /*sample_rate_hz=*/16000, /*num_channels=*/2, |
| 215 | /*use_internal_vad=*/true); |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 216 | EXPECT_TRUE(gain_controller2.get()); |
alessiob | 3ec96df | 2017-05-22 06:57:06 -0700 | [diff] [blame] | 217 | } |
| 218 | |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 219 | TEST(GainController2FixedDigital, GainShouldChangeOnSetGain) { |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 220 | constexpr float kInputLevel = 1000.0f; |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 221 | constexpr size_t kNumFrames = 5; |
| 222 | constexpr size_t kSampleRateHz = 8000; |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 223 | constexpr float kGain0Db = 0.0f; |
| 224 | constexpr float kGain20Db = 20.0f; |
Alessio Bazzica | 270f7b5 | 2017-10-13 11:05:17 +0200 | [diff] [blame] | 225 | |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 226 | auto agc2_fixed = CreateAgc2FixedDigitalMode(kGain0Db, kSampleRateHz); |
| 227 | |
| 228 | // Signal level is unchanged with 0 db gain. |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 229 | EXPECT_FLOAT_EQ(RunAgc2WithConstantInput(*agc2_fixed, kInputLevel, kNumFrames, |
| 230 | kSampleRateHz), |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 231 | kInputLevel); |
| 232 | |
| 233 | // +20 db should increase signal by a factor of 10. |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 234 | agc2_fixed->SetFixedGainDb(kGain20Db); |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 235 | EXPECT_FLOAT_EQ(RunAgc2WithConstantInput(*agc2_fixed, kInputLevel, kNumFrames, |
| 236 | kSampleRateHz), |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 237 | kInputLevel * 10); |
alessiob | 3ec96df | 2017-05-22 06:57:06 -0700 | [diff] [blame] | 238 | } |
| 239 | |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 240 | TEST(GainController2FixedDigital, ChangeFixedGainShouldBeFastAndTimeInvariant) { |
| 241 | // Number of frames required for the fixed gain controller to adapt on the |
| 242 | // input signal when the gain changes. |
| 243 | constexpr size_t kNumFrames = 5; |
Alex Loiko | 5e78461 | 2018-11-01 14:51:56 +0100 | [diff] [blame] | 244 | |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 245 | constexpr float kInputLevel = 1000.0f; |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 246 | constexpr size_t kSampleRateHz = 8000; |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 247 | constexpr float kGainDbLow = 0.0f; |
| 248 | constexpr float kGainDbHigh = 25.0f; |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 249 | static_assert(kGainDbLow < kGainDbHigh, ""); |
Alex Loiko | 5e78461 | 2018-11-01 14:51:56 +0100 | [diff] [blame] | 250 | |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 251 | auto agc2_fixed = CreateAgc2FixedDigitalMode(kGainDbLow, kSampleRateHz); |
| 252 | |
| 253 | // Start with a lower gain. |
| 254 | const float output_level_pre = RunAgc2WithConstantInput( |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 255 | *agc2_fixed, kInputLevel, kNumFrames, kSampleRateHz); |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 256 | |
| 257 | // Increase gain. |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 258 | agc2_fixed->SetFixedGainDb(kGainDbHigh); |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 259 | static_cast<void>(RunAgc2WithConstantInput(*agc2_fixed, kInputLevel, |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 260 | kNumFrames, kSampleRateHz)); |
| 261 | |
| 262 | // Back to the lower gain. |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 263 | agc2_fixed->SetFixedGainDb(kGainDbLow); |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 264 | const float output_level_post = RunAgc2WithConstantInput( |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 265 | *agc2_fixed, kInputLevel, kNumFrames, kSampleRateHz); |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 266 | |
| 267 | EXPECT_EQ(output_level_pre, output_level_post); |
| 268 | } |
| 269 | |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 270 | class FixedDigitalTest |
| 271 | : public ::testing::TestWithParam<std::tuple<float, float, int, bool>> { |
| 272 | protected: |
| 273 | float gain_db_min() const { return std::get<0>(GetParam()); } |
| 274 | float gain_db_max() const { return std::get<1>(GetParam()); } |
| 275 | int sample_rate_hz() const { return std::get<2>(GetParam()); } |
| 276 | bool saturation_expected() const { return std::get<3>(GetParam()); } |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 277 | }; |
| 278 | |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 279 | TEST_P(FixedDigitalTest, CheckSaturationBehaviorWithLimiter) { |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 280 | for (const float gain_db : test::LinSpace(gain_db_min(), gain_db_max(), 10)) { |
| 281 | SCOPED_TRACE(gain_db); |
| 282 | auto agc2_fixed = CreateAgc2FixedDigitalMode(gain_db, sample_rate_hz()); |
| 283 | const float processed_sample = |
| 284 | RunAgc2WithConstantInput(*agc2_fixed, /*input_level=*/32767.0f, |
| 285 | /*num_frames=*/5, sample_rate_hz()); |
| 286 | if (saturation_expected()) { |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 287 | EXPECT_FLOAT_EQ(processed_sample, 32767.0f); |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 288 | } else { |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 289 | EXPECT_LT(processed_sample, 32767.0f); |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 290 | } |
Alex Loiko | 5e78461 | 2018-11-01 14:51:56 +0100 | [diff] [blame] | 291 | } |
Alex Loiko | 5e78461 | 2018-11-01 14:51:56 +0100 | [diff] [blame] | 292 | } |
| 293 | |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 294 | static_assert(test::kLimiterMaxInputLevelDbFs < 10, ""); |
Mirko Bonadei | c84f661 | 2019-01-31 12:20:57 +0100 | [diff] [blame] | 295 | INSTANTIATE_TEST_SUITE_P( |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 296 | GainController2, |
| 297 | FixedDigitalTest, |
| 298 | ::testing::Values( |
Artem Titov | cfea218 | 2021-08-10 01:22:31 +0200 | [diff] [blame] | 299 | // When gain < `test::kLimiterMaxInputLevelDbFs`, the limiter will not |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 300 | // saturate the signal (at any sample rate). |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 301 | std::make_tuple(0.1f, |
| 302 | test::kLimiterMaxInputLevelDbFs - 0.01f, |
| 303 | 8000, |
| 304 | false), |
| 305 | std::make_tuple(0.1, |
| 306 | test::kLimiterMaxInputLevelDbFs - 0.01f, |
| 307 | 48000, |
| 308 | false), |
Artem Titov | cfea218 | 2021-08-10 01:22:31 +0200 | [diff] [blame] | 309 | // When gain > `test::kLimiterMaxInputLevelDbFs`, the limiter will |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 310 | // saturate the signal (at any sample rate). |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 311 | std::make_tuple(test::kLimiterMaxInputLevelDbFs + 0.01f, |
| 312 | 10.0f, |
| 313 | 8000, |
| 314 | true), |
| 315 | std::make_tuple(test::kLimiterMaxInputLevelDbFs + 0.01f, |
| 316 | 10.0f, |
| 317 | 48000, |
| 318 | true))); |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 319 | |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 320 | // Processes a test audio file and checks that the gain applied at the end of |
| 321 | // the recording is close to the expected value. |
| 322 | TEST(GainController2, CheckFinalGainWithAdaptiveDigitalController) { |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 323 | constexpr int kSampleRateHz = AudioProcessing::kSampleRate48kHz; |
| 324 | constexpr int kStereo = 2; |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 325 | |
| 326 | // Create AGC2 enabling only the adaptive digital controller. |
| 327 | Agc2Config config; |
| 328 | config.fixed_digital.gain_db = 0.0f; |
| 329 | config.adaptive_digital.enabled = true; |
Hanna Silen | 0c1ad29 | 2022-06-16 16:35:45 +0200 | [diff] [blame] | 330 | GainController2 agc2(config, kSampleRateHz, kStereo, |
| 331 | /*use_internal_vad=*/true); |
Alessio Bazzica | 3890104 | 2021-10-14 12:14:21 +0200 | [diff] [blame] | 332 | |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 333 | test::InputAudioFile input_file( |
| 334 | test::GetApmCaptureTestVectorFileName(kSampleRateHz), |
| 335 | /*loop_at_end=*/true); |
Henrik Lundin | 64253a9 | 2022-02-04 09:02:48 +0000 | [diff] [blame] | 336 | const StreamConfig stream_config(kSampleRateHz, kStereo); |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 337 | |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 338 | // Init buffers. |
| 339 | constexpr int kFrameDurationMs = 10; |
| 340 | std::vector<float> frame(kStereo * stream_config.num_frames()); |
| 341 | AudioBuffer audio_buffer(kSampleRateHz, kStereo, kSampleRateHz, kStereo, |
| 342 | kSampleRateHz, kStereo); |
| 343 | |
| 344 | // Simulate. |
| 345 | constexpr float kGainDb = -6.0f; |
| 346 | const float gain = std::pow(10.0f, kGainDb / 20.0f); |
| 347 | constexpr int kDurationMs = 10000; |
| 348 | constexpr int kNumFramesToProcess = kDurationMs / kFrameDurationMs; |
| 349 | for (int i = 0; i < kNumFramesToProcess; ++i) { |
| 350 | ReadFloatSamplesFromStereoFile(stream_config.num_frames(), |
| 351 | stream_config.num_channels(), &input_file, |
| 352 | frame); |
| 353 | // Apply a fixed gain to the input audio. |
Hanna Silen | 0c1ad29 | 2022-06-16 16:35:45 +0200 | [diff] [blame] | 354 | for (float& x : frame) { |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 355 | x *= gain; |
Hanna Silen | 0c1ad29 | 2022-06-16 16:35:45 +0200 | [diff] [blame] | 356 | } |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 357 | test::CopyVectorToAudioBuffer(stream_config, frame, &audio_buffer); |
Alessio Bazzica | fcf1af3 | 2022-09-07 17:14:26 +0200 | [diff] [blame] | 358 | agc2.Process(/*speech_probability=*/absl::nullopt, |
| 359 | /*input_volume_changed=*/false, &audio_buffer); |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 360 | } |
| 361 | |
| 362 | // Estimate the applied gain by processing a probing frame. |
| 363 | SetAudioBufferSamples(/*value=*/1.0f, audio_buffer); |
Alessio Bazzica | fcf1af3 | 2022-09-07 17:14:26 +0200 | [diff] [blame] | 364 | agc2.Process(/*speech_probability=*/absl::nullopt, |
| 365 | /*input_volume_changed=*/false, &audio_buffer); |
Alessio Bazzica | 6ee9734 | 2021-09-27 17:06:40 +0200 | [diff] [blame] | 366 | const float applied_gain_db = |
| 367 | 20.0f * std::log10(audio_buffer.channels_const()[0][0]); |
| 368 | |
| 369 | constexpr float kExpectedGainDb = 5.6f; |
| 370 | constexpr float kToleranceDb = 0.3f; |
| 371 | EXPECT_NEAR(applied_gain_db, kExpectedGainDb, kToleranceDb); |
Alex Loiko | 5e78461 | 2018-11-01 14:51:56 +0100 | [diff] [blame] | 372 | } |
Alessio Bazzica | 3e4c77f | 2018-11-01 21:31:38 +0100 | [diff] [blame] | 373 | |
Hanna Silen | 0c1ad29 | 2022-06-16 16:35:45 +0200 | [diff] [blame] | 374 | // Processes a test audio file and checks that the injected speech probability |
| 375 | // is ignored when the internal VAD is used. |
| 376 | TEST(GainController2, |
| 377 | CheckInjectedVadProbabilityNotUsedWithAdaptiveDigitalController) { |
| 378 | constexpr int kSampleRateHz = AudioProcessing::kSampleRate48kHz; |
| 379 | constexpr int kStereo = 2; |
| 380 | |
| 381 | // Create AGC2 enabling only the adaptive digital controller. |
| 382 | Agc2Config config; |
| 383 | config.fixed_digital.gain_db = 0.0f; |
| 384 | config.adaptive_digital.enabled = true; |
| 385 | GainController2 agc2(config, kSampleRateHz, kStereo, |
| 386 | /*use_internal_vad=*/true); |
| 387 | GainController2 agc2_reference(config, kSampleRateHz, kStereo, |
| 388 | /*use_internal_vad=*/true); |
| 389 | |
| 390 | test::InputAudioFile input_file( |
| 391 | test::GetApmCaptureTestVectorFileName(kSampleRateHz), |
| 392 | /*loop_at_end=*/true); |
| 393 | const StreamConfig stream_config(kSampleRateHz, kStereo); |
| 394 | |
| 395 | // Init buffers. |
| 396 | constexpr int kFrameDurationMs = 10; |
| 397 | std::vector<float> frame(kStereo * stream_config.num_frames()); |
| 398 | AudioBuffer audio_buffer(kSampleRateHz, kStereo, kSampleRateHz, kStereo, |
| 399 | kSampleRateHz, kStereo); |
| 400 | AudioBuffer audio_buffer_reference(kSampleRateHz, kStereo, kSampleRateHz, |
| 401 | kStereo, kSampleRateHz, kStereo); |
| 402 | |
| 403 | // Simulate. |
| 404 | constexpr float kGainDb = -6.0f; |
| 405 | const float gain = std::pow(10.0f, kGainDb / 20.0f); |
| 406 | constexpr int kDurationMs = 10000; |
| 407 | constexpr int kNumFramesToProcess = kDurationMs / kFrameDurationMs; |
| 408 | constexpr float kSpeechProbabilities[] = {1.0f, 0.3f}; |
| 409 | constexpr float kEpsilon = 0.0001f; |
| 410 | bool all_samples_zero = true; |
| 411 | for (int i = 0, j = 0; i < kNumFramesToProcess; ++i, j = 1 - j) { |
| 412 | ReadFloatSamplesFromStereoFile(stream_config.num_frames(), |
| 413 | stream_config.num_channels(), &input_file, |
| 414 | frame); |
| 415 | // Apply a fixed gain to the input audio. |
| 416 | for (float& x : frame) { |
| 417 | x *= gain; |
| 418 | } |
| 419 | test::CopyVectorToAudioBuffer(stream_config, frame, &audio_buffer); |
Alessio Bazzica | fcf1af3 | 2022-09-07 17:14:26 +0200 | [diff] [blame] | 420 | agc2.Process(kSpeechProbabilities[j], /*input_volume_changed=*/false, |
| 421 | &audio_buffer); |
Hanna Silen | 0c1ad29 | 2022-06-16 16:35:45 +0200 | [diff] [blame] | 422 | test::CopyVectorToAudioBuffer(stream_config, frame, |
| 423 | &audio_buffer_reference); |
Alessio Bazzica | fcf1af3 | 2022-09-07 17:14:26 +0200 | [diff] [blame] | 424 | agc2_reference.Process(/*speech_probability=*/absl::nullopt, |
| 425 | /*input_volume_changed=*/false, |
| 426 | &audio_buffer_reference); |
Hanna Silen | 0c1ad29 | 2022-06-16 16:35:45 +0200 | [diff] [blame] | 427 | |
| 428 | // Check the output buffers. |
| 429 | for (int i = 0; i < kStereo; ++i) { |
| 430 | for (int j = 0; j < static_cast<int>(audio_buffer.num_frames()); ++j) { |
| 431 | all_samples_zero &= |
| 432 | fabs(audio_buffer.channels_const()[i][j]) < kEpsilon; |
| 433 | EXPECT_FLOAT_EQ(audio_buffer.channels_const()[i][j], |
| 434 | audio_buffer_reference.channels_const()[i][j]); |
| 435 | } |
| 436 | } |
| 437 | } |
| 438 | EXPECT_FALSE(all_samples_zero); |
| 439 | } |
| 440 | |
| 441 | // Processes a test audio file and checks that the injected speech probability |
| 442 | // is not ignored when the internal VAD is not used. |
| 443 | TEST(GainController2, |
| 444 | CheckInjectedVadProbabilityUsedWithAdaptiveDigitalController) { |
| 445 | constexpr int kSampleRateHz = AudioProcessing::kSampleRate48kHz; |
| 446 | constexpr int kStereo = 2; |
| 447 | |
| 448 | // Create AGC2 enabling only the adaptive digital controller. |
| 449 | Agc2Config config; |
| 450 | config.fixed_digital.gain_db = 0.0f; |
| 451 | config.adaptive_digital.enabled = true; |
| 452 | GainController2 agc2(config, kSampleRateHz, kStereo, |
| 453 | /*use_internal_vad=*/false); |
| 454 | GainController2 agc2_reference(config, kSampleRateHz, kStereo, |
| 455 | /*use_internal_vad=*/true); |
| 456 | |
| 457 | test::InputAudioFile input_file( |
| 458 | test::GetApmCaptureTestVectorFileName(kSampleRateHz), |
| 459 | /*loop_at_end=*/true); |
| 460 | const StreamConfig stream_config(kSampleRateHz, kStereo); |
| 461 | |
| 462 | // Init buffers. |
| 463 | constexpr int kFrameDurationMs = 10; |
| 464 | std::vector<float> frame(kStereo * stream_config.num_frames()); |
| 465 | AudioBuffer audio_buffer(kSampleRateHz, kStereo, kSampleRateHz, kStereo, |
| 466 | kSampleRateHz, kStereo); |
| 467 | AudioBuffer audio_buffer_reference(kSampleRateHz, kStereo, kSampleRateHz, |
| 468 | kStereo, kSampleRateHz, kStereo); |
| 469 | // Simulate. |
| 470 | constexpr float kGainDb = -6.0f; |
| 471 | const float gain = std::pow(10.0f, kGainDb / 20.0f); |
| 472 | constexpr int kDurationMs = 10000; |
| 473 | constexpr int kNumFramesToProcess = kDurationMs / kFrameDurationMs; |
| 474 | constexpr float kSpeechProbabilities[] = {1.0f, 0.3f}; |
| 475 | constexpr float kEpsilon = 0.0001f; |
| 476 | bool all_samples_zero = true; |
| 477 | bool all_samples_equal = true; |
| 478 | for (int i = 0, j = 0; i < kNumFramesToProcess; ++i, j = 1 - j) { |
| 479 | ReadFloatSamplesFromStereoFile(stream_config.num_frames(), |
| 480 | stream_config.num_channels(), &input_file, |
| 481 | frame); |
| 482 | // Apply a fixed gain to the input audio. |
| 483 | for (float& x : frame) { |
| 484 | x *= gain; |
| 485 | } |
| 486 | test::CopyVectorToAudioBuffer(stream_config, frame, &audio_buffer); |
Alessio Bazzica | fcf1af3 | 2022-09-07 17:14:26 +0200 | [diff] [blame] | 487 | agc2.Process(kSpeechProbabilities[j], /*input_volume_changed=*/false, |
| 488 | &audio_buffer); |
Hanna Silen | 0c1ad29 | 2022-06-16 16:35:45 +0200 | [diff] [blame] | 489 | test::CopyVectorToAudioBuffer(stream_config, frame, |
| 490 | &audio_buffer_reference); |
Alessio Bazzica | fcf1af3 | 2022-09-07 17:14:26 +0200 | [diff] [blame] | 491 | agc2_reference.Process(/*speech_probability=*/absl::nullopt, |
| 492 | /*input_volume_changed=*/false, |
| 493 | &audio_buffer_reference); |
Hanna Silen | 0c1ad29 | 2022-06-16 16:35:45 +0200 | [diff] [blame] | 494 | // Check the output buffers. |
| 495 | for (int i = 0; i < kStereo; ++i) { |
| 496 | for (int j = 0; j < static_cast<int>(audio_buffer.num_frames()); ++j) { |
| 497 | all_samples_zero &= |
| 498 | fabs(audio_buffer.channels_const()[i][j]) < kEpsilon; |
| 499 | all_samples_equal &= |
| 500 | fabs(audio_buffer.channels_const()[i][j] - |
| 501 | audio_buffer_reference.channels_const()[i][j]) < kEpsilon; |
| 502 | } |
| 503 | } |
| 504 | } |
| 505 | EXPECT_FALSE(all_samples_zero); |
| 506 | EXPECT_FALSE(all_samples_equal); |
| 507 | } |
| 508 | |
| 509 | // Processes a test audio file and checks that the output is equal when |
| 510 | // an injected speech probability from `VoiceActivityDetectorWrapper` and |
| 511 | // the speech probability computed by the internal VAD are the same. |
| 512 | TEST(GainController2, |
| 513 | CheckEqualResultFromInjectedVadProbabilityWithAdaptiveDigitalController) { |
| 514 | constexpr int kSampleRateHz = AudioProcessing::kSampleRate48kHz; |
| 515 | constexpr int kStereo = 2; |
| 516 | |
| 517 | // Create AGC2 enabling only the adaptive digital controller. |
| 518 | Agc2Config config; |
| 519 | config.fixed_digital.gain_db = 0.0f; |
| 520 | config.adaptive_digital.enabled = true; |
| 521 | GainController2 agc2(config, kSampleRateHz, kStereo, |
| 522 | /*use_internal_vad=*/false); |
| 523 | GainController2 agc2_reference(config, kSampleRateHz, kStereo, |
| 524 | /*use_internal_vad=*/true); |
| 525 | VoiceActivityDetectorWrapper vad(config.adaptive_digital.vad_reset_period_ms, |
| 526 | GetAvailableCpuFeatures(), kSampleRateHz); |
| 527 | test::InputAudioFile input_file( |
| 528 | test::GetApmCaptureTestVectorFileName(kSampleRateHz), |
| 529 | /*loop_at_end=*/true); |
| 530 | const StreamConfig stream_config(kSampleRateHz, kStereo); |
| 531 | |
| 532 | // Init buffers. |
| 533 | constexpr int kFrameDurationMs = 10; |
| 534 | std::vector<float> frame(kStereo * stream_config.num_frames()); |
| 535 | AudioBuffer audio_buffer(kSampleRateHz, kStereo, kSampleRateHz, kStereo, |
| 536 | kSampleRateHz, kStereo); |
| 537 | AudioBuffer audio_buffer_reference(kSampleRateHz, kStereo, kSampleRateHz, |
| 538 | kStereo, kSampleRateHz, kStereo); |
| 539 | |
| 540 | // Simulate. |
| 541 | constexpr float kGainDb = -6.0f; |
| 542 | const float gain = std::pow(10.0f, kGainDb / 20.0f); |
| 543 | constexpr int kDurationMs = 10000; |
| 544 | constexpr int kNumFramesToProcess = kDurationMs / kFrameDurationMs; |
| 545 | for (int i = 0; i < kNumFramesToProcess; ++i) { |
| 546 | ReadFloatSamplesFromStereoFile(stream_config.num_frames(), |
| 547 | stream_config.num_channels(), &input_file, |
| 548 | frame); |
| 549 | // Apply a fixed gain to the input audio. |
| 550 | for (float& x : frame) { |
| 551 | x *= gain; |
| 552 | } |
| 553 | test::CopyVectorToAudioBuffer(stream_config, frame, |
| 554 | &audio_buffer_reference); |
Alessio Bazzica | fcf1af3 | 2022-09-07 17:14:26 +0200 | [diff] [blame] | 555 | agc2_reference.Process(absl::nullopt, /*input_volume_changed=*/false, |
| 556 | &audio_buffer_reference); |
Hanna Silen | 0c1ad29 | 2022-06-16 16:35:45 +0200 | [diff] [blame] | 557 | test::CopyVectorToAudioBuffer(stream_config, frame, &audio_buffer); |
Alessio Bazzica | fcf1af3 | 2022-09-07 17:14:26 +0200 | [diff] [blame] | 558 | float speech_probability = vad.Analyze(AudioFrameView<const float>( |
| 559 | audio_buffer.channels(), audio_buffer.num_channels(), |
| 560 | audio_buffer.num_frames())); |
| 561 | agc2.Process(speech_probability, /*input_volume_changed=*/false, |
Hanna Silen | 0c1ad29 | 2022-06-16 16:35:45 +0200 | [diff] [blame] | 562 | &audio_buffer); |
| 563 | // Check the output buffer. |
| 564 | for (int i = 0; i < kStereo; ++i) { |
| 565 | for (int j = 0; j < static_cast<int>(audio_buffer.num_frames()); ++j) { |
| 566 | EXPECT_FLOAT_EQ(audio_buffer.channels_const()[i][j], |
| 567 | audio_buffer_reference.channels_const()[i][j]); |
| 568 | } |
| 569 | } |
| 570 | } |
| 571 | } |
| 572 | |
alessiob | 3ec96df | 2017-05-22 06:57:06 -0700 | [diff] [blame] | 573 | } // namespace test |
| 574 | } // namespace webrtc |