blob: 368341370a5b567b5fdb966f47d26b0c58588820 [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 = {
mflodman48a4beb2016-07-01 13:03:59 +020028 {352, 288, 30, 700000, 700000, 700000, false, video_codec, 1},
asapersson88b0a222016-02-12 13:16:43 -080029 {"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 = {
mflodman48a4beb2016-07-01 13:03:59 +020038 {352, 288, 30, 30000, 500000, 2000000, false, video_codec, 1},
asapersson88b0a222016-02-12 13:16:43 -080039 {"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
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) {
ivica5d6a06c2015-09-17 05:30:24 -070070 VideoQualityTest::Params paris_qcif = {
mflodman48a4beb2016-07-01 13:03:59 +020071 {176, 144, 30, 300000, 300000, 300000, false, "VP8", 1},
ivica5d6a06c2015-09-17 05:30:24 -070072 {"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.
ivica5d6a06c2015-09-17 05:30:24 -070080 VideoQualityTest::Params foreman_cif = {
mflodman48a4beb2016-07-01 13:03:59 +020081 {352, 288, 30, 700000, 700000, 700000, false, "VP8", 1},
ivica5d6a06c2015-09-17 05:30:24 -070082 {"foreman_cif"},
83 {},
84 {"foreman_cif_net_delay_0_0_plr_0", 0.0, 0.0, kFullStackTestDurationSecs}
85 };
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) {
ivica5d6a06c2015-09-17 05:30:24 -070090 VideoQualityTest::Params foreman_cif = {
mflodman48a4beb2016-07-01 13:03:59 +020091 {352, 288, 30, 30000, 500000, 2000000, false, "VP8", 1},
ivica5d6a06c2015-09-17 05:30:24 -070092 {"foreman_cif"},
93 {},
94 {"foreman_cif_delay_50_0_plr_5", 0.0, 0.0, kFullStackTestDurationSecs}};
95 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) {
ivica5d6a06c2015-09-17 05:30:24 -0700101 VideoQualityTest::Params foreman_cif = {
mflodman48a4beb2016-07-01 13:03:59 +0200102 {352, 288, 30, 30000, 500000, 2000000, false, "VP8", 1},
ivica5d6a06c2015-09-17 05:30:24 -0700103 {"foreman_cif"},
104 {},
105 {"foreman_cif_500kbps", 0.0, 0.0, kFullStackTestDurationSecs}};
106 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) {
ivica5d6a06c2015-09-17 05:30:24 -0700113 VideoQualityTest::Params foreman_cif = {
mflodman48a4beb2016-07-01 13:03:59 +0200114 {352, 288, 30, 30000, 500000, 2000000, false, "VP8", 1},
ivica5d6a06c2015-09-17 05:30:24 -0700115 {"foreman_cif"},
116 {},
117 {"foreman_cif_500kbps_32pkts_queue", 0.0, 0.0, kFullStackTestDurationSecs}
118 };
119 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) {
ivica5d6a06c2015-09-17 05:30:24 -0700126 VideoQualityTest::Params foreman_cif = {
mflodman48a4beb2016-07-01 13:03:59 +0200127 {352, 288, 30, 30000, 500000, 2000000, false, "VP8", 1},
ivica5d6a06c2015-09-17 05:30:24 -0700128 {"foreman_cif"},
129 {},
130 {"foreman_cif_500kbps_100ms", 0.0, 0.0, kFullStackTestDurationSecs}};
131 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) {
ivica5d6a06c2015-09-17 05:30:24 -0700138 VideoQualityTest::Params foreman_cif = {
mflodman48a4beb2016-07-01 13:03:59 +0200139 {352, 288, 30, 30000, 500000, 2000000, false, "VP8", 1},
ivica5d6a06c2015-09-17 05:30:24 -0700140 {"foreman_cif"},
141 {},
142 {"foreman_cif_500kbps_100ms_32pkts_queue", 0.0, 0.0,
143 kFullStackTestDurationSecs}};
144 foreman_cif.pipe.queue_length_packets = 32;
145 foreman_cif.pipe.queue_delay_ms = 100;
146 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000147 RunTest(foreman_cif);
148}
149
150TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) {
ivica5d6a06c2015-09-17 05:30:24 -0700151 VideoQualityTest::Params foreman_cif = {
mflodman48a4beb2016-07-01 13:03:59 +0200152 {352, 288, 30, 30000, 2000000, 2000000, false, "VP8", 1},
ivica5d6a06c2015-09-17 05:30:24 -0700153 {"foreman_cif"},
154 {},
155 {"foreman_cif_1000kbps_100ms_32pkts_queue", 0.0, 0.0,
156 kFullStackTestDurationSecs}};
157 foreman_cif.pipe.queue_length_packets = 32;
158 foreman_cif.pipe.queue_delay_ms = 100;
159 foreman_cif.pipe.link_capacity_kbps = 1000;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000160 RunTest(foreman_cif);
161}
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000162
ivica7bd242e2015-10-06 02:04:06 -0700163TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL) {
ivica5d6a06c2015-09-17 05:30:24 -0700164 VideoQualityTest::Params screenshare = {
mflodman48a4beb2016-07-01 13:03:59 +0200165 {1850, 1110, 5, 50000, 200000, 2000000, false, "VP8", 2, 1, 400000},
sprangce4aef12015-11-02 07:23:20 -0800166 {},
167 {true, 10},
ivica5d6a06c2015-09-17 05:30:24 -0700168 {"screenshare_slides", 0.0, 0.0, kFullStackTestDurationSecs}};
169 RunTest(screenshare);
Erik Språng6ee69aa2015-09-03 15:58:05 +0200170}
171
ivica7bd242e2015-10-06 02:04:06 -0700172TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_Scroll) {
ivica5d6a06c2015-09-17 05:30:24 -0700173 VideoQualityTest::Params config = {
mflodman48a4beb2016-07-01 13:03:59 +0200174 {1850, 1110 / 2, 5, 50000, 200000, 2000000, false, "VP8", 2, 1, 400000},
ivica5d6a06c2015-09-17 05:30:24 -0700175 {},
176 {true, 10, 2},
177 {"screenshare_slides_scrolling", 0.0, 0.0, kFullStackTestDurationSecs}};
178 RunTest(config);
ivica028cf482015-07-30 02:15:56 -0700179}
180
sprangee37de32015-11-23 06:10:23 -0800181TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_LossyNet) {
182 VideoQualityTest::Params screenshare = {
mflodman48a4beb2016-07-01 13:03:59 +0200183 {1850, 1110, 5, 50000, 200000, 2000000, false, "VP8", 2, 1, 400000},
sprangee37de32015-11-23 06:10:23 -0800184 {}, // Video-specific.
185 {true, 10}, // Screenshare-specific.
186 {"screenshare_slides_lossy_net", 0.0, 0.0, kFullStackTestDurationSecs}};
187 screenshare.pipe.loss_percent = 5;
188 screenshare.pipe.queue_delay_ms = 200;
189 screenshare.pipe.link_capacity_kbps = 500;
190 RunTest(screenshare);
191}
192
193TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_VeryLossyNet) {
194 VideoQualityTest::Params screenshare = {
mflodman48a4beb2016-07-01 13:03:59 +0200195 {1850, 1110, 5, 50000, 200000, 2000000, false, "VP8", 2, 1, 400000},
sprangee37de32015-11-23 06:10:23 -0800196 {}, // Video-specific.
197 {true, 10}, // Screenshare-specific.
198 {"screenshare_slides_very_lossy", 0.0, 0.0, kFullStackTestDurationSecs}};
199 screenshare.pipe.loss_percent = 10;
200 screenshare.pipe.queue_delay_ms = 200;
201 screenshare.pipe.link_capacity_kbps = 500;
202 RunTest(screenshare);
203}
204
Peter Boström12996152016-05-14 02:03:18 +0200205#if !defined(RTC_DISABLE_VP9)
philipelcfc319b2015-11-10 07:17:23 -0800206TEST_F(FullStackTest, ScreenshareSlidesVP9_2SL) {
ivica5d6a06c2015-09-17 05:30:24 -0700207 VideoQualityTest::Params screenshare = {
mflodman48a4beb2016-07-01 13:03:59 +0200208 {1850, 1110, 5, 50000, 200000, 2000000, false, "VP9", 1, 0, 400000},
ivica5d6a06c2015-09-17 05:30:24 -0700209 {},
210 {true, 10},
philipel464c0872015-11-13 02:08:04 -0800211 {"screenshare_slides_vp9_2sl", 0.0, 0.0, kFullStackTestDurationSecs},
philipelcfc319b2015-11-10 07:17:23 -0800212 {},
213 false,
214 {std::vector<VideoStream>(), 0, 2, 1}};
ivica5d6a06c2015-09-17 05:30:24 -0700215 RunTest(screenshare);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000216}
Peter Boström12996152016-05-14 02:03:18 +0200217#endif // !defined(RTC_DISABLE_VP9)
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000218} // namespace webrtc