blob: c7d1bec1c07156540b5ad6b74cbe5e7163a51dc7 [file] [log] [blame]
pbos@webrtc.org2f02da82013-07-09 08:02:331/*
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#include <stdio.h>
11
kwiberg15b966d2016-09-29 00:42:0112#include "webrtc/test/gtest.h"
ivicada8e7c92015-09-17 12:30:2413#include "webrtc/video/video_quality_test.h"
pbos@webrtc.org2f02da82013-07-09 08:02:3314
pbos@webrtc.org2f02da82013-07-09 08:02:3315namespace webrtc {
16
stefan@webrtc.org79b66f42014-07-09 11:29:0617static const int kFullStackTestDurationSecs = 60;
pbos@webrtc.org4b50db12013-12-03 10:13:0418
ivicada8e7c92015-09-17 12:30:2419class FullStackTest : public VideoQualityTest {
pbos@webrtc.org2f02da82013-07-09 08:02:3320 public:
ivicada8e7c92015-09-17 12:30:2421 void RunTest(const VideoQualityTest::Params &params) {
22 RunWithAnalyzer(params);
pbos@webrtc.orga24c3562013-10-16 11:05:3723 }
asapersson8814c4d2016-02-12 21:16:4324
25 void ForemanCifWithoutPacketLoss(const std::string& video_codec) {
26 // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif.
kjellander2853a4b2016-09-08 17:52:3827 VideoQualityTest::Params foreman_cif = {
28 {352, 288, 30, 700000, 700000, 700000, false, video_codec, 1},
29 {"foreman_cif"},
30 {},
31 {"foreman_cif_net_delay_0_0_plr_0_" + video_codec, 0.0, 0.0,
32 kFullStackTestDurationSecs}};
asapersson8814c4d2016-02-12 21:16:4333 RunTest(foreman_cif);
34 }
35
36 void ForemanCifPlr5(const std::string& video_codec) {
kjellander2853a4b2016-09-08 17:52:3837 VideoQualityTest::Params foreman_cif = {
38 {352, 288, 30, 30000, 500000, 2000000, false, video_codec, 1},
39 {"foreman_cif"},
40 {},
41 {"foreman_cif_delay_50_0_plr_5_" + video_codec, 0.0, 0.0,
42 kFullStackTestDurationSecs}};
asapersson8814c4d2016-02-12 21:16:4343 foreman_cif.pipe.loss_percent = 5;
44 foreman_cif.pipe.queue_delay_ms = 50;
45 RunTest(foreman_cif);
46 }
pbos@webrtc.org2f02da82013-07-09 08:02:3347};
48
sprang0ba16d12015-11-02 15:23:2049// VideoQualityTest::Params params = {
50// { ... }, // Common.
51// { ... }, // Video-specific settings.
52// { ... }, // Screenshare-specific settings.
53// { ... }, // Analyzer settings.
54// pipe, // FakeNetworkPipe::Config
55// { ... }, // Spatial scalability.
56// logs // bool
57// };
pbos@webrtc.org2f02da82013-07-09 08:02:3358
Peter Boström81950aa2016-05-14 00:03:1859#if !defined(RTC_DISABLE_VP9)
asapersson8814c4d2016-02-12 21:16:4360TEST_F(FullStackTest, ForemanCifWithoutPacketLossVp9) {
61 ForemanCifWithoutPacketLoss("VP9");
62}
63
64TEST_F(FullStackTest, ForemanCifPlr5Vp9) {
65 ForemanCifPlr5("VP9");
66}
Peter Boström81950aa2016-05-14 00:03:1867#endif // !defined(RTC_DISABLE_VP9)
asapersson8814c4d2016-02-12 21:16:4368
pbos@webrtc.orgeb67a6b2014-06-27 08:47:5269TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) {
kjellander2853a4b2016-09-08 17:52:3870 VideoQualityTest::Params paris_qcif = {
71 {176, 144, 30, 300000, 300000, 300000, false, "VP8", 1, 0, 0, true},
72 {"paris_qcif"},
73 {},
74 {"net_delay_0_0_plr_0", 36.0, 0.96, kFullStackTestDurationSecs}};
stefan@webrtc.org79b66f42014-07-09 11:29:0675 RunTest(paris_qcif);
pbos@webrtc.orgeb67a6b2014-06-27 08:47:5276}
77
78TEST_F(FullStackTest, ForemanCifWithoutPacketLoss) {
stefan@webrtc.org79b66f42014-07-09 11:29:0679 // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif.
kjellander2853a4b2016-09-08 17:52:3880 VideoQualityTest::Params foreman_cif = {
81 {352, 288, 30, 700000, 700000, 700000, false, "VP8", 1, 0, 0, true},
82 {"foreman_cif"},
83 {},
84 {"foreman_cif_net_delay_0_0_plr_0", 0.0, 0.0,
85 kFullStackTestDurationSecs}};
stefan@webrtc.org79b66f42014-07-09 11:29:0686 RunTest(foreman_cif);
pbos@webrtc.orgeb67a6b2014-06-27 08:47:5287}
pbos@webrtc.org2f02da82013-07-09 08:02:3388
sprang@webrtc.org617b41a2015-02-23 08:34:1789TEST_F(FullStackTest, ForemanCifPlr5) {
kjellander2853a4b2016-09-08 17:52:3890 VideoQualityTest::Params foreman_cif = {
91 {352, 288, 30, 30000, 500000, 2000000, false, "VP8", 1, 0, 0, true},
92 {"foreman_cif"},
93 {},
94 {"foreman_cif_delay_50_0_plr_5", 0.0, 0.0, kFullStackTestDurationSecs}};
ivicada8e7c92015-09-17 12:30:2495 foreman_cif.pipe.loss_percent = 5;
96 foreman_cif.pipe.queue_delay_ms = 50;
stefan@webrtc.org63682552014-10-14 10:38:4997 RunTest(foreman_cif);
98}
99
stefan@webrtc.org79b66f42014-07-09 11:29:06100TEST_F(FullStackTest, ForemanCif500kbps) {
kjellander2853a4b2016-09-08 17:52:38101 VideoQualityTest::Params foreman_cif = {
102 {352, 288, 30, 30000, 500000, 2000000, false, "VP8", 1, 0, 0, true},
103 {"foreman_cif"},
104 {},
105 {"foreman_cif_500kbps", 0.0, 0.0, kFullStackTestDurationSecs}};
ivicada8e7c92015-09-17 12:30:24106 foreman_cif.pipe.queue_length_packets = 0;
107 foreman_cif.pipe.queue_delay_ms = 0;
108 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.org79b66f42014-07-09 11:29:06109 RunTest(foreman_cif);
110}
111
112TEST_F(FullStackTest, ForemanCif500kbpsLimitedQueue) {
kjellander2853a4b2016-09-08 17:52:38113 VideoQualityTest::Params foreman_cif = {
114 {352, 288, 30, 30000, 500000, 2000000, false, "VP8", 1, 0, 0, true},
115 {"foreman_cif"},
116 {},
117 {"foreman_cif_500kbps_32pkts_queue", 0.0, 0.0,
118 kFullStackTestDurationSecs}};
ivicada8e7c92015-09-17 12:30:24119 foreman_cif.pipe.queue_length_packets = 32;
120 foreman_cif.pipe.queue_delay_ms = 0;
121 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.org79b66f42014-07-09 11:29:06122 RunTest(foreman_cif);
123}
124
125TEST_F(FullStackTest, ForemanCif500kbps100ms) {
kjellander2853a4b2016-09-08 17:52:38126 VideoQualityTest::Params foreman_cif = {
127 {352, 288, 30, 30000, 500000, 2000000, false, "VP8", 1, 0, 0, true},
128 {"foreman_cif"},
129 {},
130 {"foreman_cif_500kbps_100ms", 0.0, 0.0, kFullStackTestDurationSecs}};
ivicada8e7c92015-09-17 12:30:24131 foreman_cif.pipe.queue_length_packets = 0;
132 foreman_cif.pipe.queue_delay_ms = 100;
133 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.org79b66f42014-07-09 11:29:06134 RunTest(foreman_cif);
135}
136
137TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueue) {
kjellander2853a4b2016-09-08 17:52:38138 VideoQualityTest::Params foreman_cif = {
139 {352, 288, 30, 30000, 500000, 2000000, false, "VP8", 1, 0, 0, true},
140 {"foreman_cif"},
141 {},
142 {"foreman_cif_500kbps_100ms_32pkts_queue", 0.0, 0.0,
143 kFullStackTestDurationSecs}};
stefan1257c112016-08-11 14:00:57144 foreman_cif.pipe.queue_length_packets = 32;
145 foreman_cif.pipe.queue_delay_ms = 100;
146 foreman_cif.pipe.link_capacity_kbps = 500;
147 RunTest(foreman_cif);
148}
149
150TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueueRecvBwe) {
kjellander2853a4b2016-09-08 17:52:38151 VideoQualityTest::Params foreman_cif = {
152 {352, 288, 30, 30000, 500000, 2000000, false, "VP8", 1, 0, 0, false},
153 {"foreman_cif"},
154 {},
155 {"foreman_cif_500kbps_100ms_32pkts_queue", 0.0, 0.0,
156 kFullStackTestDurationSecs}};
ivicada8e7c92015-09-17 12:30:24157 foreman_cif.pipe.queue_length_packets = 32;
158 foreman_cif.pipe.queue_delay_ms = 100;
159 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.org79b66f42014-07-09 11:29:06160 RunTest(foreman_cif);
161}
162
163TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) {
kjellander2853a4b2016-09-08 17:52:38164 VideoQualityTest::Params foreman_cif = {
165 {352, 288, 30, 30000, 2000000, 2000000, false, "VP8", 1, 0, 0, true},
166 {"foreman_cif"},
167 {},
168 {"foreman_cif_1000kbps_100ms_32pkts_queue", 0.0, 0.0,
169 kFullStackTestDurationSecs}};
ivicada8e7c92015-09-17 12:30:24170 foreman_cif.pipe.queue_length_packets = 32;
171 foreman_cif.pipe.queue_delay_ms = 100;
172 foreman_cif.pipe.link_capacity_kbps = 1000;
stefan@webrtc.org79b66f42014-07-09 11:29:06173 RunTest(foreman_cif);
174}
sprang@webrtc.org5fbd9402015-02-18 12:46:06175
stefan1257c112016-08-11 14:00:57176TEST_F(FullStackTest, ConferenceMotionHd2000kbps100msLimitedQueue) {
kjellander2853a4b2016-09-08 17:52:38177 VideoQualityTest::Params conf_motion_hd = {
178 {1280, 720, 50, 30000, 3000000, 3000000, false, "VP8", 1, 0, 0, true},
179 {"ConferenceMotion_1280_720_50"},
180 {},
181 {"conference_motion_hd_2000kbps_100ms_32pkts_queue", 0.0, 0.0,
182 kFullStackTestDurationSecs}};
stefan1257c112016-08-11 14:00:57183 conf_motion_hd.pipe.queue_length_packets = 32;
184 conf_motion_hd.pipe.queue_delay_ms = 100;
185 conf_motion_hd.pipe.link_capacity_kbps = 2000;
186 RunTest(conf_motion_hd);
187}
188
ivica47dc3f32015-10-06 09:04:06189TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL) {
kjellander2853a4b2016-09-08 17:52:38190 VideoQualityTest::Params screenshare = {
191 {1850, 1110, 5, 50000, 200000, 2000000, false, "VP8", 2, 1, 400000, true},
192 {},
193 {true, 10},
194 {"screenshare_slides", 0.0, 0.0, kFullStackTestDurationSecs}};
ivicada8e7c92015-09-17 12:30:24195 RunTest(screenshare);
Erik Språng296bbaf2015-09-03 13:58:05196}
197
ivica47dc3f32015-10-06 09:04:06198TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_Scroll) {
kjellander2853a4b2016-09-08 17:52:38199 VideoQualityTest::Params config = {
200 {1850, 1110 / 2, 5, 50000, 200000, 2000000, false, "VP8", 2, 1, 400000,
201 true},
202 {},
203 {true, 10, 2},
204 {"screenshare_slides_scrolling", 0.0, 0.0, kFullStackTestDurationSecs}};
ivicada8e7c92015-09-17 12:30:24205 RunTest(config);
ivica98797572015-07-30 09:15:56206}
207
sprang2b1da162015-11-23 14:10:23208TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_LossyNet) {
kjellander2853a4b2016-09-08 17:52:38209 VideoQualityTest::Params screenshare = {
210 {1850, 1110, 5, 50000, 200000, 2000000, false, "VP8", 2, 1, 400000, true},
211 {}, // Video-specific.
212 {true, 10}, // Screenshare-specific.
213 {"screenshare_slides_lossy_net", 0.0, 0.0, kFullStackTestDurationSecs}};
sprang2b1da162015-11-23 14:10:23214 screenshare.pipe.loss_percent = 5;
215 screenshare.pipe.queue_delay_ms = 200;
216 screenshare.pipe.link_capacity_kbps = 500;
217 RunTest(screenshare);
218}
219
220TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_VeryLossyNet) {
kjellander2853a4b2016-09-08 17:52:38221 VideoQualityTest::Params screenshare = {
222 {1850, 1110, 5, 50000, 200000, 2000000, false, "VP8", 2, 1, 400000, true},
223 {}, // Video-specific.
224 {true, 10}, // Screenshare-specific.
225 {"screenshare_slides_very_lossy", 0.0, 0.0, kFullStackTestDurationSecs}};
sprang2b1da162015-11-23 14:10:23226 screenshare.pipe.loss_percent = 10;
227 screenshare.pipe.queue_delay_ms = 200;
228 screenshare.pipe.link_capacity_kbps = 500;
229 RunTest(screenshare);
230}
231
Peter Boström81950aa2016-05-14 00:03:18232#if !defined(RTC_DISABLE_VP9)
philipel3c05bee2015-11-10 15:17:23233TEST_F(FullStackTest, ScreenshareSlidesVP9_2SL) {
kjellander2853a4b2016-09-08 17:52:38234 VideoQualityTest::Params screenshare = {
235 {1850, 1110, 5, 50000, 200000, 2000000, false, "VP9", 1, 0, 400000, true},
236 {},
237 {true, 10},
238 {"screenshare_slides_vp9_2sl", 0.0, 0.0, kFullStackTestDurationSecs},
239 {},
240 false,
241 {std::vector<VideoStream>(), 0, 2, 1}};
ivicada8e7c92015-09-17 12:30:24242 RunTest(screenshare);
sprang@webrtc.org5fbd9402015-02-18 12:46:06243}
Peter Boström81950aa2016-05-14 00:03:18244#endif // !defined(RTC_DISABLE_VP9)
pbos@webrtc.org2f02da82013-07-09 08:02:33245} // namespace webrtc