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

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

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

Powered by Google App Engine
This is Rietveld 408576698