blob: 3f86944e4d7c308f0321d495b28ddcd4ed69a20e [file] [log] [blame]
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +00001/*
2 * Copyright (c) 2013 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// Test to verify correct stereo and multi-channel operation.
12
henrik.lundin@webrtc.orgbe50ab62014-03-04 15:10:03 +000013#include <algorithm>
Yves Gerey665174f2018-06-19 15:03:05 +020014#include <list>
kwiberg2d0c3322016-02-14 09:28:33 -080015#include <memory>
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000016#include <string>
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000017
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +020018#include "api/audio/audio_frame.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020019#include "api/audio_codecs/builtin_audio_decoder_factory.h"
Mirko Bonadei71207422017-09-15 13:58:09 +020020#include "common_types.h" // NOLINT(build/include)
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020021#include "modules/audio_coding/codecs/pcm16b/pcm16b.h"
22#include "modules/audio_coding/neteq/include/neteq.h"
23#include "modules/audio_coding/neteq/tools/input_audio_file.h"
24#include "modules/audio_coding/neteq/tools/rtp_generator.h"
Jonas Olsson366a50c2018-09-06 13:41:30 +020025#include "rtc_base/strings/string_builder.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020026#include "test/gtest.h"
27#include "test/testsupport/fileutils.h"
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000028
29namespace webrtc {
30
31struct TestParameters {
32 int frame_size;
33 int sample_rate;
Peter Kasting69558702016-01-12 16:26:35 -080034 size_t num_channels;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000035};
36
37// This is a parameterized test. The test parameters are supplied through a
38// TestParameters struct, which is obtained through the GetParam() method.
39//
40// The objective of the test is to create a mono input signal and a
41// multi-channel input signal, where each channel is identical to the mono
42// input channel. The two input signals are processed through their respective
43// NetEq instances. After that, the output signals are compared. The expected
44// result is that each channel in the multi-channel output is identical to the
45// mono output.
46class NetEqStereoTest : public ::testing::TestWithParam<TestParameters> {
47 protected:
48 static const int kTimeStepMs = 10;
Peter Kastingdce40cf2015-08-24 14:52:23 -070049 static const size_t kMaxBlockSize = 480; // 10 ms @ 48 kHz.
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000050 static const uint8_t kPayloadTypeMono = 95;
51 static const uint8_t kPayloadTypeMulti = 96;
52
53 NetEqStereoTest()
54 : num_channels_(GetParam().num_channels),
55 sample_rate_hz_(GetParam().sample_rate),
56 samples_per_ms_(sample_rate_hz_ / 1000),
57 frame_size_ms_(GetParam().frame_size),
Peter Kastingdce40cf2015-08-24 14:52:23 -070058 frame_size_samples_(
59 static_cast<size_t>(frame_size_ms_ * samples_per_ms_)),
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000060 output_size_samples_(10 * samples_per_ms_),
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000061 rtp_generator_mono_(samples_per_ms_),
62 rtp_generator_(samples_per_ms_),
63 payload_size_bytes_(0),
64 multi_payload_size_bytes_(0),
65 last_send_time_(0),
66 last_arrival_time_(0) {
henrik.lundin@webrtc.org35ead382014-04-14 18:49:17 +000067 NetEq::Config config;
68 config.sample_rate_hz = sample_rate_hz_;
ossue3525782016-05-25 07:37:43 -070069 rtc::scoped_refptr<AudioDecoderFactory> factory =
70 CreateBuiltinAudioDecoderFactory();
71 neteq_mono_ = NetEq::Create(config, factory);
72 neteq_ = NetEq::Create(config, factory);
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000073 input_ = new int16_t[frame_size_samples_];
74 encoded_ = new uint8_t[2 * frame_size_samples_];
75 input_multi_channel_ = new int16_t[frame_size_samples_ * num_channels_];
Yves Gerey665174f2018-06-19 15:03:05 +020076 encoded_multi_channel_ =
77 new uint8_t[frame_size_samples_ * 2 * num_channels_];
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000078 }
79
80 ~NetEqStereoTest() {
81 delete neteq_mono_;
82 delete neteq_;
Yves Gerey665174f2018-06-19 15:03:05 +020083 delete[] input_;
84 delete[] encoded_;
85 delete[] input_multi_channel_;
86 delete[] encoded_multi_channel_;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000087 }
88
89 virtual void SetUp() {
90 const std::string file_name =
91 webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm");
92 input_file_.reset(new test::InputAudioFile(file_name));
93 NetEqDecoder mono_decoder;
94 NetEqDecoder multi_decoder;
95 switch (sample_rate_hz_) {
96 case 8000:
kwibergee1879c2015-10-29 06:20:28 -070097 mono_decoder = NetEqDecoder::kDecoderPCM16B;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000098 if (num_channels_ == 2) {
kwibergee1879c2015-10-29 06:20:28 -070099 multi_decoder = NetEqDecoder::kDecoderPCM16B_2ch;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000100 } else if (num_channels_ == 5) {
kwibergee1879c2015-10-29 06:20:28 -0700101 multi_decoder = NetEqDecoder::kDecoderPCM16B_5ch;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000102 } else {
103 FAIL() << "Only 2 and 5 channels supported for 8000 Hz.";
104 }
105 break;
106 case 16000:
kwibergee1879c2015-10-29 06:20:28 -0700107 mono_decoder = NetEqDecoder::kDecoderPCM16Bwb;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000108 if (num_channels_ == 2) {
kwibergee1879c2015-10-29 06:20:28 -0700109 multi_decoder = NetEqDecoder::kDecoderPCM16Bwb_2ch;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000110 } else {
111 FAIL() << "More than 2 channels is not supported for 16000 Hz.";
112 }
113 break;
114 case 32000:
kwibergee1879c2015-10-29 06:20:28 -0700115 mono_decoder = NetEqDecoder::kDecoderPCM16Bswb32kHz;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000116 if (num_channels_ == 2) {
kwibergee1879c2015-10-29 06:20:28 -0700117 multi_decoder = NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000118 } else {
119 FAIL() << "More than 2 channels is not supported for 32000 Hz.";
120 }
121 break;
122 case 48000:
kwibergee1879c2015-10-29 06:20:28 -0700123 mono_decoder = NetEqDecoder::kDecoderPCM16Bswb48kHz;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000124 if (num_channels_ == 2) {
kwibergee1879c2015-10-29 06:20:28 -0700125 multi_decoder = NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000126 } else {
127 FAIL() << "More than 2 channels is not supported for 48000 Hz.";
128 }
129 break;
130 default:
131 FAIL() << "We shouldn't get here.";
132 }
henrik.lundin4cf61dd2015-12-09 06:20:58 -0800133 ASSERT_EQ(NetEq::kOK, neteq_mono_->RegisterPayloadType(mono_decoder, "mono",
134 kPayloadTypeMono));
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000135 ASSERT_EQ(NetEq::kOK,
henrik.lundin4cf61dd2015-12-09 06:20:58 -0800136 neteq_->RegisterPayloadType(multi_decoder, "multi-channel",
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000137 kPayloadTypeMulti));
138 }
139
140 virtual void TearDown() {}
141
142 int GetNewPackets() {
143 if (!input_file_->Read(frame_size_samples_, input_)) {
144 return -1;
145 }
Yves Gerey665174f2018-06-19 15:03:05 +0200146 payload_size_bytes_ =
147 WebRtcPcm16b_Encode(input_, frame_size_samples_, encoded_);
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000148 if (frame_size_samples_ * 2 != payload_size_bytes_) {
149 return -1;
150 }
Yves Gerey665174f2018-06-19 15:03:05 +0200151 int next_send_time = rtp_generator_mono_.GetRtpHeader(
152 kPayloadTypeMono, frame_size_samples_, &rtp_header_mono_);
153 test::InputAudioFile::DuplicateInterleaved(
154 input_, frame_size_samples_, num_channels_, input_multi_channel_);
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000155 multi_payload_size_bytes_ = WebRtcPcm16b_Encode(
156 input_multi_channel_, frame_size_samples_ * num_channels_,
157 encoded_multi_channel_);
158 if (frame_size_samples_ * 2 * num_channels_ != multi_payload_size_bytes_) {
159 return -1;
160 }
161 rtp_generator_.GetRtpHeader(kPayloadTypeMulti, frame_size_samples_,
162 &rtp_header_);
163 return next_send_time;
164 }
165
ivoc72c08ed2016-01-20 07:26:24 -0800166 virtual void VerifyOutput(size_t num_samples) {
yujo36b1a5f2017-06-12 12:45:32 -0700167 const int16_t* output_data = output_.data();
168 const int16_t* output_multi_channel_data = output_multi_channel_.data();
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000169 for (size_t i = 0; i < num_samples; ++i) {
Peter Kasting69558702016-01-12 16:26:35 -0800170 for (size_t j = 0; j < num_channels_; ++j) {
yujo36b1a5f2017-06-12 12:45:32 -0700171 ASSERT_EQ(output_data[i],
172 output_multi_channel_data[i * num_channels_ + j])
henrik.lundin6d8e0112016-03-04 10:34:21 -0800173 << "Diff in sample " << i << ", channel " << j << ".";
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000174 }
175 }
176 }
177
178 virtual int GetArrivalTime(int send_time) {
179 int arrival_time = last_arrival_time_ + (send_time - last_send_time_);
180 last_send_time_ = send_time;
181 last_arrival_time_ = arrival_time;
182 return arrival_time;
183 }
184
185 virtual bool Lost() { return false; }
186
187 void RunTest(int num_loops) {
188 // Get next input packets (mono and multi-channel).
189 int next_send_time;
190 int next_arrival_time;
191 do {
192 next_send_time = GetNewPackets();
193 ASSERT_NE(-1, next_send_time);
194 next_arrival_time = GetArrivalTime(next_send_time);
195 } while (Lost()); // If lost, immediately read the next packet.
196
197 int time_now = 0;
198 for (int k = 0; k < num_loops; ++k) {
199 while (time_now >= next_arrival_time) {
200 // Insert packet in mono instance.
201 ASSERT_EQ(NetEq::kOK,
henrik.lundin246ef3e2017-04-24 09:14:32 -0700202 neteq_mono_->InsertPacket(rtp_header_mono_,
kwibergee2bac22015-11-11 10:34:00 -0800203 rtc::ArrayView<const uint8_t>(
204 encoded_, payload_size_bytes_),
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000205 next_arrival_time));
206 // Insert packet in multi-channel instance.
Henrik Lundin70c09bd2017-04-24 15:56:56 +0200207 ASSERT_EQ(NetEq::kOK,
208 neteq_->InsertPacket(
henrik.lundin246ef3e2017-04-24 09:14:32 -0700209 rtp_header_,
Henrik Lundin70c09bd2017-04-24 15:56:56 +0200210 rtc::ArrayView<const uint8_t>(encoded_multi_channel_,
211 multi_payload_size_bytes_),
212 next_arrival_time));
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000213 // Get next input packets (mono and multi-channel).
214 do {
215 next_send_time = GetNewPackets();
216 ASSERT_NE(-1, next_send_time);
217 next_arrival_time = GetArrivalTime(next_send_time);
218 } while (Lost()); // If lost, immediately read the next packet.
219 }
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000220 // Get audio from mono instance.
henrik.lundin7a926812016-05-12 13:51:28 -0700221 bool muted;
222 EXPECT_EQ(NetEq::kOK, neteq_mono_->GetAudio(&output_, &muted));
223 ASSERT_FALSE(muted);
henrik.lundin6d8e0112016-03-04 10:34:21 -0800224 EXPECT_EQ(1u, output_.num_channels_);
225 EXPECT_EQ(output_size_samples_, output_.samples_per_channel_);
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000226 // Get audio from multi-channel instance.
henrik.lundin7a926812016-05-12 13:51:28 -0700227 ASSERT_EQ(NetEq::kOK, neteq_->GetAudio(&output_multi_channel_, &muted));
228 ASSERT_FALSE(muted);
henrik.lundin6d8e0112016-03-04 10:34:21 -0800229 EXPECT_EQ(num_channels_, output_multi_channel_.num_channels_);
230 EXPECT_EQ(output_size_samples_,
231 output_multi_channel_.samples_per_channel_);
Jonas Olsson366a50c2018-09-06 13:41:30 +0200232 rtc::StringBuilder ss;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000233 ss << "Lap number " << k << ".";
234 SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
235 // Compare mono and multi-channel.
236 ASSERT_NO_FATAL_FAILURE(VerifyOutput(output_size_samples_));
237
238 time_now += kTimeStepMs;
239 }
240 }
241
Peter Kasting69558702016-01-12 16:26:35 -0800242 const size_t num_channels_;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000243 const int sample_rate_hz_;
244 const int samples_per_ms_;
245 const int frame_size_ms_;
Peter Kastingdce40cf2015-08-24 14:52:23 -0700246 const size_t frame_size_samples_;
247 const size_t output_size_samples_;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000248 NetEq* neteq_mono_;
249 NetEq* neteq_;
250 test::RtpGenerator rtp_generator_mono_;
251 test::RtpGenerator rtp_generator_;
252 int16_t* input_;
253 int16_t* input_multi_channel_;
254 uint8_t* encoded_;
255 uint8_t* encoded_multi_channel_;
henrik.lundin6d8e0112016-03-04 10:34:21 -0800256 AudioFrame output_;
257 AudioFrame output_multi_channel_;
henrik.lundin246ef3e2017-04-24 09:14:32 -0700258 RTPHeader rtp_header_mono_;
259 RTPHeader rtp_header_;
Peter Kastingdce40cf2015-08-24 14:52:23 -0700260 size_t payload_size_bytes_;
261 size_t multi_payload_size_bytes_;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000262 int last_send_time_;
263 int last_arrival_time_;
kwiberg2d0c3322016-02-14 09:28:33 -0800264 std::unique_ptr<test::InputAudioFile> input_file_;
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000265};
266
267class NetEqStereoTestNoJitter : public NetEqStereoTest {
268 protected:
Yves Gerey665174f2018-06-19 15:03:05 +0200269 NetEqStereoTestNoJitter() : NetEqStereoTest() {
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000270 // Start the sender 100 ms before the receiver to pre-fill the buffer.
271 // This is to avoid doing preemptive expand early in the test.
272 // TODO(hlundin): Mock the decision making instead to control the modes.
273 last_arrival_time_ = -100;
274 }
275};
276
ivoc72c08ed2016-01-20 07:26:24 -0800277TEST_P(NetEqStereoTestNoJitter, RunTest) {
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000278 RunTest(8);
279}
280
281class NetEqStereoTestPositiveDrift : public NetEqStereoTest {
282 protected:
Yves Gerey665174f2018-06-19 15:03:05 +0200283 NetEqStereoTestPositiveDrift() : NetEqStereoTest(), drift_factor(0.9) {
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000284 // Start the sender 100 ms before the receiver to pre-fill the buffer.
285 // This is to avoid doing preemptive expand early in the test.
286 // TODO(hlundin): Mock the decision making instead to control the modes.
287 last_arrival_time_ = -100;
288 }
289 virtual int GetArrivalTime(int send_time) {
Yves Gerey665174f2018-06-19 15:03:05 +0200290 int arrival_time =
291 last_arrival_time_ + drift_factor * (send_time - last_send_time_);
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000292 last_send_time_ = send_time;
293 last_arrival_time_ = arrival_time;
294 return arrival_time;
295 }
296
297 double drift_factor;
298};
299
ivoc72c08ed2016-01-20 07:26:24 -0800300TEST_P(NetEqStereoTestPositiveDrift, RunTest) {
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000301 RunTest(100);
302}
303
304class NetEqStereoTestNegativeDrift : public NetEqStereoTestPositiveDrift {
305 protected:
Yves Gerey665174f2018-06-19 15:03:05 +0200306 NetEqStereoTestNegativeDrift() : NetEqStereoTestPositiveDrift() {
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000307 drift_factor = 1.1;
308 last_arrival_time_ = 0;
309 }
310};
311
ivoc72c08ed2016-01-20 07:26:24 -0800312TEST_P(NetEqStereoTestNegativeDrift, RunTest) {
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000313 RunTest(100);
314}
315
316class NetEqStereoTestDelays : public NetEqStereoTest {
317 protected:
318 static const int kDelayInterval = 10;
319 static const int kDelay = 1000;
Yves Gerey665174f2018-06-19 15:03:05 +0200320 NetEqStereoTestDelays() : NetEqStereoTest(), frame_index_(0) {}
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000321
322 virtual int GetArrivalTime(int send_time) {
323 // Deliver immediately, unless we have a back-log.
324 int arrival_time = std::min(last_arrival_time_, send_time);
325 if (++frame_index_ % kDelayInterval == 0) {
326 // Delay this packet.
327 arrival_time += kDelay;
328 }
329 last_send_time_ = send_time;
330 last_arrival_time_ = arrival_time;
331 return arrival_time;
332 }
333
334 int frame_index_;
335};
336
ivoc72c08ed2016-01-20 07:26:24 -0800337TEST_P(NetEqStereoTestDelays, RunTest) {
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000338 RunTest(1000);
339}
340
341class NetEqStereoTestLosses : public NetEqStereoTest {
342 protected:
343 static const int kLossInterval = 10;
Yves Gerey665174f2018-06-19 15:03:05 +0200344 NetEqStereoTestLosses() : NetEqStereoTest(), frame_index_(0) {}
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000345
Yves Gerey665174f2018-06-19 15:03:05 +0200346 virtual bool Lost() { return (++frame_index_) % kLossInterval == 0; }
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000347
ivoc72c08ed2016-01-20 07:26:24 -0800348 // TODO(hlundin): NetEq is not giving bitexact results for these cases.
349 virtual void VerifyOutput(size_t num_samples) {
350 for (size_t i = 0; i < num_samples; ++i) {
yujo36b1a5f2017-06-12 12:45:32 -0700351 const int16_t* output_data = output_.data();
352 const int16_t* output_multi_channel_data = output_multi_channel_.data();
Yves Gerey665174f2018-06-19 15:03:05 +0200353 auto first_channel_sample = output_multi_channel_data[i * num_channels_];
ivoc72c08ed2016-01-20 07:26:24 -0800354 for (size_t j = 0; j < num_channels_; ++j) {
355 const int kErrorMargin = 200;
yujo36b1a5f2017-06-12 12:45:32 -0700356 EXPECT_NEAR(output_data[i],
357 output_multi_channel_data[i * num_channels_ + j],
ivoc72c08ed2016-01-20 07:26:24 -0800358 kErrorMargin)
359 << "Diff in sample " << i << ", channel " << j << ".";
360 EXPECT_EQ(first_channel_sample,
yujo36b1a5f2017-06-12 12:45:32 -0700361 output_multi_channel_data[i * num_channels_ + j]);
ivoc72c08ed2016-01-20 07:26:24 -0800362 }
363 }
364 }
365
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000366 int frame_index_;
367};
368
ivoc72c08ed2016-01-20 07:26:24 -0800369TEST_P(NetEqStereoTestLosses, RunTest) {
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000370 RunTest(100);
371}
372
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000373// Creates a list of parameter sets.
374std::list<TestParameters> GetTestParameters() {
375 std::list<TestParameters> l;
376 const int sample_rates[] = {8000, 16000, 32000};
377 const int num_rates = sizeof(sample_rates) / sizeof(sample_rates[0]);
378 // Loop through sample rates.
379 for (int rate_index = 0; rate_index < num_rates; ++rate_index) {
380 int sample_rate = sample_rates[rate_index];
381 // Loop through all frame sizes between 10 and 60 ms.
382 for (int frame_size = 10; frame_size <= 60; frame_size += 10) {
383 TestParameters p;
384 p.frame_size = frame_size;
385 p.sample_rate = sample_rate;
386 p.num_channels = 2;
387 l.push_back(p);
388 if (sample_rate == 8000) {
389 // Add a five-channel test for 8000 Hz.
390 p.num_channels = 5;
391 l.push_back(p);
392 }
393 }
394 }
395 return l;
396}
397
398// Pretty-printing the test parameters in case of an error.
399void PrintTo(const TestParameters& p, ::std::ostream* os) {
Yves Gerey665174f2018-06-19 15:03:05 +0200400 *os << "{frame_size = " << p.frame_size
401 << ", num_channels = " << p.num_channels
402 << ", sample_rate = " << p.sample_rate << "}";
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +0000403}
404
405// Instantiate the tests. Each test is instantiated using the function above,
406// so that all different parameter combinations are tested.
407INSTANTIATE_TEST_CASE_P(MultiChannel,
408 NetEqStereoTestNoJitter,
409 ::testing::ValuesIn(GetTestParameters()));
410
411INSTANTIATE_TEST_CASE_P(MultiChannel,
412 NetEqStereoTestPositiveDrift,
413 ::testing::ValuesIn(GetTestParameters()));
414
415INSTANTIATE_TEST_CASE_P(MultiChannel,
416 NetEqStereoTestNegativeDrift,
417 ::testing::ValuesIn(GetTestParameters()));
418
419INSTANTIATE_TEST_CASE_P(MultiChannel,
420 NetEqStereoTestDelays,
421 ::testing::ValuesIn(GetTestParameters()));
422
423INSTANTIATE_TEST_CASE_P(MultiChannel,
424 NetEqStereoTestLosses,
425 ::testing::ValuesIn(GetTestParameters()));
426
427} // namespace webrtc