OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest .h" | 11 #include "webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest .h" |
12 | 12 |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "webrtc/test/testsupport/fileutils.h" | |
16 | |
15 namespace webrtc { | 17 namespace webrtc { |
16 namespace test { | 18 namespace test { |
17 | 19 |
18 namespace { | 20 namespace { |
19 | 21 |
20 // Test settings. | |
21 // Only allow encoder/decoder to use single core, for predictability. | |
22 const bool kUseSingleCore = true; | |
23 const bool kVerboseLogging = false; | |
24 const bool kHwCodec = false; | |
25 | |
26 // Codec settings. | 22 // Codec settings. |
27 const bool kResilienceOn = true; | 23 const bool kResilienceOn = true; |
28 | |
29 // Default sequence is foreman (CIF): may be better to use VGA for resize test. | |
30 const int kCifWidth = 352; | 24 const int kCifWidth = 352; |
31 const int kCifHeight = 288; | 25 const int kCifHeight = 288; |
32 const char kForemanCif[] = "foreman_cif"; | |
33 #if !defined(WEBRTC_IOS) | 26 #if !defined(WEBRTC_IOS) |
34 const int kNumFramesShort = 100; | 27 const int kNumFramesShort = 100; |
35 #endif | 28 #endif |
36 const int kNumFramesLong = 300; | 29 const int kNumFramesLong = 300; |
37 | 30 |
38 const std::nullptr_t kNoVisualizationParams = nullptr; | 31 const std::nullptr_t kNoVisualizationParams = nullptr; |
39 | 32 |
40 } // namespace | 33 } // namespace |
41 | 34 |
35 class VideoProcessorIntegrationTestLibvpx | |
36 : public VideoProcessorIntegrationTest { | |
37 protected: | |
38 VideoProcessorIntegrationTestLibvpx() { | |
39 config_.input_filename = ResourcePath("foreman_cif", "yuv"); | |
40 config_.output_filename = | |
41 TempFilename(OutputPath(), "videoprocessor_integrationtest_libvpx"); | |
42 config_.networking_config.packet_loss_probability = 0.0; | |
43 // Only allow encoder/decoder to use single core, for predictability. | |
44 config_.use_single_core = false; | |
åsapersson
2017/09/01 11:49:31
true?
brandtr
2017/09/01 13:26:27
Yes. Thanks. Done :)
| |
45 config_.verbose = false; | |
46 config_.hw_codec = false; | |
47 } | |
48 }; | |
49 | |
42 // Fails on iOS. See webrtc:4755. | 50 // Fails on iOS. See webrtc:4755. |
43 #if !defined(WEBRTC_IOS) | 51 #if !defined(WEBRTC_IOS) |
44 | 52 |
45 #if !defined(RTC_DISABLE_VP9) | 53 #if !defined(RTC_DISABLE_VP9) |
46 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. | 54 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. |
47 // One key frame (first frame only) in sequence. | 55 // One key frame (first frame only) in sequence. |
48 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { | 56 TEST_F(VideoProcessorIntegrationTestLibvpx, Process0PercentPacketLossVP9) { |
49 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
50 kVerboseLogging); | |
51 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, | 57 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
52 kResilienceOn, kCifWidth, kCifHeight); | 58 kResilienceOn, kCifWidth, kCifHeight); |
53 | 59 |
54 RateProfile rate_profile; | 60 RateProfile rate_profile; |
55 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 61 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
56 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 62 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
57 rate_profile.num_frames = kNumFramesShort; | 63 rate_profile.num_frames = kNumFramesShort; |
58 | 64 |
59 std::vector<RateControlThresholds> rc_thresholds; | 65 std::vector<RateControlThresholds> rc_thresholds; |
60 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); | 66 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); |
61 | 67 |
62 QualityThresholds quality_thresholds(37.0, 36.0, 0.93, 0.92); | 68 QualityThresholds quality_thresholds(37.0, 36.0, 0.93, 0.92); |
63 | 69 |
64 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 70 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
65 kNoVisualizationParams); | 71 kNoVisualizationParams); |
66 } | 72 } |
67 | 73 |
68 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit | 74 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit |
69 // lower. One key frame (first frame only) in sequence. | 75 // lower. One key frame (first frame only) in sequence. |
70 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { | 76 TEST_F(VideoProcessorIntegrationTestLibvpx, Process5PercentPacketLossVP9) { |
71 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.05f, kForemanCif, | 77 config_.networking_config.packet_loss_probability = 0.05f; |
72 kVerboseLogging); | |
73 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, | 78 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
74 kResilienceOn, kCifWidth, kCifHeight); | 79 kResilienceOn, kCifWidth, kCifHeight); |
75 | 80 |
76 RateProfile rate_profile; | 81 RateProfile rate_profile; |
77 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 82 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
78 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 83 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
79 rate_profile.num_frames = kNumFramesShort; | 84 rate_profile.num_frames = kNumFramesShort; |
80 | 85 |
81 std::vector<RateControlThresholds> rc_thresholds; | 86 std::vector<RateControlThresholds> rc_thresholds; |
82 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); | 87 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); |
83 | 88 |
84 QualityThresholds quality_thresholds(17.0, 14.0, 0.45, 0.36); | 89 QualityThresholds quality_thresholds(17.0, 14.0, 0.45, 0.36); |
85 | 90 |
86 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 91 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
87 kNoVisualizationParams); | 92 kNoVisualizationParams); |
88 } | 93 } |
89 | 94 |
90 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): | 95 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): |
91 // low to high to medium. Check that quality and encoder response to the new | 96 // low to high to medium. Check that quality and encoder response to the new |
92 // target rate/per-frame bandwidth (for each rate update) is within limits. | 97 // target rate/per-frame bandwidth (for each rate update) is within limits. |
93 // One key frame (first frame only) in sequence. | 98 // One key frame (first frame only) in sequence. |
94 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { | 99 TEST_F(VideoProcessorIntegrationTestLibvpx, ProcessNoLossChangeBitRateVP9) { |
95 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
96 kVerboseLogging); | |
97 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, | 100 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
98 kResilienceOn, kCifWidth, kCifHeight); | 101 kResilienceOn, kCifWidth, kCifHeight); |
99 | 102 |
100 RateProfile rate_profile; | 103 RateProfile rate_profile; |
101 SetRateProfile(&rate_profile, 0, 200, 30, 0); | 104 SetRateProfile(&rate_profile, 0, 200, 30, 0); |
102 SetRateProfile(&rate_profile, 1, 700, 30, 100); | 105 SetRateProfile(&rate_profile, 1, 700, 30, 100); |
103 SetRateProfile(&rate_profile, 2, 500, 30, 200); | 106 SetRateProfile(&rate_profile, 2, 500, 30, 200); |
104 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 107 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
105 rate_profile.num_frames = kNumFramesLong; | 108 rate_profile.num_frames = kNumFramesLong; |
106 | 109 |
107 std::vector<RateControlThresholds> rc_thresholds; | 110 std::vector<RateControlThresholds> rc_thresholds; |
108 AddRateControlThresholds(0, 30, 20, 20, 35, 0, 1, &rc_thresholds); | 111 AddRateControlThresholds(0, 30, 20, 20, 35, 0, 1, &rc_thresholds); |
109 AddRateControlThresholds(2, 0, 20, 20, 60, 0, 0, &rc_thresholds); | 112 AddRateControlThresholds(2, 0, 20, 20, 60, 0, 0, &rc_thresholds); |
110 AddRateControlThresholds(0, 0, 25, 20, 40, 0, 0, &rc_thresholds); | 113 AddRateControlThresholds(0, 0, 25, 20, 40, 0, 0, &rc_thresholds); |
111 | 114 |
112 QualityThresholds quality_thresholds(35.5, 30.0, 0.90, 0.85); | 115 QualityThresholds quality_thresholds(35.5, 30.0, 0.90, 0.85); |
113 | 116 |
114 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 117 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
115 kNoVisualizationParams); | 118 kNoVisualizationParams); |
116 } | 119 } |
117 | 120 |
118 // VP9: Run with no packet loss, with an update (decrease) in frame rate. | 121 // VP9: Run with no packet loss, with an update (decrease) in frame rate. |
119 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. | 122 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. |
120 // At the low bitrate in this test, this means better rate control after the | 123 // At the low bitrate in this test, this means better rate control after the |
121 // update(s) to lower frame rate. So expect less frame drops, and max values | 124 // update(s) to lower frame rate. So expect less frame drops, and max values |
122 // for the rate control metrics can be lower. One key frame (first frame only). | 125 // for the rate control metrics can be lower. One key frame (first frame only). |
123 // Note: quality after update should be higher but we currently compute quality | 126 // Note: quality after update should be higher but we currently compute quality |
124 // metrics averaged over whole sequence run. | 127 // metrics averaged over whole sequence run. |
125 TEST_F(VideoProcessorIntegrationTest, | 128 TEST_F(VideoProcessorIntegrationTestLibvpx, |
126 ProcessNoLossChangeFrameRateFrameDropVP9) { | 129 ProcessNoLossChangeFrameRateFrameDropVP9) { |
127 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
128 kVerboseLogging); | |
129 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, | 130 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
130 kResilienceOn, kCifWidth, kCifHeight); | 131 kResilienceOn, kCifWidth, kCifHeight); |
131 | 132 |
132 RateProfile rate_profile; | 133 RateProfile rate_profile; |
133 SetRateProfile(&rate_profile, 0, 100, 24, 0); | 134 SetRateProfile(&rate_profile, 0, 100, 24, 0); |
134 SetRateProfile(&rate_profile, 1, 100, 15, 100); | 135 SetRateProfile(&rate_profile, 1, 100, 15, 100); |
135 SetRateProfile(&rate_profile, 2, 100, 10, 200); | 136 SetRateProfile(&rate_profile, 2, 100, 10, 200); |
136 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 137 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
137 rate_profile.num_frames = kNumFramesLong; | 138 rate_profile.num_frames = kNumFramesLong; |
138 | 139 |
139 std::vector<RateControlThresholds> rc_thresholds; | 140 std::vector<RateControlThresholds> rc_thresholds; |
140 AddRateControlThresholds(45, 50, 95, 15, 45, 0, 1, &rc_thresholds); | 141 AddRateControlThresholds(45, 50, 95, 15, 45, 0, 1, &rc_thresholds); |
141 AddRateControlThresholds(20, 0, 50, 10, 30, 0, 0, &rc_thresholds); | 142 AddRateControlThresholds(20, 0, 50, 10, 30, 0, 0, &rc_thresholds); |
142 AddRateControlThresholds(5, 0, 30, 5, 25, 0, 0, &rc_thresholds); | 143 AddRateControlThresholds(5, 0, 30, 5, 25, 0, 0, &rc_thresholds); |
143 | 144 |
144 QualityThresholds quality_thresholds(31.5, 18.0, 0.80, 0.43); | 145 QualityThresholds quality_thresholds(31.5, 18.0, 0.80, 0.43); |
145 | 146 |
146 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 147 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
147 kNoVisualizationParams); | 148 kNoVisualizationParams); |
148 } | 149 } |
149 | 150 |
150 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). | 151 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). |
151 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { | 152 TEST_F(VideoProcessorIntegrationTestLibvpx, ProcessNoLossDenoiserOnVP9) { |
152 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
153 kVerboseLogging); | |
154 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, true, true, false, | 153 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, true, true, false, |
155 kResilienceOn, kCifWidth, kCifHeight); | 154 kResilienceOn, kCifWidth, kCifHeight); |
156 | 155 |
157 RateProfile rate_profile; | 156 RateProfile rate_profile; |
158 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 157 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
159 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 158 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
160 rate_profile.num_frames = kNumFramesShort; | 159 rate_profile.num_frames = kNumFramesShort; |
161 | 160 |
162 std::vector<RateControlThresholds> rc_thresholds; | 161 std::vector<RateControlThresholds> rc_thresholds; |
163 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); | 162 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); |
164 | 163 |
165 QualityThresholds quality_thresholds(36.8, 35.8, 0.92, 0.91); | 164 QualityThresholds quality_thresholds(36.8, 35.8, 0.92, 0.91); |
166 | 165 |
167 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 166 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
168 kNoVisualizationParams); | 167 kNoVisualizationParams); |
169 } | 168 } |
170 | 169 |
171 // Run with no packet loss, at low bitrate. | 170 // Run with no packet loss, at low bitrate. |
172 // spatial_resize is on, for this low bitrate expect one resize in sequence. | 171 // spatial_resize is on, for this low bitrate expect one resize in sequence. |
173 // Resize happens on delta frame. Expect only one key frame (first frame). | 172 // Resize happens on delta frame. Expect only one key frame (first frame). |
174 TEST_F(VideoProcessorIntegrationTest, | 173 TEST_F(VideoProcessorIntegrationTestLibvpx, |
175 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { | 174 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { |
176 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
177 kVerboseLogging); | |
178 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, true, | 175 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, true, |
179 kResilienceOn, kCifWidth, kCifHeight); | 176 kResilienceOn, kCifWidth, kCifHeight); |
180 | 177 |
181 RateProfile rate_profile; | 178 RateProfile rate_profile; |
182 SetRateProfile(&rate_profile, 0, 50, 30, 0); | 179 SetRateProfile(&rate_profile, 0, 50, 30, 0); |
183 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; | 180 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; |
184 rate_profile.num_frames = kNumFramesLong; | 181 rate_profile.num_frames = kNumFramesLong; |
185 | 182 |
186 std::vector<RateControlThresholds> rc_thresholds; | 183 std::vector<RateControlThresholds> rc_thresholds; |
187 AddRateControlThresholds(228, 70, 160, 15, 80, 1, 1, &rc_thresholds); | 184 AddRateControlThresholds(228, 70, 160, 15, 80, 1, 1, &rc_thresholds); |
188 | 185 |
189 QualityThresholds quality_thresholds(24.0, 13.0, 0.65, 0.37); | 186 QualityThresholds quality_thresholds(24.0, 13.0, 0.65, 0.37); |
190 | 187 |
191 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 188 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
192 kNoVisualizationParams); | 189 kNoVisualizationParams); |
193 } | 190 } |
194 | 191 |
195 // TODO(marpan): Add temporal layer test for VP9, once changes are in | 192 // TODO(marpan): Add temporal layer test for VP9, once changes are in |
196 // vp9 wrapper for this. | 193 // vp9 wrapper for this. |
197 | 194 |
198 #endif // !defined(RTC_DISABLE_VP9) | 195 #endif // !defined(RTC_DISABLE_VP9) |
199 | 196 |
200 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. | 197 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. |
201 // One key frame (first frame only) in sequence. Setting |key_frame_interval| | 198 // One key frame (first frame only) in sequence. Setting |key_frame_interval| |
202 // to -1 below means no periodic key frames in test. | 199 // to -1 below means no periodic key frames in test. |
203 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { | 200 TEST_F(VideoProcessorIntegrationTestLibvpx, ProcessZeroPacketLoss) { |
204 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
205 kVerboseLogging); | |
206 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 201 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
207 kResilienceOn, kCifWidth, kCifHeight); | 202 kResilienceOn, kCifWidth, kCifHeight); |
208 | 203 |
209 RateProfile rate_profile; | 204 RateProfile rate_profile; |
210 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 205 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
211 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 206 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
212 rate_profile.num_frames = kNumFramesShort; | 207 rate_profile.num_frames = kNumFramesShort; |
213 | 208 |
214 std::vector<RateControlThresholds> rc_thresholds; | 209 std::vector<RateControlThresholds> rc_thresholds; |
215 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); | 210 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); |
216 | 211 |
217 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89); | 212 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89); |
218 | 213 |
219 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 214 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
220 kNoVisualizationParams); | 215 kNoVisualizationParams); |
221 } | 216 } |
222 | 217 |
223 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit | 218 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit |
224 // lower. One key frame (first frame only) in sequence. | 219 // lower. One key frame (first frame only) in sequence. |
225 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { | 220 TEST_F(VideoProcessorIntegrationTestLibvpx, Process5PercentPacketLoss) { |
226 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.05f, kForemanCif, | 221 config_.networking_config.packet_loss_probability = 0.05f; |
227 kVerboseLogging); | |
228 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 222 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
229 kResilienceOn, kCifWidth, kCifHeight); | 223 kResilienceOn, kCifWidth, kCifHeight); |
230 | 224 |
231 RateProfile rate_profile; | 225 RateProfile rate_profile; |
232 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 226 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
233 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 227 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
234 rate_profile.num_frames = kNumFramesShort; | 228 rate_profile.num_frames = kNumFramesShort; |
235 | 229 |
236 std::vector<RateControlThresholds> rc_thresholds; | 230 std::vector<RateControlThresholds> rc_thresholds; |
237 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); | 231 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); |
238 | 232 |
239 QualityThresholds quality_thresholds(20.0, 16.0, 0.60, 0.40); | 233 QualityThresholds quality_thresholds(20.0, 16.0, 0.60, 0.40); |
240 | 234 |
241 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 235 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
242 kNoVisualizationParams); | 236 kNoVisualizationParams); |
243 } | 237 } |
244 | 238 |
245 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. | 239 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. |
246 // One key frame (first frame only) in sequence. | 240 // One key frame (first frame only) in sequence. |
247 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { | 241 TEST_F(VideoProcessorIntegrationTestLibvpx, Process10PercentPacketLoss) { |
248 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.1f, kForemanCif, | 242 config_.networking_config.packet_loss_probability = 0.1f; |
249 kVerboseLogging); | |
250 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 243 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
251 kResilienceOn, kCifWidth, kCifHeight); | 244 kResilienceOn, kCifWidth, kCifHeight); |
252 | 245 |
253 RateProfile rate_profile; | 246 RateProfile rate_profile; |
254 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 247 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
255 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 248 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
256 rate_profile.num_frames = kNumFramesShort; | 249 rate_profile.num_frames = kNumFramesShort; |
257 | 250 |
258 std::vector<RateControlThresholds> rc_thresholds; | 251 std::vector<RateControlThresholds> rc_thresholds; |
259 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); | 252 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); |
(...skipping 19 matching lines...) Expand all Loading... | |
279 // low to high to medium. Check that quality and encoder response to the new | 272 // low to high to medium. Check that quality and encoder response to the new |
280 // target rate/per-frame bandwidth (for each rate update) is within limits. | 273 // target rate/per-frame bandwidth (for each rate update) is within limits. |
281 // One key frame (first frame only) in sequence. | 274 // One key frame (first frame only) in sequence. |
282 // Too slow to finish before timeout on iOS. See webrtc:4755. | 275 // Too slow to finish before timeout on iOS. See webrtc:4755. |
283 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 276 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
284 #define MAYBE_ProcessNoLossChangeBitRateVP8 \ | 277 #define MAYBE_ProcessNoLossChangeBitRateVP8 \ |
285 DISABLED_ProcessNoLossChangeBitRateVP8 | 278 DISABLED_ProcessNoLossChangeBitRateVP8 |
286 #else | 279 #else |
287 #define MAYBE_ProcessNoLossChangeBitRateVP8 ProcessNoLossChangeBitRateVP8 | 280 #define MAYBE_ProcessNoLossChangeBitRateVP8 ProcessNoLossChangeBitRateVP8 |
288 #endif | 281 #endif |
289 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) { | 282 TEST_F(VideoProcessorIntegrationTestLibvpx, |
290 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 283 MAYBE_ProcessNoLossChangeBitRateVP8) { |
291 kVerboseLogging); | |
292 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 284 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
293 kResilienceOn, kCifWidth, kCifHeight); | 285 kResilienceOn, kCifWidth, kCifHeight); |
294 | 286 |
295 RateProfile rate_profile; | 287 RateProfile rate_profile; |
296 SetRateProfile(&rate_profile, 0, 200, 30, 0); | 288 SetRateProfile(&rate_profile, 0, 200, 30, 0); |
297 SetRateProfile(&rate_profile, 1, 800, 30, 100); | 289 SetRateProfile(&rate_profile, 1, 800, 30, 100); |
298 SetRateProfile(&rate_profile, 2, 500, 30, 200); | 290 SetRateProfile(&rate_profile, 2, 500, 30, 200); |
299 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 291 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
300 rate_profile.num_frames = kNumFramesLong; | 292 rate_profile.num_frames = kNumFramesLong; |
301 | 293 |
(...skipping 16 matching lines...) Expand all Loading... | |
318 // Note: quality after update should be higher but we currently compute quality | 310 // Note: quality after update should be higher but we currently compute quality |
319 // metrics averaged over whole sequence run. | 311 // metrics averaged over whole sequence run. |
320 // Too slow to finish before timeout on iOS. See webrtc:4755. | 312 // Too slow to finish before timeout on iOS. See webrtc:4755. |
321 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 313 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
322 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ | 314 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ |
323 DISABLED_ProcessNoLossChangeFrameRateFrameDropVP8 | 315 DISABLED_ProcessNoLossChangeFrameRateFrameDropVP8 |
324 #else | 316 #else |
325 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ | 317 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ |
326 ProcessNoLossChangeFrameRateFrameDropVP8 | 318 ProcessNoLossChangeFrameRateFrameDropVP8 |
327 #endif | 319 #endif |
328 TEST_F(VideoProcessorIntegrationTest, | 320 TEST_F(VideoProcessorIntegrationTestLibvpx, |
329 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) { | 321 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) { |
330 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
331 kVerboseLogging); | |
332 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 322 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
333 kResilienceOn, kCifWidth, kCifHeight); | 323 kResilienceOn, kCifWidth, kCifHeight); |
334 | 324 |
335 RateProfile rate_profile; | 325 RateProfile rate_profile; |
336 SetRateProfile(&rate_profile, 0, 80, 24, 0); | 326 SetRateProfile(&rate_profile, 0, 80, 24, 0); |
337 SetRateProfile(&rate_profile, 1, 80, 15, 100); | 327 SetRateProfile(&rate_profile, 1, 80, 15, 100); |
338 SetRateProfile(&rate_profile, 2, 80, 10, 200); | 328 SetRateProfile(&rate_profile, 2, 80, 10, 200); |
339 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 329 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
340 rate_profile.num_frames = kNumFramesLong; | 330 rate_profile.num_frames = kNumFramesLong; |
341 | 331 |
(...skipping 13 matching lines...) Expand all Loading... | |
355 // encoding rate mismatch are applied to each layer. | 345 // encoding rate mismatch are applied to each layer. |
356 // No dropped frames in this test, and internal spatial resizer is off. | 346 // No dropped frames in this test, and internal spatial resizer is off. |
357 // One key frame (first frame only) in sequence, so no spatial resizing. | 347 // One key frame (first frame only) in sequence, so no spatial resizing. |
358 // Too slow to finish before timeout on iOS. See webrtc:4755. | 348 // Too slow to finish before timeout on iOS. See webrtc:4755. |
359 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 349 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
360 #define MAYBE_ProcessNoLossTemporalLayersVP8 \ | 350 #define MAYBE_ProcessNoLossTemporalLayersVP8 \ |
361 DISABLED_ProcessNoLossTemporalLayersVP8 | 351 DISABLED_ProcessNoLossTemporalLayersVP8 |
362 #else | 352 #else |
363 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8 | 353 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8 |
364 #endif | 354 #endif |
365 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { | 355 TEST_F(VideoProcessorIntegrationTestLibvpx, |
366 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 356 MAYBE_ProcessNoLossTemporalLayersVP8) { |
367 kVerboseLogging); | |
368 SetCodecSettings(&config_, kVideoCodecVP8, 3, false, true, true, false, | 357 SetCodecSettings(&config_, kVideoCodecVP8, 3, false, true, true, false, |
369 kResilienceOn, kCifWidth, kCifHeight); | 358 kResilienceOn, kCifWidth, kCifHeight); |
370 | 359 |
371 RateProfile rate_profile; | 360 RateProfile rate_profile; |
372 SetRateProfile(&rate_profile, 0, 200, 30, 0); | 361 SetRateProfile(&rate_profile, 0, 200, 30, 0); |
373 SetRateProfile(&rate_profile, 1, 400, 30, 150); | 362 SetRateProfile(&rate_profile, 1, 400, 30, 150); |
374 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; | 363 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; |
375 rate_profile.num_frames = kNumFramesLong; | 364 rate_profile.num_frames = kNumFramesLong; |
376 | 365 |
377 std::vector<RateControlThresholds> rc_thresholds; | 366 std::vector<RateControlThresholds> rc_thresholds; |
378 AddRateControlThresholds(0, 20, 30, 10, 10, 0, 1, &rc_thresholds); | 367 AddRateControlThresholds(0, 20, 30, 10, 10, 0, 1, &rc_thresholds); |
379 AddRateControlThresholds(0, 0, 30, 15, 10, 0, 0, &rc_thresholds); | 368 AddRateControlThresholds(0, 0, 30, 15, 10, 0, 0, &rc_thresholds); |
380 | 369 |
381 QualityThresholds quality_thresholds(32.5, 30.0, 0.85, 0.80); | 370 QualityThresholds quality_thresholds(32.5, 30.0, 0.85, 0.80); |
382 | 371 |
383 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 372 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
384 kNoVisualizationParams); | 373 kNoVisualizationParams); |
385 } | 374 } |
386 | 375 |
387 } // namespace test | 376 } // namespace test |
388 } // namespace webrtc | 377 } // namespace webrtc |
OLD | NEW |