blob: 375fdde55c39dc4820e8e5843f8be8c0649084b8 [file] [log] [blame]
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +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#include <stdio.h>
11
pbos@webrtc.org69215d82013-07-10 15:02:02 +000012#include "testing/gtest/include/gtest/gtest.h"
ivica5d6a06c2015-09-17 05:30:24 -070013#include "webrtc/video/video_quality_test.h"
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000014
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000015namespace webrtc {
16
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000017static const int kFullStackTestDurationSecs = 60;
pbos@webrtc.orgb613b5a2013-12-03 10:13:04 +000018
ivica5d6a06c2015-09-17 05:30:24 -070019class FullStackTest : public VideoQualityTest {
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000020 public:
ivica5d6a06c2015-09-17 05:30:24 -070021 void RunTest(const VideoQualityTest::Params &params) {
22 RunWithAnalyzer(params);
pbos@webrtc.org94015242013-10-16 11:05:37 +000023 }
asapersson88b0a222016-02-12 13:16:43 -080024
25 void ForemanCifWithoutPacketLoss(const std::string& video_codec) {
26 // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif.
minyuef07fb002016-09-08 08:20:07 -070027 VideoQualityTest::Params foreman_cif;
28 foreman_cif.video = {true, 352, 288, 30, 700000, 700000, 700000, false,
29 video_codec, 1, 0, 0, false, "foreman_cif"};
30 foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_" + video_codec,
31 0.0, 0.0, kFullStackTestDurationSecs};
asapersson88b0a222016-02-12 13:16:43 -080032 RunTest(foreman_cif);
33 }
34
35 void ForemanCifPlr5(const std::string& video_codec) {
minyuef07fb002016-09-08 08:20:07 -070036 VideoQualityTest::Params foreman_cif;
37 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false,
38 video_codec, 1, 0, 0, false, "foreman_cif"};
39 foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_" + video_codec, 0.0,
40 0.0, kFullStackTestDurationSecs};
asapersson88b0a222016-02-12 13:16:43 -080041 foreman_cif.pipe.loss_percent = 5;
42 foreman_cif.pipe.queue_delay_ms = 50;
43 RunTest(foreman_cif);
44 }
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000045};
46
sprangce4aef12015-11-02 07:23:20 -080047// VideoQualityTest::Params params = {
48// { ... }, // Common.
49// { ... }, // Video-specific settings.
50// { ... }, // Screenshare-specific settings.
51// { ... }, // Analyzer settings.
52// pipe, // FakeNetworkPipe::Config
53// { ... }, // Spatial scalability.
54// logs // bool
55// };
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000056
Peter Boström12996152016-05-14 02:03:18 +020057#if !defined(RTC_DISABLE_VP9)
asapersson88b0a222016-02-12 13:16:43 -080058TEST_F(FullStackTest, ForemanCifWithoutPacketLossVp9) {
59 ForemanCifWithoutPacketLoss("VP9");
60}
61
62TEST_F(FullStackTest, ForemanCifPlr5Vp9) {
63 ForemanCifPlr5("VP9");
64}
Peter Boström12996152016-05-14 02:03:18 +020065#endif // !defined(RTC_DISABLE_VP9)
asapersson88b0a222016-02-12 13:16:43 -080066
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000067TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) {
minyuef07fb002016-09-08 08:20:07 -070068 VideoQualityTest::Params paris_qcif;
69 paris_qcif.video = {true, 176, 144, 30, 300000, 300000, 300000, false,
70 "VP8", 1, 0, 0, true, "paris_qcif"};
71 paris_qcif.analyzer = {"net_delay_0_0_plr_0", 36.0, 0.96,
72 kFullStackTestDurationSecs};
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000073 RunTest(paris_qcif);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000074}
75
76TEST_F(FullStackTest, ForemanCifWithoutPacketLoss) {
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000077 // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif.
minyuef07fb002016-09-08 08:20:07 -070078 VideoQualityTest::Params foreman_cif;
79 foreman_cif.video = {true, 352, 288, 30, 700000, 700000, 700000, false, "VP8",
80 1, 0, 0, true, "foreman_cif"};
81 foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0", 0.0, 0.0,
82 kFullStackTestDurationSecs};
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000083 RunTest(foreman_cif);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000084}
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000085
sprang@webrtc.org343096a2015-02-23 08:34:17 +000086TEST_F(FullStackTest, ForemanCifPlr5) {
minyuef07fb002016-09-08 08:20:07 -070087 VideoQualityTest::Params foreman_cif;
88 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8",
89 1, 0, 0, true, "foreman_cif"};
90 foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5", 0.0, 0.0,
91 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -070092 foreman_cif.pipe.loss_percent = 5;
93 foreman_cif.pipe.queue_delay_ms = 50;
stefan@webrtc.orgc216b9a2014-10-14 10:38:49 +000094 RunTest(foreman_cif);
95}
96
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000097TEST_F(FullStackTest, ForemanCif500kbps) {
minyuef07fb002016-09-08 08:20:07 -070098 VideoQualityTest::Params foreman_cif;
99 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8",
100 1, 0, 0, true, "foreman_cif"};
101 foreman_cif.analyzer = {"foreman_cif_500kbps", 0.0, 0.0,
102 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700103 foreman_cif.pipe.queue_length_packets = 0;
104 foreman_cif.pipe.queue_delay_ms = 0;
105 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000106 RunTest(foreman_cif);
107}
108
109TEST_F(FullStackTest, ForemanCif500kbpsLimitedQueue) {
minyuef07fb002016-09-08 08:20:07 -0700110 VideoQualityTest::Params foreman_cif;
111 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8",
112 1, 0, 0, true, "foreman_cif"};
113 foreman_cif.analyzer = {"foreman_cif_500kbps_32pkts_queue", 0.0, 0.0,
114 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700115 foreman_cif.pipe.queue_length_packets = 32;
116 foreman_cif.pipe.queue_delay_ms = 0;
117 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000118 RunTest(foreman_cif);
119}
120
121TEST_F(FullStackTest, ForemanCif500kbps100ms) {
minyuef07fb002016-09-08 08:20:07 -0700122 VideoQualityTest::Params foreman_cif;
123 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8",
124 1, 0, 0, true, "foreman_cif"};
125 foreman_cif.analyzer = {"foreman_cif_500kbps_100ms", 0.0, 0.0,
126 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700127 foreman_cif.pipe.queue_length_packets = 0;
128 foreman_cif.pipe.queue_delay_ms = 100;
129 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000130 RunTest(foreman_cif);
131}
132
133TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueue) {
minyuef07fb002016-09-08 08:20:07 -0700134 VideoQualityTest::Params foreman_cif;
135 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8",
136 1, 0, 0, true, "foreman_cif"};
137 foreman_cif.analyzer = {"foreman_cif_500kbps_100ms_32pkts_queue", 0.0, 0.0,
138 kFullStackTestDurationSecs};
stefanb1797672016-08-11 07:00:57 -0700139 foreman_cif.pipe.queue_length_packets = 32;
140 foreman_cif.pipe.queue_delay_ms = 100;
141 foreman_cif.pipe.link_capacity_kbps = 500;
142 RunTest(foreman_cif);
143}
144
145TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueueRecvBwe) {
minyuef07fb002016-09-08 08:20:07 -0700146 VideoQualityTest::Params foreman_cif;
147 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8",
148 1, 0, 0, false, "foreman_cif"};
149 foreman_cif.analyzer = {"foreman_cif_500kbps_100ms_32pkts_queue", 0.0, 0.0,
150 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700151 foreman_cif.pipe.queue_length_packets = 32;
152 foreman_cif.pipe.queue_delay_ms = 100;
153 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000154 RunTest(foreman_cif);
155}
156
157TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) {
minyuef07fb002016-09-08 08:20:07 -0700158 VideoQualityTest::Params foreman_cif;
159 foreman_cif.video = {true, 352, 288, 30, 30000, 2000000, 2000000, false,
160 "VP8", 1, 0, 0, true, "foreman_cif"};
161 foreman_cif.analyzer = {"foreman_cif_1000kbps_100ms_32pkts_queue", 0.0, 0.0,
162 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700163 foreman_cif.pipe.queue_length_packets = 32;
164 foreman_cif.pipe.queue_delay_ms = 100;
165 foreman_cif.pipe.link_capacity_kbps = 1000;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000166 RunTest(foreman_cif);
167}
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000168
stefanb1797672016-08-11 07:00:57 -0700169TEST_F(FullStackTest, ConferenceMotionHd2000kbps100msLimitedQueue) {
minyuef07fb002016-09-08 08:20:07 -0700170 VideoQualityTest::Params conf_motion_hd;
171 conf_motion_hd.video = {true, 1280, 720, 50, 30000, 3000000, 3000000, false,
172 "VP8", 1, 0, 0, true, "ConferenceMotion_1280_720_50"};
173 conf_motion_hd.analyzer = {"conference_motion_hd_2000kbps_100ms_32pkts_queue",
174 0.0, 0.0, kFullStackTestDurationSecs};
stefanb1797672016-08-11 07:00:57 -0700175 conf_motion_hd.pipe.queue_length_packets = 32;
176 conf_motion_hd.pipe.queue_delay_ms = 100;
177 conf_motion_hd.pipe.link_capacity_kbps = 2000;
178 RunTest(conf_motion_hd);
179}
180
ivica7bd242e2015-10-06 02:04:06 -0700181TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL) {
minyuef07fb002016-09-08 08:20:07 -0700182 VideoQualityTest::Params screenshare;
183 screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false,
184 "VP8", 2, 1, 400000, true, ""};
185 screenshare.screenshare = {true, 10};
186 screenshare.analyzer = {"screenshare_slides", 0.0, 0.0,
187 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700188 RunTest(screenshare);
Erik Språng6ee69aa2015-09-03 15:58:05 +0200189}
190
ivica7bd242e2015-10-06 02:04:06 -0700191TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_Scroll) {
minyuef07fb002016-09-08 08:20:07 -0700192 VideoQualityTest::Params config;
193 config.video = {true, 1850, 1110 / 2, 5, 50000, 200000, 2000000, false,
194 "VP8", 2, 1, 400000, true, ""};
195 config.screenshare = {true, 10, 2};
196 config.analyzer = {"screenshare_slides_scrolling", 0.0, 0.0,
197 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700198 RunTest(config);
ivica028cf482015-07-30 02:15:56 -0700199}
200
sprangee37de32015-11-23 06:10:23 -0800201TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_LossyNet) {
minyuef07fb002016-09-08 08:20:07 -0700202 VideoQualityTest::Params screenshare;
203 screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false,
204 "VP8", 2, 1, 400000, true, ""};
205 screenshare.screenshare = {true, 10};
206 screenshare.analyzer = {"screenshare_slides_lossy_net", 0.0, 0.0,
207 kFullStackTestDurationSecs};
sprangee37de32015-11-23 06:10:23 -0800208 screenshare.pipe.loss_percent = 5;
209 screenshare.pipe.queue_delay_ms = 200;
210 screenshare.pipe.link_capacity_kbps = 500;
211 RunTest(screenshare);
212}
213
214TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_VeryLossyNet) {
minyuef07fb002016-09-08 08:20:07 -0700215 VideoQualityTest::Params screenshare;
216 screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false,
217 "VP8", 2, 1, 400000, true, ""};
218 screenshare.screenshare = {true, 10};
219 screenshare.analyzer = {"screenshare_slides_very_lossy", 0.0, 0.0,
220 kFullStackTestDurationSecs};
sprangee37de32015-11-23 06:10:23 -0800221 screenshare.pipe.loss_percent = 10;
222 screenshare.pipe.queue_delay_ms = 200;
223 screenshare.pipe.link_capacity_kbps = 500;
224 RunTest(screenshare);
225}
226
Peter Boström12996152016-05-14 02:03:18 +0200227#if !defined(RTC_DISABLE_VP9)
philipelcfc319b2015-11-10 07:17:23 -0800228TEST_F(FullStackTest, ScreenshareSlidesVP9_2SL) {
minyuef07fb002016-09-08 08:20:07 -0700229 VideoQualityTest::Params screenshare;
230 screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false,
231 "VP9", 1, 0, 400000, true, ""};
232 screenshare.screenshare = {true, 10};
233 screenshare.analyzer = {"screenshare_slides_vp9_2sl", 0.0, 0.0,
234 kFullStackTestDurationSecs};
235 screenshare.logs = false;
236 screenshare.ss = {std::vector<VideoStream>(), 0, 2, 1};
ivica5d6a06c2015-09-17 05:30:24 -0700237 RunTest(screenshare);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000238}
Peter Boström12996152016-05-14 02:03:18 +0200239#endif // !defined(RTC_DISABLE_VP9)
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000240} // namespace webrtc