pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [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 | |
pbos@webrtc.org | 69215d8 | 2013-07-10 15:02:02 +0000 | [diff] [blame] | 12 | #include "testing/gtest/include/gtest/gtest.h" |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 13 | #include "webrtc/video/video_quality_test.h" |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [diff] [blame] | 14 | |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [diff] [blame] | 15 | namespace webrtc { |
| 16 | |
stefan@webrtc.org | b8e9e44 | 2014-07-09 11:29:06 +0000 | [diff] [blame] | 17 | static const int kFullStackTestDurationSecs = 60; |
pbos@webrtc.org | b613b5a | 2013-12-03 10:13:04 +0000 | [diff] [blame] | 18 | |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 19 | class FullStackTest : public VideoQualityTest { |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [diff] [blame] | 20 | public: |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 21 | void RunTest(const VideoQualityTest::Params ¶ms) { |
| 22 | RunWithAnalyzer(params); |
pbos@webrtc.org | 9401524 | 2013-10-16 11:05:37 +0000 | [diff] [blame] | 23 | } |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [diff] [blame] | 24 | }; |
| 25 | |
sprang | ce4aef1 | 2015-11-02 07:23:20 -0800 | [diff] [blame^] | 26 | // VideoQualityTest::Params params = { |
| 27 | // { ... }, // Common. |
| 28 | // { ... }, // Video-specific settings. |
| 29 | // { ... }, // Screenshare-specific settings. |
| 30 | // { ... }, // Analyzer settings. |
| 31 | // pipe, // FakeNetworkPipe::Config |
| 32 | // { ... }, // Spatial scalability. |
| 33 | // logs // bool |
| 34 | // }; |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [diff] [blame] | 35 | |
pbos@webrtc.org | 994d0b7 | 2014-06-27 08:47:52 +0000 | [diff] [blame] | 36 | TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) { |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 37 | VideoQualityTest::Params paris_qcif = { |
| 38 | {176, 144, 30, 300000, 300000, 300000, "VP8", 1}, |
| 39 | {"paris_qcif"}, |
| 40 | {}, |
| 41 | {"net_delay_0_0_plr_0", 36.0, 0.96, kFullStackTestDurationSecs}}; |
stefan@webrtc.org | b8e9e44 | 2014-07-09 11:29:06 +0000 | [diff] [blame] | 42 | RunTest(paris_qcif); |
pbos@webrtc.org | 994d0b7 | 2014-06-27 08:47:52 +0000 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | TEST_F(FullStackTest, ForemanCifWithoutPacketLoss) { |
stefan@webrtc.org | b8e9e44 | 2014-07-09 11:29:06 +0000 | [diff] [blame] | 46 | // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif. |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 47 | VideoQualityTest::Params foreman_cif = { |
| 48 | {352, 288, 30, 700000, 700000, 700000, "VP8", 1}, |
| 49 | {"foreman_cif"}, |
| 50 | {}, |
| 51 | {"foreman_cif_net_delay_0_0_plr_0", 0.0, 0.0, kFullStackTestDurationSecs} |
| 52 | }; |
stefan@webrtc.org | b8e9e44 | 2014-07-09 11:29:06 +0000 | [diff] [blame] | 53 | RunTest(foreman_cif); |
pbos@webrtc.org | 994d0b7 | 2014-06-27 08:47:52 +0000 | [diff] [blame] | 54 | } |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [diff] [blame] | 55 | |
sprang@webrtc.org | 343096a | 2015-02-23 08:34:17 +0000 | [diff] [blame] | 56 | TEST_F(FullStackTest, ForemanCifPlr5) { |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 57 | VideoQualityTest::Params foreman_cif = { |
| 58 | {352, 288, 30, 30000, 500000, 2000000, "VP8", 1}, |
| 59 | {"foreman_cif"}, |
| 60 | {}, |
| 61 | {"foreman_cif_delay_50_0_plr_5", 0.0, 0.0, kFullStackTestDurationSecs}}; |
| 62 | foreman_cif.pipe.loss_percent = 5; |
| 63 | foreman_cif.pipe.queue_delay_ms = 50; |
stefan@webrtc.org | c216b9a | 2014-10-14 10:38:49 +0000 | [diff] [blame] | 64 | RunTest(foreman_cif); |
| 65 | } |
| 66 | |
stefan@webrtc.org | b8e9e44 | 2014-07-09 11:29:06 +0000 | [diff] [blame] | 67 | TEST_F(FullStackTest, ForemanCif500kbps) { |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 68 | VideoQualityTest::Params foreman_cif = { |
| 69 | {352, 288, 30, 30000, 500000, 2000000, "VP8", 1}, |
| 70 | {"foreman_cif"}, |
| 71 | {}, |
| 72 | {"foreman_cif_500kbps", 0.0, 0.0, kFullStackTestDurationSecs}}; |
| 73 | foreman_cif.pipe.queue_length_packets = 0; |
| 74 | foreman_cif.pipe.queue_delay_ms = 0; |
| 75 | foreman_cif.pipe.link_capacity_kbps = 500; |
stefan@webrtc.org | b8e9e44 | 2014-07-09 11:29:06 +0000 | [diff] [blame] | 76 | RunTest(foreman_cif); |
| 77 | } |
| 78 | |
| 79 | TEST_F(FullStackTest, ForemanCif500kbpsLimitedQueue) { |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 80 | VideoQualityTest::Params foreman_cif = { |
| 81 | {352, 288, 30, 30000, 500000, 2000000, "VP8", 1}, |
| 82 | {"foreman_cif"}, |
| 83 | {}, |
| 84 | {"foreman_cif_500kbps_32pkts_queue", 0.0, 0.0, kFullStackTestDurationSecs} |
| 85 | }; |
| 86 | foreman_cif.pipe.queue_length_packets = 32; |
| 87 | foreman_cif.pipe.queue_delay_ms = 0; |
| 88 | foreman_cif.pipe.link_capacity_kbps = 500; |
stefan@webrtc.org | b8e9e44 | 2014-07-09 11:29:06 +0000 | [diff] [blame] | 89 | RunTest(foreman_cif); |
| 90 | } |
| 91 | |
| 92 | TEST_F(FullStackTest, ForemanCif500kbps100ms) { |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 93 | VideoQualityTest::Params foreman_cif = { |
| 94 | {352, 288, 30, 30000, 500000, 2000000, "VP8", 1}, |
| 95 | {"foreman_cif"}, |
| 96 | {}, |
| 97 | {"foreman_cif_500kbps_100ms", 0.0, 0.0, kFullStackTestDurationSecs}}; |
| 98 | foreman_cif.pipe.queue_length_packets = 0; |
| 99 | foreman_cif.pipe.queue_delay_ms = 100; |
| 100 | foreman_cif.pipe.link_capacity_kbps = 500; |
stefan@webrtc.org | b8e9e44 | 2014-07-09 11:29:06 +0000 | [diff] [blame] | 101 | RunTest(foreman_cif); |
| 102 | } |
| 103 | |
| 104 | TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueue) { |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 105 | VideoQualityTest::Params foreman_cif = { |
| 106 | {352, 288, 30, 30000, 500000, 2000000, "VP8", 1}, |
| 107 | {"foreman_cif"}, |
| 108 | {}, |
| 109 | {"foreman_cif_500kbps_100ms_32pkts_queue", 0.0, 0.0, |
| 110 | kFullStackTestDurationSecs}}; |
| 111 | foreman_cif.pipe.queue_length_packets = 32; |
| 112 | foreman_cif.pipe.queue_delay_ms = 100; |
| 113 | foreman_cif.pipe.link_capacity_kbps = 500; |
stefan@webrtc.org | b8e9e44 | 2014-07-09 11:29:06 +0000 | [diff] [blame] | 114 | RunTest(foreman_cif); |
| 115 | } |
| 116 | |
| 117 | TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) { |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 118 | VideoQualityTest::Params foreman_cif = { |
ivica | 1356ba5 | 2015-09-22 01:09:11 -0700 | [diff] [blame] | 119 | {352, 288, 30, 30000, 2000000, 2000000, "VP8", 1}, |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 120 | {"foreman_cif"}, |
| 121 | {}, |
| 122 | {"foreman_cif_1000kbps_100ms_32pkts_queue", 0.0, 0.0, |
| 123 | kFullStackTestDurationSecs}}; |
| 124 | foreman_cif.pipe.queue_length_packets = 32; |
| 125 | foreman_cif.pipe.queue_delay_ms = 100; |
| 126 | foreman_cif.pipe.link_capacity_kbps = 1000; |
stefan@webrtc.org | b8e9e44 | 2014-07-09 11:29:06 +0000 | [diff] [blame] | 127 | RunTest(foreman_cif); |
| 128 | } |
sprang@webrtc.org | 131bea8 | 2015-02-18 12:46:06 +0000 | [diff] [blame] | 129 | |
ivica | 7bd242e | 2015-10-06 02:04:06 -0700 | [diff] [blame] | 130 | TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL) { |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 131 | VideoQualityTest::Params screenshare = { |
sprang | ce4aef1 | 2015-11-02 07:23:20 -0800 | [diff] [blame^] | 132 | {1850, 1110, 5, 50000, 200000, 2000000, "VP8", 2, 1, 400000}, |
| 133 | {}, |
| 134 | {true, 10}, |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 135 | {"screenshare_slides", 0.0, 0.0, kFullStackTestDurationSecs}}; |
| 136 | RunTest(screenshare); |
Erik Språng | 6ee69aa | 2015-09-03 15:58:05 +0200 | [diff] [blame] | 137 | } |
| 138 | |
ivica | 7bd242e | 2015-10-06 02:04:06 -0700 | [diff] [blame] | 139 | TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_Scroll) { |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 140 | VideoQualityTest::Params config = { |
sprang | ce4aef1 | 2015-11-02 07:23:20 -0800 | [diff] [blame^] | 141 | {1850, 1110 / 2, 5, 50000, 200000, 2000000, "VP8", 2, 1, 400000}, |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 142 | {}, |
| 143 | {true, 10, 2}, |
| 144 | {"screenshare_slides_scrolling", 0.0, 0.0, kFullStackTestDurationSecs}}; |
| 145 | RunTest(config); |
ivica | 028cf48 | 2015-07-30 02:15:56 -0700 | [diff] [blame] | 146 | } |
| 147 | |
ivica | 7bd242e | 2015-10-06 02:04:06 -0700 | [diff] [blame] | 148 | TEST_F(FullStackTest, ScreenshareSlidesVP9_2TL) { |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 149 | VideoQualityTest::Params screenshare = { |
sprang | ce4aef1 | 2015-11-02 07:23:20 -0800 | [diff] [blame^] | 150 | {1850, 1110, 5, 50000, 200000, 2000000, "VP9", 2, 1, 400000}, |
ivica | 5d6a06c | 2015-09-17 05:30:24 -0700 | [diff] [blame] | 151 | {}, |
| 152 | {true, 10}, |
| 153 | {"screenshare_slides_vp9_2tl", 0.0, 0.0, kFullStackTestDurationSecs}}; |
| 154 | RunTest(screenshare); |
sprang@webrtc.org | 131bea8 | 2015-02-18 12:46:06 +0000 | [diff] [blame] | 155 | } |
pbos@webrtc.org | af8d5af | 2013-07-09 08:02:33 +0000 | [diff] [blame] | 156 | } // namespace webrtc |