blob: 8a97ba8a9a13b5fbe3e27bd1d34abd6ab4fadc0d [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.
27 VideoQualityTest::Params foreman_cif = {
28 {352, 288, 30, 700000, 700000, 700000, video_codec, 1},
29 {"foreman_cif"},
30 {},
31 {"foreman_cif_net_delay_0_0_plr_0_" + video_codec, 0.0, 0.0,
32 kFullStackTestDurationSecs}};
33 RunTest(foreman_cif);
34 }
35
36 void ForemanCifPlr5(const std::string& video_codec) {
37 VideoQualityTest::Params foreman_cif = {
38 {352, 288, 30, 30000, 500000, 2000000, video_codec, 1},
39 {"foreman_cif"},
40 {},
41 {"foreman_cif_delay_50_0_plr_5_" + video_codec, 0.0, 0.0,
42 kFullStackTestDurationSecs}};
43 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
asapersson88b0a222016-02-12 13:16:43 -080059TEST_F(FullStackTest, ForemanCifWithoutPacketLossVp9) {
60 ForemanCifWithoutPacketLoss("VP9");
61}
62
63TEST_F(FullStackTest, ForemanCifPlr5Vp9) {
64 ForemanCifPlr5("VP9");
65}
66
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000067TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) {
ivica5d6a06c2015-09-17 05:30:24 -070068 VideoQualityTest::Params paris_qcif = {
69 {176, 144, 30, 300000, 300000, 300000, "VP8", 1},
70 {"paris_qcif"},
71 {},
72 {"net_delay_0_0_plr_0", 36.0, 0.96, 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.
ivica5d6a06c2015-09-17 05:30:24 -070078 VideoQualityTest::Params foreman_cif = {
79 {352, 288, 30, 700000, 700000, 700000, "VP8", 1},
80 {"foreman_cif"},
81 {},
82 {"foreman_cif_net_delay_0_0_plr_0", 0.0, 0.0, kFullStackTestDurationSecs}
83 };
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000084 RunTest(foreman_cif);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000085}
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000086
sprang@webrtc.org343096a2015-02-23 08:34:17 +000087TEST_F(FullStackTest, ForemanCifPlr5) {
ivica5d6a06c2015-09-17 05:30:24 -070088 VideoQualityTest::Params foreman_cif = {
89 {352, 288, 30, 30000, 500000, 2000000, "VP8", 1},
90 {"foreman_cif"},
91 {},
92 {"foreman_cif_delay_50_0_plr_5", 0.0, 0.0, kFullStackTestDurationSecs}};
93 foreman_cif.pipe.loss_percent = 5;
94 foreman_cif.pipe.queue_delay_ms = 50;
stefan@webrtc.orgc216b9a2014-10-14 10:38:49 +000095 RunTest(foreman_cif);
96}
97
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000098TEST_F(FullStackTest, ForemanCif500kbps) {
ivica5d6a06c2015-09-17 05:30:24 -070099 VideoQualityTest::Params foreman_cif = {
100 {352, 288, 30, 30000, 500000, 2000000, "VP8", 1},
101 {"foreman_cif"},
102 {},
103 {"foreman_cif_500kbps", 0.0, 0.0, kFullStackTestDurationSecs}};
104 foreman_cif.pipe.queue_length_packets = 0;
105 foreman_cif.pipe.queue_delay_ms = 0;
106 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000107 RunTest(foreman_cif);
108}
109
110TEST_F(FullStackTest, ForemanCif500kbpsLimitedQueue) {
ivica5d6a06c2015-09-17 05:30:24 -0700111 VideoQualityTest::Params foreman_cif = {
112 {352, 288, 30, 30000, 500000, 2000000, "VP8", 1},
113 {"foreman_cif"},
114 {},
115 {"foreman_cif_500kbps_32pkts_queue", 0.0, 0.0, kFullStackTestDurationSecs}
116 };
117 foreman_cif.pipe.queue_length_packets = 32;
118 foreman_cif.pipe.queue_delay_ms = 0;
119 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000120 RunTest(foreman_cif);
121}
122
123TEST_F(FullStackTest, ForemanCif500kbps100ms) {
ivica5d6a06c2015-09-17 05:30:24 -0700124 VideoQualityTest::Params foreman_cif = {
125 {352, 288, 30, 30000, 500000, 2000000, "VP8", 1},
126 {"foreman_cif"},
127 {},
128 {"foreman_cif_500kbps_100ms", 0.0, 0.0, kFullStackTestDurationSecs}};
129 foreman_cif.pipe.queue_length_packets = 0;
130 foreman_cif.pipe.queue_delay_ms = 100;
131 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000132 RunTest(foreman_cif);
133}
134
135TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueue) {
ivica5d6a06c2015-09-17 05:30:24 -0700136 VideoQualityTest::Params foreman_cif = {
137 {352, 288, 30, 30000, 500000, 2000000, "VP8", 1},
138 {"foreman_cif"},
139 {},
140 {"foreman_cif_500kbps_100ms_32pkts_queue", 0.0, 0.0,
141 kFullStackTestDurationSecs}};
142 foreman_cif.pipe.queue_length_packets = 32;
143 foreman_cif.pipe.queue_delay_ms = 100;
144 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000145 RunTest(foreman_cif);
146}
147
148TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) {
ivica5d6a06c2015-09-17 05:30:24 -0700149 VideoQualityTest::Params foreman_cif = {
ivica1356ba52015-09-22 01:09:11 -0700150 {352, 288, 30, 30000, 2000000, 2000000, "VP8", 1},
ivica5d6a06c2015-09-17 05:30:24 -0700151 {"foreman_cif"},
152 {},
153 {"foreman_cif_1000kbps_100ms_32pkts_queue", 0.0, 0.0,
154 kFullStackTestDurationSecs}};
155 foreman_cif.pipe.queue_length_packets = 32;
156 foreman_cif.pipe.queue_delay_ms = 100;
157 foreman_cif.pipe.link_capacity_kbps = 1000;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000158 RunTest(foreman_cif);
159}
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000160
ivica7bd242e2015-10-06 02:04:06 -0700161TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL) {
ivica5d6a06c2015-09-17 05:30:24 -0700162 VideoQualityTest::Params screenshare = {
sprangce4aef12015-11-02 07:23:20 -0800163 {1850, 1110, 5, 50000, 200000, 2000000, "VP8", 2, 1, 400000},
164 {},
165 {true, 10},
ivica5d6a06c2015-09-17 05:30:24 -0700166 {"screenshare_slides", 0.0, 0.0, kFullStackTestDurationSecs}};
167 RunTest(screenshare);
Erik Språng6ee69aa2015-09-03 15:58:05 +0200168}
169
ivica7bd242e2015-10-06 02:04:06 -0700170TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_Scroll) {
ivica5d6a06c2015-09-17 05:30:24 -0700171 VideoQualityTest::Params config = {
sprangce4aef12015-11-02 07:23:20 -0800172 {1850, 1110 / 2, 5, 50000, 200000, 2000000, "VP8", 2, 1, 400000},
ivica5d6a06c2015-09-17 05:30:24 -0700173 {},
174 {true, 10, 2},
175 {"screenshare_slides_scrolling", 0.0, 0.0, kFullStackTestDurationSecs}};
176 RunTest(config);
ivica028cf482015-07-30 02:15:56 -0700177}
178
sprangee37de32015-11-23 06:10:23 -0800179TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_LossyNet) {
180 VideoQualityTest::Params screenshare = {
181 {1850, 1110, 5, 50000, 200000, 2000000, "VP8", 2, 1, 400000},
182 {}, // Video-specific.
183 {true, 10}, // Screenshare-specific.
184 {"screenshare_slides_lossy_net", 0.0, 0.0, kFullStackTestDurationSecs}};
185 screenshare.pipe.loss_percent = 5;
186 screenshare.pipe.queue_delay_ms = 200;
187 screenshare.pipe.link_capacity_kbps = 500;
188 RunTest(screenshare);
189}
190
191TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_VeryLossyNet) {
192 VideoQualityTest::Params screenshare = {
193 {1850, 1110, 5, 50000, 200000, 2000000, "VP8", 2, 1, 400000},
194 {}, // Video-specific.
195 {true, 10}, // Screenshare-specific.
196 {"screenshare_slides_very_lossy", 0.0, 0.0, kFullStackTestDurationSecs}};
197 screenshare.pipe.loss_percent = 10;
198 screenshare.pipe.queue_delay_ms = 200;
199 screenshare.pipe.link_capacity_kbps = 500;
200 RunTest(screenshare);
201}
202
philipelcfc319b2015-11-10 07:17:23 -0800203TEST_F(FullStackTest, ScreenshareSlidesVP9_2SL) {
ivica5d6a06c2015-09-17 05:30:24 -0700204 VideoQualityTest::Params screenshare = {
philipelcfc319b2015-11-10 07:17:23 -0800205 {1850, 1110, 5, 50000, 200000, 2000000, "VP9", 1, 0, 400000},
ivica5d6a06c2015-09-17 05:30:24 -0700206 {},
207 {true, 10},
philipel464c0872015-11-13 02:08:04 -0800208 {"screenshare_slides_vp9_2sl", 0.0, 0.0, kFullStackTestDurationSecs},
philipelcfc319b2015-11-10 07:17:23 -0800209 {},
210 false,
211 {std::vector<VideoStream>(), 0, 2, 1}};
ivica5d6a06c2015-09-17 05:30:24 -0700212 RunTest(screenshare);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000213}
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000214} // namespace webrtc