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

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

Issue 2999643002: Rename SetProcessParams -> SetTestConfig. (Closed)
Patch Set: Created 3 years, 4 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 30 matching lines...) Expand all
41 // these unittests appears to drop "packets" in a way that is not compatible 41 // these unittests appears to drop "packets" in a way that is not compatible
42 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have 42 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have
43 // not been added. 43 // not been added.
44 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { 44 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) {
45 // Bit rate and frame rate profile. 45 // Bit rate and frame rate profile.
46 RateProfile rate_profile; 46 RateProfile rate_profile;
47 SetRateProfile(&rate_profile, 0, 500, 30, 0); 47 SetRateProfile(&rate_profile, 0, 500, 30, 0);
48 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 48 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
49 rate_profile.num_frames = kNumFramesShort; 49 rate_profile.num_frames = kNumFramesShort;
50 // Codec/network settings. 50 // Codec/network settings.
51 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, 51 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif,
52 kVerboseLogging, kBatchMode); 52 kVerboseLogging, kBatchMode);
53 SetCodecSettings(&config_, kVideoCodecH264, 1, false, false, true, false, 53 SetCodecSettings(&config_, kVideoCodecH264, 1, false, false, true, false,
54 kResilienceOn, kCifWidth, kCifHeight); 54 kResilienceOn, kCifWidth, kCifHeight);
55 // Thresholds for expected quality. 55 // Thresholds for expected quality.
56 QualityThresholds quality_thresholds(35.0, 25.0, 0.93, 0.70); 56 QualityThresholds quality_thresholds(35.0, 25.0, 0.93, 0.70);
57 // Thresholds for rate control. 57 // Thresholds for rate control.
58 RateControlThresholds rc_thresholds[1]; 58 RateControlThresholds rc_thresholds[1];
59 SetRateControlThresholds(rc_thresholds, 0, 2, 60, 20, 10, 20, 0, 1); 59 SetRateControlThresholds(rc_thresholds, 0, 2, 60, 20, 10, 20, 0, 1);
60 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 60 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
61 nullptr /* visualization_params */); 61 nullptr /* visualization_params */);
62 } 62 }
63 63
64 #endif // defined(WEBRTC_USE_H264) 64 #endif // defined(WEBRTC_USE_H264)
65 65
66 // Fails on iOS. See webrtc:4755. 66 // Fails on iOS. See webrtc:4755.
67 #if !defined(WEBRTC_IOS) 67 #if !defined(WEBRTC_IOS)
68 68
69 #if !defined(RTC_DISABLE_VP9) 69 #if !defined(RTC_DISABLE_VP9)
70 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. 70 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high.
71 // One key frame (first frame only) in sequence. Setting |key_frame_interval| 71 // One key frame (first frame only) in sequence.
72 // to -1 below means no periodic key frames in test.
73 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { 72 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) {
74 // Bit rate and frame rate profile. 73 // Bit rate and frame rate profile.
75 RateProfile rate_profile; 74 RateProfile rate_profile;
76 SetRateProfile(&rate_profile, 0, 500, 30, 0); 75 SetRateProfile(&rate_profile, 0, 500, 30, 0);
77 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 76 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
78 rate_profile.num_frames = kNumFramesShort; 77 rate_profile.num_frames = kNumFramesShort;
79 // Codec/network settings. 78 // Codec/network settings.
80 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, 79 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif,
81 kVerboseLogging, kBatchMode); 80 kVerboseLogging, kBatchMode);
82 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, 81 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false,
83 kResilienceOn, kCifWidth, kCifHeight); 82 kResilienceOn, kCifWidth, kCifHeight);
84 // Thresholds for expected quality. 83 // Thresholds for expected quality.
85 QualityThresholds quality_thresholds(37.0, 36.0, 0.93, 0.92); 84 QualityThresholds quality_thresholds(37.0, 36.0, 0.93, 0.92);
86 // Thresholds for rate control. 85 // Thresholds for rate control.
87 RateControlThresholds rc_thresholds[1]; 86 RateControlThresholds rc_thresholds[1];
88 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); 87 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1);
89 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 88 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
90 nullptr /* visualization_params */); 89 nullptr /* visualization_params */);
91 } 90 }
92 91
93 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit 92 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit
94 // lower. One key frame (first frame only) in sequence. 93 // lower. One key frame (first frame only) in sequence.
95 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { 94 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) {
96 // Bit rate and frame rate profile. 95 // Bit rate and frame rate profile.
97 RateProfile rate_profile; 96 RateProfile rate_profile;
98 SetRateProfile(&rate_profile, 0, 500, 30, 0); 97 SetRateProfile(&rate_profile, 0, 500, 30, 0);
99 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 98 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
100 rate_profile.num_frames = kNumFramesShort; 99 rate_profile.num_frames = kNumFramesShort;
101 // Codec/network settings. 100 // Codec/network settings.
102 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.05f, -1, kForemanCif, 101 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.05f, kForemanCif,
103 kVerboseLogging, kBatchMode); 102 kVerboseLogging, kBatchMode);
104 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, 103 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false,
105 kResilienceOn, kCifWidth, kCifHeight); 104 kResilienceOn, kCifWidth, kCifHeight);
106 // Thresholds for expected quality. 105 // Thresholds for expected quality.
107 QualityThresholds quality_thresholds(17.0, 14.0, 0.45, 0.36); 106 QualityThresholds quality_thresholds(17.0, 14.0, 0.45, 0.36);
108 // Thresholds for rate control. 107 // Thresholds for rate control.
109 RateControlThresholds rc_thresholds[1]; 108 RateControlThresholds rc_thresholds[1];
110 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); 109 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1);
111 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 110 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
112 nullptr /* visualization_params */); 111 nullptr /* visualization_params */);
113 } 112 }
114 113
115 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): 114 // VP9: Run with no packet loss, with varying bitrate (3 rate updates):
116 // low to high to medium. Check that quality and encoder response to the new 115 // low to high to medium. Check that quality and encoder response to the new
117 // target rate/per-frame bandwidth (for each rate update) is within limits. 116 // target rate/per-frame bandwidth (for each rate update) is within limits.
118 // One key frame (first frame only) in sequence. 117 // One key frame (first frame only) in sequence.
119 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { 118 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) {
120 // Bit rate and frame rate profile. 119 // Bit rate and frame rate profile.
121 RateProfile rate_profile; 120 RateProfile rate_profile;
122 SetRateProfile(&rate_profile, 0, 200, 30, 0); 121 SetRateProfile(&rate_profile, 0, 200, 30, 0);
123 SetRateProfile(&rate_profile, 1, 700, 30, 100); 122 SetRateProfile(&rate_profile, 1, 700, 30, 100);
124 SetRateProfile(&rate_profile, 2, 500, 30, 200); 123 SetRateProfile(&rate_profile, 2, 500, 30, 200);
125 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; 124 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1;
126 rate_profile.num_frames = kNumFramesLong; 125 rate_profile.num_frames = kNumFramesLong;
127 // Codec/network settings. 126 // Codec/network settings.
128 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, 127 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif,
129 kVerboseLogging, kBatchMode); 128 kVerboseLogging, kBatchMode);
130 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, 129 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false,
131 kResilienceOn, kCifWidth, kCifHeight); 130 kResilienceOn, kCifWidth, kCifHeight);
132 // Thresholds for expected quality. 131 // Thresholds for expected quality.
133 QualityThresholds quality_thresholds(35.5, 30.0, 0.90, 0.85); 132 QualityThresholds quality_thresholds(35.5, 30.0, 0.90, 0.85);
134 // Thresholds for rate control. 133 // Thresholds for rate control.
135 RateControlThresholds rc_thresholds[3]; 134 RateControlThresholds rc_thresholds[3];
136 SetRateControlThresholds(rc_thresholds, 0, 0, 30, 20, 20, 35, 0, 1); 135 SetRateControlThresholds(rc_thresholds, 0, 0, 30, 20, 20, 35, 0, 1);
137 SetRateControlThresholds(rc_thresholds, 1, 2, 0, 20, 20, 60, 0, 0); 136 SetRateControlThresholds(rc_thresholds, 1, 2, 0, 20, 20, 60, 0, 0);
138 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 25, 20, 40, 0, 0); 137 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 25, 20, 40, 0, 0);
139 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 138 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
(...skipping 10 matching lines...) Expand all
150 TEST_F(VideoProcessorIntegrationTest, 149 TEST_F(VideoProcessorIntegrationTest,
151 ProcessNoLossChangeFrameRateFrameDropVP9) { 150 ProcessNoLossChangeFrameRateFrameDropVP9) {
152 // Bit rate and frame rate profile. 151 // Bit rate and frame rate profile.
153 RateProfile rate_profile; 152 RateProfile rate_profile;
154 SetRateProfile(&rate_profile, 0, 100, 24, 0); 153 SetRateProfile(&rate_profile, 0, 100, 24, 0);
155 SetRateProfile(&rate_profile, 1, 100, 15, 100); 154 SetRateProfile(&rate_profile, 1, 100, 15, 100);
156 SetRateProfile(&rate_profile, 2, 100, 10, 200); 155 SetRateProfile(&rate_profile, 2, 100, 10, 200);
157 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; 156 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1;
158 rate_profile.num_frames = kNumFramesLong; 157 rate_profile.num_frames = kNumFramesLong;
159 // Codec/network settings. 158 // Codec/network settings.
160 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, 159 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif,
161 kVerboseLogging, kBatchMode); 160 kVerboseLogging, kBatchMode);
162 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, 161 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false,
163 kResilienceOn, kCifWidth, kCifHeight); 162 kResilienceOn, kCifWidth, kCifHeight);
164 // Thresholds for expected quality. 163 // Thresholds for expected quality.
165 QualityThresholds quality_thresholds(31.5, 18.0, 0.80, 0.43); 164 QualityThresholds quality_thresholds(31.5, 18.0, 0.80, 0.43);
166 // Thresholds for rate control. 165 // Thresholds for rate control.
167 RateControlThresholds rc_thresholds[3]; 166 RateControlThresholds rc_thresholds[3];
168 SetRateControlThresholds(rc_thresholds, 0, 45, 50, 95, 15, 45, 0, 1); 167 SetRateControlThresholds(rc_thresholds, 0, 45, 50, 95, 15, 45, 0, 1);
169 SetRateControlThresholds(rc_thresholds, 1, 20, 0, 50, 10, 30, 0, 0); 168 SetRateControlThresholds(rc_thresholds, 1, 20, 0, 50, 10, 30, 0, 0);
170 SetRateControlThresholds(rc_thresholds, 2, 5, 0, 30, 5, 25, 0, 0); 169 SetRateControlThresholds(rc_thresholds, 2, 5, 0, 30, 5, 25, 0, 0);
171 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 170 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
172 nullptr /* visualization_params */); 171 nullptr /* visualization_params */);
173 } 172 }
174 173
175 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). 174 // VP9: Run with no packet loss and denoiser on. One key frame (first frame).
176 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { 175 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) {
177 // Bit rate and frame rate profile. 176 // Bit rate and frame rate profile.
178 RateProfile rate_profile; 177 RateProfile rate_profile;
179 SetRateProfile(&rate_profile, 0, 500, 30, 0); 178 SetRateProfile(&rate_profile, 0, 500, 30, 0);
180 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 179 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
181 rate_profile.num_frames = kNumFramesShort; 180 rate_profile.num_frames = kNumFramesShort;
182 // Codec/network settings. 181 // Codec/network settings.
183 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, 182 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif,
184 kVerboseLogging, kBatchMode); 183 kVerboseLogging, kBatchMode);
185 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, true, true, false, 184 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, true, true, false,
186 kResilienceOn, kCifWidth, kCifHeight); 185 kResilienceOn, kCifWidth, kCifHeight);
187 // Thresholds for expected quality. 186 // Thresholds for expected quality.
188 QualityThresholds quality_thresholds(36.8, 35.8, 0.92, 0.91); 187 QualityThresholds quality_thresholds(36.8, 35.8, 0.92, 0.91);
189 // Thresholds for rate control. 188 // Thresholds for rate control.
190 RateControlThresholds rc_thresholds[1]; 189 RateControlThresholds rc_thresholds[1];
191 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); 190 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1);
192 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 191 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
193 nullptr /* visualization_params */); 192 nullptr /* visualization_params */);
194 } 193 }
195 194
196 // Run with no packet loss, at low bitrate. 195 // Run with no packet loss, at low bitrate.
197 // spatial_resize is on, for this low bitrate expect one resize in sequence. 196 // spatial_resize is on, for this low bitrate expect one resize in sequence.
198 // Resize happens on delta frame. Expect only one key frame (first frame). 197 // Resize happens on delta frame. Expect only one key frame (first frame).
199 TEST_F(VideoProcessorIntegrationTest, 198 TEST_F(VideoProcessorIntegrationTest,
200 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { 199 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) {
201 // Bit rate and frame rate profile. 200 // Bit rate and frame rate profile.
202 RateProfile rate_profile; 201 RateProfile rate_profile;
203 SetRateProfile(&rate_profile, 0, 50, 30, 0); 202 SetRateProfile(&rate_profile, 0, 50, 30, 0);
204 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; 203 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1;
205 rate_profile.num_frames = kNumFramesLong; 204 rate_profile.num_frames = kNumFramesLong;
206 // Codec/network settings. 205 // Codec/network settings.
207 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, 206 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif,
208 kVerboseLogging, kBatchMode); 207 kVerboseLogging, kBatchMode);
209 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, true, 208 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, true,
210 kResilienceOn, kCifWidth, kCifHeight); 209 kResilienceOn, kCifWidth, kCifHeight);
211 // Thresholds for expected quality. 210 // Thresholds for expected quality.
212 QualityThresholds quality_thresholds(24.0, 13.0, 0.65, 0.37); 211 QualityThresholds quality_thresholds(24.0, 13.0, 0.65, 0.37);
213 // Thresholds for rate control. 212 // Thresholds for rate control.
214 RateControlThresholds rc_thresholds[1]; 213 RateControlThresholds rc_thresholds[1];
215 SetRateControlThresholds(rc_thresholds, 0, 228, 70, 160, 15, 80, 1, 1); 214 SetRateControlThresholds(rc_thresholds, 0, 228, 70, 160, 15, 80, 1, 1);
216 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 215 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
217 nullptr /* visualization_params */); 216 nullptr /* visualization_params */);
218 } 217 }
219 218
220 // TODO(marpan): Add temporal layer test for VP9, once changes are in 219 // TODO(marpan): Add temporal layer test for VP9, once changes are in
221 // vp9 wrapper for this. 220 // vp9 wrapper for this.
222 221
223 #endif // !defined(RTC_DISABLE_VP9) 222 #endif // !defined(RTC_DISABLE_VP9)
224 223
225 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. 224 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high.
226 // One key frame (first frame only) in sequence. Setting |key_frame_interval| 225 // One key frame (first frame only) in sequence. Setting |key_frame_interval|
227 // to -1 below means no periodic key frames in test. 226 // to -1 below means no periodic key frames in test.
228 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { 227 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) {
229 // Bit rate and frame rate profile. 228 // Bit rate and frame rate profile.
230 RateProfile rate_profile; 229 RateProfile rate_profile;
231 SetRateProfile(&rate_profile, 0, 500, 30, 0); 230 SetRateProfile(&rate_profile, 0, 500, 30, 0);
232 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 231 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
233 rate_profile.num_frames = kNumFramesShort; 232 rate_profile.num_frames = kNumFramesShort;
234 // Codec/network settings. 233 // Codec/network settings.
235 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, 234 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif,
236 kVerboseLogging, kBatchMode); 235 kVerboseLogging, kBatchMode);
237 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, 236 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false,
238 kResilienceOn, kCifWidth, kCifHeight); 237 kResilienceOn, kCifWidth, kCifHeight);
239 // Thresholds for expected quality. 238 // Thresholds for expected quality.
240 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89); 239 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89);
241 // Thresholds for rate control. 240 // Thresholds for rate control.
242 RateControlThresholds rc_thresholds[1]; 241 RateControlThresholds rc_thresholds[1];
243 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); 242 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1);
244 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 243 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
245 nullptr /* visualization_params */); 244 nullptr /* visualization_params */);
246 } 245 }
247 246
248 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit 247 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit
249 // lower. One key frame (first frame only) in sequence. 248 // lower. One key frame (first frame only) in sequence.
250 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { 249 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) {
251 // Bit rate and frame rate profile. 250 // Bit rate and frame rate profile.
252 RateProfile rate_profile; 251 RateProfile rate_profile;
253 SetRateProfile(&rate_profile, 0, 500, 30, 0); 252 SetRateProfile(&rate_profile, 0, 500, 30, 0);
254 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 253 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
255 rate_profile.num_frames = kNumFramesShort; 254 rate_profile.num_frames = kNumFramesShort;
256 // Codec/network settings. 255 // Codec/network settings.
257 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.05f, -1, kForemanCif, 256 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.05f, kForemanCif,
258 kVerboseLogging, kBatchMode); 257 kVerboseLogging, kBatchMode);
259 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, 258 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false,
260 kResilienceOn, kCifWidth, kCifHeight); 259 kResilienceOn, kCifWidth, kCifHeight);
261 // Thresholds for expected quality. 260 // Thresholds for expected quality.
262 QualityThresholds quality_thresholds(20.0, 16.0, 0.60, 0.40); 261 QualityThresholds quality_thresholds(20.0, 16.0, 0.60, 0.40);
263 // Thresholds for rate control. 262 // Thresholds for rate control.
264 RateControlThresholds rc_thresholds[1]; 263 RateControlThresholds rc_thresholds[1];
265 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); 264 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1);
266 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 265 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
267 nullptr /* visualization_params */); 266 nullptr /* visualization_params */);
268 } 267 }
269 268
270 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. 269 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower.
271 // One key frame (first frame only) in sequence. 270 // One key frame (first frame only) in sequence.
272 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { 271 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) {
273 // Bit rate and frame rate profile. 272 // Bit rate and frame rate profile.
274 RateProfile rate_profile; 273 RateProfile rate_profile;
275 SetRateProfile(&rate_profile, 0, 500, 30, 0); 274 SetRateProfile(&rate_profile, 0, 500, 30, 0);
276 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 275 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
277 rate_profile.num_frames = kNumFramesShort; 276 rate_profile.num_frames = kNumFramesShort;
278 // Codec/network settings. 277 // Codec/network settings.
279 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.1f, -1, kForemanCif, 278 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.1f, kForemanCif,
280 kVerboseLogging, kBatchMode); 279 kVerboseLogging, kBatchMode);
281 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, 280 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false,
282 kResilienceOn, kCifWidth, kCifHeight); 281 kResilienceOn, kCifWidth, kCifHeight);
283 // Thresholds for expected quality. 282 // Thresholds for expected quality.
284 QualityThresholds quality_thresholds(19.0, 16.0, 0.50, 0.35); 283 QualityThresholds quality_thresholds(19.0, 16.0, 0.50, 0.35);
285 // Thresholds for rate control. 284 // Thresholds for rate control.
286 RateControlThresholds rc_thresholds[1]; 285 RateControlThresholds rc_thresholds[1];
287 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); 286 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1);
288 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 287 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
289 nullptr /* visualization_params */); 288 nullptr /* visualization_params */);
290 } 289 }
291 290
292 // This test is identical to VideoProcessorIntegrationTest.ProcessZeroPacketLoss 291 // This test is identical to VideoProcessorIntegrationTest.ProcessZeroPacketLoss
293 // except that |batch_mode| is turned on. The main point of this test is to see 292 // except that |batch_mode| is turned on. The main point of this test is to see
294 // that the reported stats are not wildly varying between batch mode and the 293 // that the reported stats are not wildly varying between batch mode and the
295 // regular online mode. 294 // regular online mode.
296 TEST_F(VideoProcessorIntegrationTest, ProcessInBatchMode) { 295 TEST_F(VideoProcessorIntegrationTest, ProcessInBatchMode) {
297 // Bit rate and frame rate profile. 296 // Bit rate and frame rate profile.
298 RateProfile rate_profile; 297 RateProfile rate_profile;
299 SetRateProfile(&rate_profile, 0, 500, 30, 0); 298 SetRateProfile(&rate_profile, 0, 500, 30, 0);
300 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 299 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
301 rate_profile.num_frames = kNumFramesShort; 300 rate_profile.num_frames = kNumFramesShort;
302 // Codec/network settings. 301 // Codec/network settings.
303 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, 302 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif,
304 kVerboseLogging, true /* batch_mode */); 303 kVerboseLogging, true /* batch_mode */);
305 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, 304 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false,
306 kResilienceOn, kCifWidth, kCifHeight); 305 kResilienceOn, kCifWidth, kCifHeight);
307 // Thresholds for expected quality. 306 // Thresholds for expected quality.
308 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89); 307 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89);
309 // Thresholds for rate control. 308 // Thresholds for rate control.
310 RateControlThresholds rc_thresholds[1]; 309 RateControlThresholds rc_thresholds[1];
311 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1); 310 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1);
312 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 311 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
313 nullptr /* visualization_params */); 312 nullptr /* visualization_params */);
314 } 313 }
(...skipping 22 matching lines...) Expand all
337 #endif 336 #endif
338 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) { 337 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) {
339 // Bit rate and frame rate profile. 338 // Bit rate and frame rate profile.
340 RateProfile rate_profile; 339 RateProfile rate_profile;
341 SetRateProfile(&rate_profile, 0, 200, 30, 0); 340 SetRateProfile(&rate_profile, 0, 200, 30, 0);
342 SetRateProfile(&rate_profile, 1, 800, 30, 100); 341 SetRateProfile(&rate_profile, 1, 800, 30, 100);
343 SetRateProfile(&rate_profile, 2, 500, 30, 200); 342 SetRateProfile(&rate_profile, 2, 500, 30, 200);
344 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; 343 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1;
345 rate_profile.num_frames = kNumFramesLong; 344 rate_profile.num_frames = kNumFramesLong;
346 // Codec/network settings. 345 // Codec/network settings.
347 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, 346 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif,
348 kVerboseLogging, kBatchMode); 347 kVerboseLogging, kBatchMode);
349 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, 348 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false,
350 kResilienceOn, kCifWidth, kCifHeight); 349 kResilienceOn, kCifWidth, kCifHeight);
351 // Thresholds for expected quality. 350 // Thresholds for expected quality.
352 QualityThresholds quality_thresholds(34.0, 32.0, 0.85, 0.80); 351 QualityThresholds quality_thresholds(34.0, 32.0, 0.85, 0.80);
353 // Thresholds for rate control. 352 // Thresholds for rate control.
354 RateControlThresholds rc_thresholds[3]; 353 RateControlThresholds rc_thresholds[3];
355 SetRateControlThresholds(rc_thresholds, 0, 0, 45, 20, 10, 15, 0, 1); 354 SetRateControlThresholds(rc_thresholds, 0, 0, 45, 20, 10, 15, 0, 1);
356 SetRateControlThresholds(rc_thresholds, 1, 0, 0, 25, 20, 10, 0, 0); 355 SetRateControlThresholds(rc_thresholds, 1, 0, 0, 25, 20, 10, 0, 0);
357 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 25, 15, 10, 0, 0); 356 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 25, 15, 10, 0, 0);
358 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 357 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
(...skipping 18 matching lines...) Expand all
377 TEST_F(VideoProcessorIntegrationTest, 376 TEST_F(VideoProcessorIntegrationTest,
378 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) { 377 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) {
379 // Bit rate and frame rate profile. 378 // Bit rate and frame rate profile.
380 RateProfile rate_profile; 379 RateProfile rate_profile;
381 SetRateProfile(&rate_profile, 0, 80, 24, 0); 380 SetRateProfile(&rate_profile, 0, 80, 24, 0);
382 SetRateProfile(&rate_profile, 1, 80, 15, 100); 381 SetRateProfile(&rate_profile, 1, 80, 15, 100);
383 SetRateProfile(&rate_profile, 2, 80, 10, 200); 382 SetRateProfile(&rate_profile, 2, 80, 10, 200);
384 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; 383 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1;
385 rate_profile.num_frames = kNumFramesLong; 384 rate_profile.num_frames = kNumFramesLong;
386 // Codec/network settings. 385 // Codec/network settings.
387 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, 386 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif,
388 kVerboseLogging, kBatchMode); 387 kVerboseLogging, kBatchMode);
389 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, 388 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false,
390 kResilienceOn, kCifWidth, kCifHeight); 389 kResilienceOn, kCifWidth, kCifHeight);
391 // Thresholds for expected quality. 390 // Thresholds for expected quality.
392 QualityThresholds quality_thresholds(31.0, 22.0, 0.80, 0.65); 391 QualityThresholds quality_thresholds(31.0, 22.0, 0.80, 0.65);
393 // Thresholds for rate control. 392 // Thresholds for rate control.
394 RateControlThresholds rc_thresholds[3]; 393 RateControlThresholds rc_thresholds[3];
395 SetRateControlThresholds(rc_thresholds, 0, 40, 20, 75, 15, 60, 0, 1); 394 SetRateControlThresholds(rc_thresholds, 0, 40, 20, 75, 15, 60, 0, 1);
396 SetRateControlThresholds(rc_thresholds, 1, 10, 0, 25, 10, 35, 0, 0); 395 SetRateControlThresholds(rc_thresholds, 1, 10, 0, 25, 10, 35, 0, 0);
397 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 20, 10, 15, 0, 0); 396 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 20, 10, 15, 0, 0);
398 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 397 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
(...skipping 13 matching lines...) Expand all
412 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8 411 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8
413 #endif 412 #endif
414 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { 413 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) {
415 // Bit rate and frame rate profile. 414 // Bit rate and frame rate profile.
416 RateProfile rate_profile; 415 RateProfile rate_profile;
417 SetRateProfile(&rate_profile, 0, 200, 30, 0); 416 SetRateProfile(&rate_profile, 0, 200, 30, 0);
418 SetRateProfile(&rate_profile, 1, 400, 30, 150); 417 SetRateProfile(&rate_profile, 1, 400, 30, 150);
419 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; 418 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1;
420 rate_profile.num_frames = kNumFramesLong; 419 rate_profile.num_frames = kNumFramesLong;
421 // Codec/network settings. 420 // Codec/network settings.
422 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, 421 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif,
423 kVerboseLogging, kBatchMode); 422 kVerboseLogging, kBatchMode);
424 SetCodecSettings(&config_, kVideoCodecVP8, 3, false, true, true, false, 423 SetCodecSettings(&config_, kVideoCodecVP8, 3, false, true, true, false,
425 kResilienceOn, kCifWidth, kCifHeight); 424 kResilienceOn, kCifWidth, kCifHeight);
426 // Thresholds for expected quality. 425 // Thresholds for expected quality.
427 QualityThresholds quality_thresholds(32.5, 30.0, 0.85, 0.80); 426 QualityThresholds quality_thresholds(32.5, 30.0, 0.85, 0.80);
428 // Thresholds for rate control. 427 // Thresholds for rate control.
429 RateControlThresholds rc_thresholds[2]; 428 RateControlThresholds rc_thresholds[2];
430 SetRateControlThresholds(rc_thresholds, 0, 0, 20, 30, 10, 10, 0, 1); 429 SetRateControlThresholds(rc_thresholds, 0, 0, 20, 30, 10, 10, 0, 1);
431 SetRateControlThresholds(rc_thresholds, 1, 0, 0, 30, 15, 10, 0, 0); 430 SetRateControlThresholds(rc_thresholds, 1, 0, 0, 30, 15, 10, 0, 0);
432 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, 431 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds,
433 nullptr /* visualization_params */); 432 nullptr /* visualization_params */);
434 } 433 }
435 } // namespace test 434 } // namespace test
436 } // namespace webrtc 435 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698