blob: c7d1bec1c07156540b5ad6b74cbe5e7163a51dc7 [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
kwiberg77eab702016-09-28 17:42:01 -070012#include "webrtc/test/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.
kjellander5865f482016-09-08 10:52:38 -070027 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}};
asapersson88b0a222016-02-12 13:16:43 -080033 RunTest(foreman_cif);
34 }
35
36 void ForemanCifPlr5(const std::string& video_codec) {
kjellander5865f482016-09-08 10:52:38 -070037 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}};
asapersson88b0a222016-02-12 13:16:43 -080043 foreman_cif.pipe.loss_percent = 5;
44 foreman_cif.pipe.queue_delay_ms = 50;
45 RunTest(foreman_cif);
46 }
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000047};
48
sprangce4aef12015-11-02 07:23:20 -080049// 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.orgaf8d5af2013-07-09 08:02:33 +000058
Peter Boström12996152016-05-14 02:03:18 +020059#if !defined(RTC_DISABLE_VP9)
asapersson88b0a222016-02-12 13:16:43 -080060TEST_F(FullStackTest, ForemanCifWithoutPacketLossVp9) {
61 ForemanCifWithoutPacketLoss("VP9");
62}
63
64TEST_F(FullStackTest, ForemanCifPlr5Vp9) {
65 ForemanCifPlr5("VP9");
66}
Peter Boström12996152016-05-14 02:03:18 +020067#endif // !defined(RTC_DISABLE_VP9)
asapersson88b0a222016-02-12 13:16:43 -080068
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000069TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) {
kjellander5865f482016-09-08 10:52:38 -070070 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.orgb8e9e442014-07-09 11:29:06 +000075 RunTest(paris_qcif);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000076}
77
78TEST_F(FullStackTest, ForemanCifWithoutPacketLoss) {
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000079 // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif.
kjellander5865f482016-09-08 10:52:38 -070080 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.orgb8e9e442014-07-09 11:29:06 +000086 RunTest(foreman_cif);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000087}
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000088
sprang@webrtc.org343096a2015-02-23 08:34:17 +000089TEST_F(FullStackTest, ForemanCifPlr5) {
kjellander5865f482016-09-08 10:52:38 -070090 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}};
ivica5d6a06c2015-09-17 05:30:24 -070095 foreman_cif.pipe.loss_percent = 5;
96 foreman_cif.pipe.queue_delay_ms = 50;
stefan@webrtc.orgc216b9a2014-10-14 10:38:49 +000097 RunTest(foreman_cif);
98}
99
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000100TEST_F(FullStackTest, ForemanCif500kbps) {
kjellander5865f482016-09-08 10:52:38 -0700101 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}};
ivica5d6a06c2015-09-17 05:30:24 -0700106 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.orgb8e9e442014-07-09 11:29:06 +0000109 RunTest(foreman_cif);
110}
111
112TEST_F(FullStackTest, ForemanCif500kbpsLimitedQueue) {
kjellander5865f482016-09-08 10:52:38 -0700113 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}};
ivica5d6a06c2015-09-17 05:30:24 -0700119 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.orgb8e9e442014-07-09 11:29:06 +0000122 RunTest(foreman_cif);
123}
124
125TEST_F(FullStackTest, ForemanCif500kbps100ms) {
kjellander5865f482016-09-08 10:52:38 -0700126 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}};
ivica5d6a06c2015-09-17 05:30:24 -0700131 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.orgb8e9e442014-07-09 11:29:06 +0000134 RunTest(foreman_cif);
135}
136
137TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueue) {
kjellander5865f482016-09-08 10:52:38 -0700138 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}};
stefanb1797672016-08-11 07:00:57 -0700144 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) {
kjellander5865f482016-09-08 10:52:38 -0700151 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}};
ivica5d6a06c2015-09-17 05:30:24 -0700157 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.orgb8e9e442014-07-09 11:29:06 +0000160 RunTest(foreman_cif);
161}
162
163TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) {
kjellander5865f482016-09-08 10:52:38 -0700164 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}};
ivica5d6a06c2015-09-17 05:30:24 -0700170 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.orgb8e9e442014-07-09 11:29:06 +0000173 RunTest(foreman_cif);
174}
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000175
stefanb1797672016-08-11 07:00:57 -0700176TEST_F(FullStackTest, ConferenceMotionHd2000kbps100msLimitedQueue) {
kjellander5865f482016-09-08 10:52:38 -0700177 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}};
stefanb1797672016-08-11 07:00:57 -0700183 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
ivica7bd242e2015-10-06 02:04:06 -0700189TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL) {
kjellander5865f482016-09-08 10:52:38 -0700190 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}};
ivica5d6a06c2015-09-17 05:30:24 -0700195 RunTest(screenshare);
Erik Språng6ee69aa2015-09-03 15:58:05 +0200196}
197
ivica7bd242e2015-10-06 02:04:06 -0700198TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_Scroll) {
kjellander5865f482016-09-08 10:52:38 -0700199 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}};
ivica5d6a06c2015-09-17 05:30:24 -0700205 RunTest(config);
ivica028cf482015-07-30 02:15:56 -0700206}
207
sprangee37de32015-11-23 06:10:23 -0800208TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_LossyNet) {
kjellander5865f482016-09-08 10:52:38 -0700209 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}};
sprangee37de32015-11-23 06:10:23 -0800214 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) {
kjellander5865f482016-09-08 10:52:38 -0700221 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}};
sprangee37de32015-11-23 06:10:23 -0800226 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öm12996152016-05-14 02:03:18 +0200232#if !defined(RTC_DISABLE_VP9)
philipelcfc319b2015-11-10 07:17:23 -0800233TEST_F(FullStackTest, ScreenshareSlidesVP9_2SL) {
kjellander5865f482016-09-08 10:52:38 -0700234 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}};
ivica5d6a06c2015-09-17 05:30:24 -0700242 RunTest(screenshare);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000243}
Peter Boström12996152016-05-14 02:03:18 +0200244#endif // !defined(RTC_DISABLE_VP9)
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000245} // namespace webrtc