pbos@webrtc.org | 2f02da8 | 2013-07-09 08:02:33 | [diff] [blame] | 1 | /* |
| 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 | |
kwiberg | 15b966d | 2016-09-29 00:42:01 | [diff] [blame^] | 12 | #include "webrtc/test/gtest.h" |
ivica | da8e7c9 | 2015-09-17 12:30:24 | [diff] [blame] | 13 | #include "webrtc/video/video_quality_test.h" |
pbos@webrtc.org | 2f02da8 | 2013-07-09 08:02:33 | [diff] [blame] | 14 | |
pbos@webrtc.org | 2f02da8 | 2013-07-09 08:02:33 | [diff] [blame] | 15 | namespace webrtc { |
| 16 | |
stefan@webrtc.org | 79b66f4 | 2014-07-09 11:29:06 | [diff] [blame] | 17 | static const int kFullStackTestDurationSecs = 60; |
pbos@webrtc.org | 4b50db1 | 2013-12-03 10:13:04 | [diff] [blame] | 18 | |
ivica | da8e7c9 | 2015-09-17 12:30:24 | [diff] [blame] | 19 | class FullStackTest : public VideoQualityTest { |
pbos@webrtc.org | 2f02da8 | 2013-07-09 08:02:33 | [diff] [blame] | 20 | public: |
ivica | da8e7c9 | 2015-09-17 12:30:24 | [diff] [blame] | 21 | void RunTest(const VideoQualityTest::Params ¶ms) { |
| 22 | RunWithAnalyzer(params); |
pbos@webrtc.org | a24c356 | 2013-10-16 11:05:37 | [diff] [blame] | 23 | } |
asapersson | 8814c4d | 2016-02-12 21:16:43 | [diff] [blame] | 24 | |
| 25 | void ForemanCifWithoutPacketLoss(const std::string& video_codec) { |
| 26 | // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif. |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 27 | 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}}; |
asapersson | 8814c4d | 2016-02-12 21:16:43 | [diff] [blame] | 33 | RunTest(foreman_cif); |
| 34 | } |
| 35 | |
| 36 | void ForemanCifPlr5(const std::string& video_codec) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 37 | 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}}; |
asapersson | 8814c4d | 2016-02-12 21:16:43 | [diff] [blame] | 43 | foreman_cif.pipe.loss_percent = 5; |
| 44 | foreman_cif.pipe.queue_delay_ms = 50; |
| 45 | RunTest(foreman_cif); |
| 46 | } |
pbos@webrtc.org | 2f02da8 | 2013-07-09 08:02:33 | [diff] [blame] | 47 | }; |
| 48 | |
sprang | 0ba16d1 | 2015-11-02 15:23:20 | [diff] [blame] | 49 | // 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.org | 2f02da8 | 2013-07-09 08:02:33 | [diff] [blame] | 58 | |
Peter Boström | 81950aa | 2016-05-14 00:03:18 | [diff] [blame] | 59 | #if !defined(RTC_DISABLE_VP9) |
asapersson | 8814c4d | 2016-02-12 21:16:43 | [diff] [blame] | 60 | TEST_F(FullStackTest, ForemanCifWithoutPacketLossVp9) { |
| 61 | ForemanCifWithoutPacketLoss("VP9"); |
| 62 | } |
| 63 | |
| 64 | TEST_F(FullStackTest, ForemanCifPlr5Vp9) { |
| 65 | ForemanCifPlr5("VP9"); |
| 66 | } |
Peter Boström | 81950aa | 2016-05-14 00:03:18 | [diff] [blame] | 67 | #endif // !defined(RTC_DISABLE_VP9) |
asapersson | 8814c4d | 2016-02-12 21:16:43 | [diff] [blame] | 68 | |
pbos@webrtc.org | eb67a6b | 2014-06-27 08:47:52 | [diff] [blame] | 69 | TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 70 | 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.org | 79b66f4 | 2014-07-09 11:29:06 | [diff] [blame] | 75 | RunTest(paris_qcif); |
pbos@webrtc.org | eb67a6b | 2014-06-27 08:47:52 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | TEST_F(FullStackTest, ForemanCifWithoutPacketLoss) { |
stefan@webrtc.org | 79b66f4 | 2014-07-09 11:29:06 | [diff] [blame] | 79 | // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif. |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 80 | 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.org | 79b66f4 | 2014-07-09 11:29:06 | [diff] [blame] | 86 | RunTest(foreman_cif); |
pbos@webrtc.org | eb67a6b | 2014-06-27 08:47:52 | [diff] [blame] | 87 | } |
pbos@webrtc.org | 2f02da8 | 2013-07-09 08:02:33 | [diff] [blame] | 88 | |
sprang@webrtc.org | 617b41a | 2015-02-23 08:34:17 | [diff] [blame] | 89 | TEST_F(FullStackTest, ForemanCifPlr5) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 90 | 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}}; |
ivica | da8e7c9 | 2015-09-17 12:30:24 | [diff] [blame] | 95 | foreman_cif.pipe.loss_percent = 5; |
| 96 | foreman_cif.pipe.queue_delay_ms = 50; |
stefan@webrtc.org | 6368255 | 2014-10-14 10:38:49 | [diff] [blame] | 97 | RunTest(foreman_cif); |
| 98 | } |
| 99 | |
stefan@webrtc.org | 79b66f4 | 2014-07-09 11:29:06 | [diff] [blame] | 100 | TEST_F(FullStackTest, ForemanCif500kbps) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 101 | 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}}; |
ivica | da8e7c9 | 2015-09-17 12:30:24 | [diff] [blame] | 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.org | 79b66f4 | 2014-07-09 11:29:06 | [diff] [blame] | 109 | RunTest(foreman_cif); |
| 110 | } |
| 111 | |
| 112 | TEST_F(FullStackTest, ForemanCif500kbpsLimitedQueue) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 113 | 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}}; |
ivica | da8e7c9 | 2015-09-17 12:30:24 | [diff] [blame] | 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.org | 79b66f4 | 2014-07-09 11:29:06 | [diff] [blame] | 122 | RunTest(foreman_cif); |
| 123 | } |
| 124 | |
| 125 | TEST_F(FullStackTest, ForemanCif500kbps100ms) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 126 | 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}}; |
ivica | da8e7c9 | 2015-09-17 12:30:24 | [diff] [blame] | 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.org | 79b66f4 | 2014-07-09 11:29:06 | [diff] [blame] | 134 | RunTest(foreman_cif); |
| 135 | } |
| 136 | |
| 137 | TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueue) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 138 | 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}}; |
stefan | 1257c11 | 2016-08-11 14:00:57 | [diff] [blame] | 144 | 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 | |
| 150 | TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueueRecvBwe) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 151 | 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}}; |
ivica | da8e7c9 | 2015-09-17 12:30:24 | [diff] [blame] | 157 | 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.org | 79b66f4 | 2014-07-09 11:29:06 | [diff] [blame] | 160 | RunTest(foreman_cif); |
| 161 | } |
| 162 | |
| 163 | TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 164 | 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}}; |
ivica | da8e7c9 | 2015-09-17 12:30:24 | [diff] [blame] | 170 | 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.org | 79b66f4 | 2014-07-09 11:29:06 | [diff] [blame] | 173 | RunTest(foreman_cif); |
| 174 | } |
sprang@webrtc.org | 5fbd940 | 2015-02-18 12:46:06 | [diff] [blame] | 175 | |
stefan | 1257c11 | 2016-08-11 14:00:57 | [diff] [blame] | 176 | TEST_F(FullStackTest, ConferenceMotionHd2000kbps100msLimitedQueue) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 177 | 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}}; |
stefan | 1257c11 | 2016-08-11 14:00:57 | [diff] [blame] | 183 | 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 | |
ivica | 47dc3f3 | 2015-10-06 09:04:06 | [diff] [blame] | 189 | TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 190 | 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}}; |
ivica | da8e7c9 | 2015-09-17 12:30:24 | [diff] [blame] | 195 | RunTest(screenshare); |
Erik Språng | 296bbaf | 2015-09-03 13:58:05 | [diff] [blame] | 196 | } |
| 197 | |
ivica | 47dc3f3 | 2015-10-06 09:04:06 | [diff] [blame] | 198 | TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_Scroll) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 199 | 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}}; |
ivica | da8e7c9 | 2015-09-17 12:30:24 | [diff] [blame] | 205 | RunTest(config); |
ivica | 9879757 | 2015-07-30 09:15:56 | [diff] [blame] | 206 | } |
| 207 | |
sprang | 2b1da16 | 2015-11-23 14:10:23 | [diff] [blame] | 208 | TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_LossyNet) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 209 | 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}}; |
sprang | 2b1da16 | 2015-11-23 14:10:23 | [diff] [blame] | 214 | screenshare.pipe.loss_percent = 5; |
| 215 | screenshare.pipe.queue_delay_ms = 200; |
| 216 | screenshare.pipe.link_capacity_kbps = 500; |
| 217 | RunTest(screenshare); |
| 218 | } |
| 219 | |
| 220 | TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_VeryLossyNet) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 221 | 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}}; |
sprang | 2b1da16 | 2015-11-23 14:10:23 | [diff] [blame] | 226 | 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öm | 81950aa | 2016-05-14 00:03:18 | [diff] [blame] | 232 | #if !defined(RTC_DISABLE_VP9) |
philipel | 3c05bee | 2015-11-10 15:17:23 | [diff] [blame] | 233 | TEST_F(FullStackTest, ScreenshareSlidesVP9_2SL) { |
kjellander | 2853a4b | 2016-09-08 17:52:38 | [diff] [blame] | 234 | 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}}; |
ivica | da8e7c9 | 2015-09-17 12:30:24 | [diff] [blame] | 242 | RunTest(screenshare); |
sprang@webrtc.org | 5fbd940 | 2015-02-18 12:46:06 | [diff] [blame] | 243 | } |
Peter Boström | 81950aa | 2016-05-14 00:03:18 | [diff] [blame] | 244 | #endif // !defined(RTC_DISABLE_VP9) |
pbos@webrtc.org | 2f02da8 | 2013-07-09 08:02:33 | [diff] [blame] | 245 | } // namespace webrtc |