Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc

Issue 2708103002: Revert of Add optional visualization file writers to VideoProcessor tests. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
(...skipping 25 matching lines...) Expand all
36 // Codec/network settings. 36 // Codec/network settings.
37 CodecConfigPars process_settings; 37 CodecConfigPars process_settings;
38 SetCodecParameters(&process_settings, kVideoCodecH264, kHwCodec, 0.0f, -1, 1, 38 SetCodecParameters(&process_settings, kVideoCodecH264, kHwCodec, 0.0f, -1, 1,
39 false, false, true, false); 39 false, false, true, false);
40 // Metrics for expected quality. 40 // Metrics for expected quality.
41 QualityMetrics quality_metrics; 41 QualityMetrics quality_metrics;
42 SetQualityMetrics(&quality_metrics, 35.0, 25.0, 0.93, 0.70); 42 SetQualityMetrics(&quality_metrics, 35.0, 25.0, 0.93, 0.70);
43 // Metrics for rate control. 43 // Metrics for rate control.
44 RateControlMetrics rc_metrics[1]; 44 RateControlMetrics rc_metrics[1];
45 SetRateControlMetrics(rc_metrics, 0, 2, 60, 20, 10, 20, 0, 1); 45 SetRateControlMetrics(rc_metrics, 0, 2, 60, 20, 10, 20, 0, 1);
46 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 46 ProcessFramesAndVerify(quality_metrics,
47 rc_metrics, nullptr /* visualization_params */); 47 rate_profile,
48 process_settings,
49 rc_metrics);
48 } 50 }
49 51
50 #endif // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) 52 #endif // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS)
51 53
52 // Fails on iOS. See webrtc:4755. 54 // Fails on iOS. See webrtc:4755.
53 #if !defined(WEBRTC_IOS) 55 #if !defined(WEBRTC_IOS)
54 56
55 #if !defined(RTC_DISABLE_VP9) 57 #if !defined(RTC_DISABLE_VP9)
56 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. 58 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high.
57 // One key frame (first frame only) in sequence. Setting |key_frame_interval| 59 // One key frame (first frame only) in sequence. Setting |key_frame_interval|
58 // to -1 below means no periodic key frames in test. 60 // to -1 below means no periodic key frames in test.
59 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { 61 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) {
60 // Bitrate and frame rate profile. 62 // Bitrate and frame rate profile.
61 RateProfile rate_profile; 63 RateProfile rate_profile;
62 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 64 SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
63 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 65 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
64 rate_profile.num_frames = kNumFramesShort; 66 rate_profile.num_frames = kNumFramesShort;
65 // Codec/network settings. 67 // Codec/network settings.
66 CodecConfigPars process_settings; 68 CodecConfigPars process_settings;
67 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1, 69 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
68 false, false, true, false); 70 false, false, true, false);
69 // Metrics for expected quality. 71 // Metrics for expected quality.
70 QualityMetrics quality_metrics; 72 QualityMetrics quality_metrics;
71 SetQualityMetrics(&quality_metrics, 37.0, 36.0, 0.93, 0.92); 73 SetQualityMetrics(&quality_metrics, 37.0, 36.0, 0.93, 0.92);
72 // Metrics for rate control. 74 // Metrics for rate control.
73 RateControlMetrics rc_metrics[1]; 75 RateControlMetrics rc_metrics[1];
74 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); 76 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1);
75 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 77 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
76 rc_metrics, nullptr /* visualization_params */); 78 rc_metrics);
77 } 79 }
78 80
79 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit 81 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit
80 // lower. One key frame (first frame only) in sequence. 82 // lower. One key frame (first frame only) in sequence.
81 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { 83 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) {
82 // Bitrate and frame rate profile. 84 // Bitrate and frame rate profile.
83 RateProfile rate_profile; 85 RateProfile rate_profile;
84 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 86 SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
85 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 87 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
86 rate_profile.num_frames = kNumFramesShort; 88 rate_profile.num_frames = kNumFramesShort;
87 // Codec/network settings. 89 // Codec/network settings.
88 CodecConfigPars process_settings; 90 CodecConfigPars process_settings;
89 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.05f, -1, 1, 91 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.05f, -1, 1,
90 false, false, true, false); 92 false, false, true, false);
91 // Metrics for expected quality. 93 // Metrics for expected quality.
92 QualityMetrics quality_metrics; 94 QualityMetrics quality_metrics;
93 SetQualityMetrics(&quality_metrics, 17.0, 14.0, 0.45, 0.36); 95 SetQualityMetrics(&quality_metrics, 17.0, 14.0, 0.45, 0.36);
94 // Metrics for rate control. 96 // Metrics for rate control.
95 RateControlMetrics rc_metrics[1]; 97 RateControlMetrics rc_metrics[1];
96 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); 98 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1);
97 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 99 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
98 rc_metrics, nullptr /* visualization_params */); 100 rc_metrics);
99 } 101 }
100 102
101 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): 103 // VP9: Run with no packet loss, with varying bitrate (3 rate updates):
102 // low to high to medium. Check that quality and encoder response to the new 104 // low to high to medium. Check that quality and encoder response to the new
103 // target rate/per-frame bandwidth (for each rate update) is within limits. 105 // target rate/per-frame bandwidth (for each rate update) is within limits.
104 // One key frame (first frame only) in sequence. 106 // One key frame (first frame only) in sequence.
105 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { 107 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) {
106 // Bitrate and frame rate profile. 108 // Bitrate and frame rate profile.
107 RateProfile rate_profile; 109 RateProfile rate_profile;
108 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); 110 SetRateProfilePars(&rate_profile, 0, 200, 30, 0);
109 SetRateProfilePars(&rate_profile, 1, 700, 30, 100); 111 SetRateProfilePars(&rate_profile, 1, 700, 30, 100);
110 SetRateProfilePars(&rate_profile, 2, 500, 30, 200); 112 SetRateProfilePars(&rate_profile, 2, 500, 30, 200);
111 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; 113 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1;
112 rate_profile.num_frames = kNumFramesLong; 114 rate_profile.num_frames = kNumFramesLong;
113 // Codec/network settings. 115 // Codec/network settings.
114 CodecConfigPars process_settings; 116 CodecConfigPars process_settings;
115 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1, 117 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
116 false, false, true, false); 118 false, false, true, false);
117 // Metrics for expected quality. 119 // Metrics for expected quality.
118 QualityMetrics quality_metrics; 120 QualityMetrics quality_metrics;
119 SetQualityMetrics(&quality_metrics, 35.5, 30.0, 0.90, 0.85); 121 SetQualityMetrics(&quality_metrics, 35.5, 30.0, 0.90, 0.85);
120 // Metrics for rate control. 122 // Metrics for rate control.
121 RateControlMetrics rc_metrics[3]; 123 RateControlMetrics rc_metrics[3];
122 SetRateControlMetrics(rc_metrics, 0, 0, 30, 20, 20, 30, 0, 1); 124 SetRateControlMetrics(rc_metrics, 0, 0, 30, 20, 20, 30, 0, 1);
123 SetRateControlMetrics(rc_metrics, 1, 2, 0, 20, 20, 60, 0, 0); 125 SetRateControlMetrics(rc_metrics, 1, 2, 0, 20, 20, 60, 0, 0);
124 SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 20, 40, 0, 0); 126 SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 20, 40, 0, 0);
125 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 127 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
126 rc_metrics, nullptr /* visualization_params */); 128 rc_metrics);
127 } 129 }
128 130
129 // VP9: Run with no packet loss, with an update (decrease) in frame rate. 131 // VP9: Run with no packet loss, with an update (decrease) in frame rate.
130 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. 132 // Lower frame rate means higher per-frame-bandwidth, so easier to encode.
131 // At the low bitrate in this test, this means better rate control after the 133 // At the low bitrate in this test, this means better rate control after the
132 // update(s) to lower frame rate. So expect less frame drops, and max values 134 // update(s) to lower frame rate. So expect less frame drops, and max values
133 // for the rate control metrics can be lower. One key frame (first frame only). 135 // for the rate control metrics can be lower. One key frame (first frame only).
134 // Note: quality after update should be higher but we currently compute quality 136 // Note: quality after update should be higher but we currently compute quality
135 // metrics averaged over whole sequence run. 137 // metrics averaged over whole sequence run.
136 TEST_F(VideoProcessorIntegrationTest, 138 TEST_F(VideoProcessorIntegrationTest,
(...skipping 12 matching lines...) Expand all
149 false, false, true, false); 151 false, false, true, false);
150 // Metrics for expected quality. 152 // Metrics for expected quality.
151 QualityMetrics quality_metrics; 153 QualityMetrics quality_metrics;
152 SetQualityMetrics(&quality_metrics, 31.5, 18.0, 0.80, 0.43); 154 SetQualityMetrics(&quality_metrics, 31.5, 18.0, 0.80, 0.43);
153 // Metrics for rate control. 155 // Metrics for rate control.
154 RateControlMetrics rc_metrics[3]; 156 RateControlMetrics rc_metrics[3];
155 SetRateControlMetrics(rc_metrics, 0, 38, 50, 75, 15, 45, 0, 1); 157 SetRateControlMetrics(rc_metrics, 0, 38, 50, 75, 15, 45, 0, 1);
156 SetRateControlMetrics(rc_metrics, 1, 10, 0, 40, 10, 30, 0, 0); 158 SetRateControlMetrics(rc_metrics, 1, 10, 0, 40, 10, 30, 0, 0);
157 SetRateControlMetrics(rc_metrics, 2, 5, 0, 30, 5, 20, 0, 0); 159 SetRateControlMetrics(rc_metrics, 2, 5, 0, 30, 5, 20, 0, 0);
158 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 160 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
159 rc_metrics, nullptr /* visualization_params */); 161 rc_metrics);
160 } 162 }
161 163
162 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). 164 // VP9: Run with no packet loss and denoiser on. One key frame (first frame).
163 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { 165 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) {
164 // Bitrate and frame rate profile. 166 // Bitrate and frame rate profile.
165 RateProfile rate_profile; 167 RateProfile rate_profile;
166 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 168 SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
167 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 169 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
168 rate_profile.num_frames = kNumFramesShort; 170 rate_profile.num_frames = kNumFramesShort;
169 // Codec/network settings. 171 // Codec/network settings.
170 CodecConfigPars process_settings; 172 CodecConfigPars process_settings;
171 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1, 173 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
172 false, true, true, false); 174 false, true, true, false);
173 // Metrics for expected quality. 175 // Metrics for expected quality.
174 QualityMetrics quality_metrics; 176 QualityMetrics quality_metrics;
175 SetQualityMetrics(&quality_metrics, 36.8, 35.8, 0.92, 0.91); 177 SetQualityMetrics(&quality_metrics, 36.8, 35.8, 0.92, 0.91);
176 // Metrics for rate control. 178 // Metrics for rate control.
177 RateControlMetrics rc_metrics[1]; 179 RateControlMetrics rc_metrics[1];
178 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); 180 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1);
179 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 181 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
180 rc_metrics, nullptr /* visualization_params */); 182 rc_metrics);
181 } 183 }
182 184
183 // Run with no packet loss, at low bitrate. 185 // Run with no packet loss, at low bitrate.
184 // spatial_resize is on, for this low bitrate expect one resize in sequence. 186 // spatial_resize is on, for this low bitrate expect one resize in sequence.
185 // Resize happens on delta frame. Expect only one key frame (first frame). 187 // Resize happens on delta frame. Expect only one key frame (first frame).
186 TEST_F(VideoProcessorIntegrationTest, 188 TEST_F(VideoProcessorIntegrationTest,
187 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { 189 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) {
188 config_.networking_config.packet_loss_probability = 0; 190 config_.networking_config.packet_loss_probability = 0;
189 // Bitrate and frame rate profile. 191 // Bitrate and frame rate profile.
190 RateProfile rate_profile; 192 RateProfile rate_profile;
191 SetRateProfilePars(&rate_profile, 0, 50, 30, 0); 193 SetRateProfilePars(&rate_profile, 0, 50, 30, 0);
192 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; 194 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1;
193 rate_profile.num_frames = kNumFramesLong; 195 rate_profile.num_frames = kNumFramesLong;
194 // Codec/network settings. 196 // Codec/network settings.
195 CodecConfigPars process_settings; 197 CodecConfigPars process_settings;
196 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1, 198 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
197 false, false, true, true); 199 false, false, true, true);
198 // Metrics for expected quality. 200 // Metrics for expected quality.
199 QualityMetrics quality_metrics; 201 QualityMetrics quality_metrics;
200 SetQualityMetrics(&quality_metrics, 24.0, 13.0, 0.65, 0.37); 202 SetQualityMetrics(&quality_metrics, 24.0, 13.0, 0.65, 0.37);
201 // Metrics for rate control. 203 // Metrics for rate control.
202 RateControlMetrics rc_metrics[1]; 204 RateControlMetrics rc_metrics[1];
203 SetRateControlMetrics(rc_metrics, 0, 228, 70, 160, 15, 80, 1, 1); 205 SetRateControlMetrics(rc_metrics, 0, 228, 70, 160, 15, 80, 1, 1);
204 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 206 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
205 rc_metrics, nullptr /* visualization_params */); 207 rc_metrics);
206 } 208 }
207 209
208 // TODO(marpan): Add temporal layer test for VP9, once changes are in 210 // TODO(marpan): Add temporal layer test for VP9, once changes are in
209 // vp9 wrapper for this. 211 // vp9 wrapper for this.
210 212
211 #endif // !defined(RTC_DISABLE_VP9) 213 #endif // !defined(RTC_DISABLE_VP9)
212 214
213 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. 215 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high.
214 // One key frame (first frame only) in sequence. Setting |key_frame_interval| 216 // One key frame (first frame only) in sequence. Setting |key_frame_interval|
215 // to -1 below means no periodic key frames in test. 217 // to -1 below means no periodic key frames in test.
216 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { 218 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) {
217 // Bitrate and frame rate profile. 219 // Bitrate and frame rate profile.
218 RateProfile rate_profile; 220 RateProfile rate_profile;
219 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 221 SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
220 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 222 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
221 rate_profile.num_frames = kNumFramesShort; 223 rate_profile.num_frames = kNumFramesShort;
222 // Codec/network settings. 224 // Codec/network settings.
223 CodecConfigPars process_settings; 225 CodecConfigPars process_settings;
224 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 1, 226 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 1,
225 false, true, true, false); 227 false, true, true, false);
226 // Metrics for expected quality. 228 // Metrics for expected quality.
227 QualityMetrics quality_metrics; 229 QualityMetrics quality_metrics;
228 SetQualityMetrics(&quality_metrics, 34.95, 33.0, 0.90, 0.89); 230 SetQualityMetrics(&quality_metrics, 34.95, 33.0, 0.90, 0.89);
229 // Metrics for rate control. 231 // Metrics for rate control.
230 RateControlMetrics rc_metrics[1]; 232 RateControlMetrics rc_metrics[1];
231 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); 233 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1);
232 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 234 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
233 rc_metrics, nullptr /* visualization_params */); 235 rc_metrics);
234 } 236 }
235 237
236 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit 238 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit
237 // lower. One key frame (first frame only) in sequence. 239 // lower. One key frame (first frame only) in sequence.
238 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { 240 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) {
239 // Bitrate and frame rate profile. 241 // Bitrate and frame rate profile.
240 RateProfile rate_profile; 242 RateProfile rate_profile;
241 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 243 SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
242 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 244 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
243 rate_profile.num_frames = kNumFramesShort; 245 rate_profile.num_frames = kNumFramesShort;
244 // Codec/network settings. 246 // Codec/network settings.
245 CodecConfigPars process_settings; 247 CodecConfigPars process_settings;
246 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.05f, -1, 1, 248 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.05f, -1, 1,
247 false, true, true, false); 249 false, true, true, false);
248 // Metrics for expected quality. 250 // Metrics for expected quality.
249 QualityMetrics quality_metrics; 251 QualityMetrics quality_metrics;
250 SetQualityMetrics(&quality_metrics, 20.0, 16.0, 0.60, 0.40); 252 SetQualityMetrics(&quality_metrics, 20.0, 16.0, 0.60, 0.40);
251 // Metrics for rate control. 253 // Metrics for rate control.
252 RateControlMetrics rc_metrics[1]; 254 RateControlMetrics rc_metrics[1];
253 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); 255 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1);
254 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 256 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
255 rc_metrics, nullptr /* visualization_params */); 257 rc_metrics);
256 } 258 }
257 259
258 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. 260 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower.
259 // One key frame (first frame only) in sequence. 261 // One key frame (first frame only) in sequence.
260 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { 262 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) {
261 // Bitrate and frame rate profile. 263 // Bitrate and frame rate profile.
262 RateProfile rate_profile; 264 RateProfile rate_profile;
263 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 265 SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
264 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 266 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
265 rate_profile.num_frames = kNumFramesShort; 267 rate_profile.num_frames = kNumFramesShort;
266 // Codec/network settings. 268 // Codec/network settings.
267 CodecConfigPars process_settings; 269 CodecConfigPars process_settings;
268 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.1f, -1, 1, 270 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.1f, -1, 1,
269 false, true, true, false); 271 false, true, true, false);
270 // Metrics for expected quality. 272 // Metrics for expected quality.
271 QualityMetrics quality_metrics; 273 QualityMetrics quality_metrics;
272 SetQualityMetrics(&quality_metrics, 19.0, 16.0, 0.50, 0.35); 274 SetQualityMetrics(&quality_metrics, 19.0, 16.0, 0.50, 0.35);
273 // Metrics for rate control. 275 // Metrics for rate control.
274 RateControlMetrics rc_metrics[1]; 276 RateControlMetrics rc_metrics[1];
275 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); 277 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1);
276 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 278 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
277 rc_metrics, nullptr /* visualization_params */); 279 rc_metrics);
278 } 280 }
279 281
280 #endif // !defined(WEBRTC_IOS) 282 #endif // !defined(WEBRTC_IOS)
281 283
282 // The tests below are currently disabled for Android. For ARM, the encoder 284 // The tests below are currently disabled for Android. For ARM, the encoder
283 // uses |cpu_speed| = 12, as opposed to default |cpu_speed| <= 6 for x86, 285 // uses |cpu_speed| = 12, as opposed to default |cpu_speed| <= 6 for x86,
284 // which leads to significantly different quality. The quality and rate control 286 // which leads to significantly different quality. The quality and rate control
285 // settings in the tests below are defined for encoder speed setting 287 // settings in the tests below are defined for encoder speed setting
286 // |cpu_speed| <= ~6. A number of settings would need to be significantly 288 // |cpu_speed| <= ~6. A number of settings would need to be significantly
287 // modified for the |cpu_speed| = 12 case. For now, keep the tests below 289 // modified for the |cpu_speed| = 12 case. For now, keep the tests below
(...skipping 25 matching lines...) Expand all
313 false, true, true, false); 315 false, true, true, false);
314 // Metrics for expected quality. 316 // Metrics for expected quality.
315 QualityMetrics quality_metrics; 317 QualityMetrics quality_metrics;
316 SetQualityMetrics(&quality_metrics, 34.0, 32.0, 0.85, 0.80); 318 SetQualityMetrics(&quality_metrics, 34.0, 32.0, 0.85, 0.80);
317 // Metrics for rate control. 319 // Metrics for rate control.
318 RateControlMetrics rc_metrics[3]; 320 RateControlMetrics rc_metrics[3];
319 SetRateControlMetrics(rc_metrics, 0, 0, 45, 20, 10, 15, 0, 1); 321 SetRateControlMetrics(rc_metrics, 0, 0, 45, 20, 10, 15, 0, 1);
320 SetRateControlMetrics(rc_metrics, 1, 0, 0, 25, 20, 10, 0, 0); 322 SetRateControlMetrics(rc_metrics, 1, 0, 0, 25, 20, 10, 0, 0);
321 SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 15, 10, 0, 0); 323 SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 15, 10, 0, 0);
322 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 324 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
323 rc_metrics, nullptr /* visualization_params */); 325 rc_metrics);
324 } 326 }
325 327
326 // VP8: Run with no packet loss, with an update (decrease) in frame rate. 328 // VP8: Run with no packet loss, with an update (decrease) in frame rate.
327 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. 329 // Lower frame rate means higher per-frame-bandwidth, so easier to encode.
328 // At the bitrate in this test, this means better rate control after the 330 // At the bitrate in this test, this means better rate control after the
329 // update(s) to lower frame rate. So expect less frame drops, and max values 331 // update(s) to lower frame rate. So expect less frame drops, and max values
330 // for the rate control metrics can be lower. One key frame (first frame only). 332 // for the rate control metrics can be lower. One key frame (first frame only).
331 // Note: quality after update should be higher but we currently compute quality 333 // Note: quality after update should be higher but we currently compute quality
332 // metrics averaged over whole sequence run. 334 // metrics averaged over whole sequence run.
333 // Too slow to finish before timeout on iOS. See webrtc:4755. 335 // Too slow to finish before timeout on iOS. See webrtc:4755.
(...skipping 20 matching lines...) Expand all
354 false, true, true, false); 356 false, true, true, false);
355 // Metrics for expected quality. 357 // Metrics for expected quality.
356 QualityMetrics quality_metrics; 358 QualityMetrics quality_metrics;
357 SetQualityMetrics(&quality_metrics, 31.0, 22.0, 0.80, 0.65); 359 SetQualityMetrics(&quality_metrics, 31.0, 22.0, 0.80, 0.65);
358 // Metrics for rate control. 360 // Metrics for rate control.
359 RateControlMetrics rc_metrics[3]; 361 RateControlMetrics rc_metrics[3];
360 SetRateControlMetrics(rc_metrics, 0, 40, 20, 75, 15, 60, 0, 1); 362 SetRateControlMetrics(rc_metrics, 0, 40, 20, 75, 15, 60, 0, 1);
361 SetRateControlMetrics(rc_metrics, 1, 10, 0, 25, 10, 35, 0, 0); 363 SetRateControlMetrics(rc_metrics, 1, 10, 0, 25, 10, 35, 0, 0);
362 SetRateControlMetrics(rc_metrics, 2, 0, 0, 20, 10, 15, 0, 0); 364 SetRateControlMetrics(rc_metrics, 2, 0, 0, 20, 10, 15, 0, 0);
363 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 365 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
364 rc_metrics, nullptr /* visualization_params */); 366 rc_metrics);
365 } 367 }
366 368
367 // VP8: Run with no packet loss, with 3 temporal layers, with a rate update in 369 // VP8: Run with no packet loss, with 3 temporal layers, with a rate update in
368 // the middle of the sequence. The max values for the frame size mismatch and 370 // the middle of the sequence. The max values for the frame size mismatch and
369 // encoding rate mismatch are applied to each layer. 371 // encoding rate mismatch are applied to each layer.
370 // No dropped frames in this test, and internal spatial resizer is off. 372 // No dropped frames in this test, and internal spatial resizer is off.
371 // One key frame (first frame only) in sequence, so no spatial resizing. 373 // One key frame (first frame only) in sequence, so no spatial resizing.
372 // Too slow to finish before timeout on iOS. See webrtc:4755. 374 // Too slow to finish before timeout on iOS. See webrtc:4755.
373 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) 375 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
374 #define MAYBE_ProcessNoLossTemporalLayersVP8 \ 376 #define MAYBE_ProcessNoLossTemporalLayersVP8 \
(...skipping 14 matching lines...) Expand all
389 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 3, 391 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 3,
390 false, true, true, false); 392 false, true, true, false);
391 // Metrics for expected quality. 393 // Metrics for expected quality.
392 QualityMetrics quality_metrics; 394 QualityMetrics quality_metrics;
393 SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80); 395 SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80);
394 // Metrics for rate control. 396 // Metrics for rate control.
395 RateControlMetrics rc_metrics[2]; 397 RateControlMetrics rc_metrics[2];
396 SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1); 398 SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1);
397 SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0); 399 SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0);
398 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 400 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
399 rc_metrics, nullptr /* visualization_params */); 401 rc_metrics);
400 } 402 }
401 } // namespace test 403 } // namespace test
402 } // namespace webrtc 404 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698