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

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

Issue 2703333004: Rename config structs in 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 10 matching lines...) Expand all
21 } // namespace 21 } // namespace
22 22
23 #if defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) 23 #if defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS)
24 24
25 // H264: Run with no packet loss and fixed bitrate. Quality should be very high. 25 // H264: Run with no packet loss and fixed bitrate. Quality should be very high.
26 // Note(hbos): The PacketManipulatorImpl code used to simulate packet loss in 26 // Note(hbos): The PacketManipulatorImpl code used to simulate packet loss in
27 // these unittests appears to drop "packets" in a way that is not compatible 27 // these unittests appears to drop "packets" in a way that is not compatible
28 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have 28 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have
29 // not been added. 29 // not been added.
30 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { 30 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) {
31 // Bitrate and frame rate profile. 31 // Bit rate and frame rate profile.
32 RateProfile rate_profile; 32 RateProfile rate_profile;
33 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 33 SetRateProfile(&rate_profile, 0, 500, 30, 0);
34 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 34 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
35 rate_profile.num_frames = kNumFramesShort; 35 rate_profile.num_frames = kNumFramesShort;
36 // Codec/network settings. 36 // Codec/network settings.
37 CodecConfigPars process_settings; 37 CodecParams process_settings;
38 SetCodecParameters(&process_settings, kVideoCodecH264, kHwCodec, 0.0f, -1, 1, 38 SetCodecParams(&process_settings, kVideoCodecH264, kHwCodec, 0.0f, -1, 1,
39 false, false, true, false); 39 false, false, true, false);
40 // Metrics for expected quality. 40 // Thresholds for expected quality.
41 QualityMetrics quality_metrics; 41 QualityThresholds quality_thresholds;
42 SetQualityMetrics(&quality_metrics, 35.0, 25.0, 0.93, 0.70); 42 SetQualityThresholds(&quality_thresholds, 35.0, 25.0, 0.93, 0.70);
43 // Metrics for rate control. 43 // Thresholds for rate control.
44 RateControlMetrics rc_metrics[1]; 44 RateControlThresholds rc_thresholds[1];
45 SetRateControlMetrics(rc_metrics, 0, 2, 60, 20, 10, 20, 0, 1); 45 SetRateControlThresholds(rc_thresholds, 0, 2, 60, 20, 10, 20, 0, 1);
46 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 46 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings,
47 rc_metrics, nullptr /* visualization_params */); 47 rc_thresholds, nullptr /* visualization_params */);
48 } 48 }
49 49
50 #endif // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) 50 #endif // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS)
51 51
52 // Fails on iOS. See webrtc:4755. 52 // Fails on iOS. See webrtc:4755.
53 #if !defined(WEBRTC_IOS) 53 #if !defined(WEBRTC_IOS)
54 54
55 #if !defined(RTC_DISABLE_VP9) 55 #if !defined(RTC_DISABLE_VP9)
56 // 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.
57 // 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|
58 // to -1 below means no periodic key frames in test. 58 // to -1 below means no periodic key frames in test.
59 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { 59 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) {
60 // Bitrate and frame rate profile. 60 // Bit rate and frame rate profile.
61 RateProfile rate_profile; 61 RateProfile rate_profile;
62 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 62 SetRateProfile(&rate_profile, 0, 500, 30, 0);
63 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 63 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
64 rate_profile.num_frames = kNumFramesShort; 64 rate_profile.num_frames = kNumFramesShort;
65 // Codec/network settings. 65 // Codec/network settings.
66 CodecConfigPars process_settings; 66 CodecParams process_settings;
67 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1, 67 SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
68 false, false, true, false); 68 false, false, true, false);
69 // Metrics for expected quality. 69 // Thresholds for expected quality.
70 QualityMetrics quality_metrics; 70 QualityThresholds quality_thresholds;
71 SetQualityMetrics(&quality_metrics, 37.0, 36.0, 0.93, 0.92); 71 SetQualityThresholds(&quality_thresholds, 37.0, 36.0, 0.93, 0.92);
72 // Metrics for rate control. 72 // Thresholds for rate control.
73 RateControlMetrics rc_metrics[1]; 73 RateControlThresholds rc_thresholds[1];
74 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); 74 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1);
75 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 75 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings,
76 rc_metrics, nullptr /* visualization_params */); 76 rc_thresholds, nullptr /* visualization_params */);
77 } 77 }
78 78
79 // 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
80 // lower. One key frame (first frame only) in sequence. 80 // lower. One key frame (first frame only) in sequence.
81 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { 81 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) {
82 // Bitrate and frame rate profile. 82 // Bit rate and frame rate profile.
83 RateProfile rate_profile; 83 RateProfile rate_profile;
84 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 84 SetRateProfile(&rate_profile, 0, 500, 30, 0);
85 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 85 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
86 rate_profile.num_frames = kNumFramesShort; 86 rate_profile.num_frames = kNumFramesShort;
87 // Codec/network settings. 87 // Codec/network settings.
88 CodecConfigPars process_settings; 88 CodecParams process_settings;
89 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.05f, -1, 1, 89 SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, 0.05f, -1, 1,
90 false, false, true, false); 90 false, false, true, false);
91 // Metrics for expected quality. 91 // Thresholds for expected quality.
92 QualityMetrics quality_metrics; 92 QualityThresholds quality_thresholds;
93 SetQualityMetrics(&quality_metrics, 17.0, 14.0, 0.45, 0.36); 93 SetQualityThresholds(&quality_thresholds, 17.0, 14.0, 0.45, 0.36);
94 // Metrics for rate control. 94 // Thresholds for rate control.
95 RateControlMetrics rc_metrics[1]; 95 RateControlThresholds rc_thresholds[1];
96 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); 96 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1);
97 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 97 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings,
98 rc_metrics, nullptr /* visualization_params */); 98 rc_thresholds, nullptr /* visualization_params */);
99 } 99 }
100 100
101 // 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):
102 // 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
103 // 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.
104 // One key frame (first frame only) in sequence. 104 // One key frame (first frame only) in sequence.
105 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { 105 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) {
106 // Bitrate and frame rate profile. 106 // Bit rate and frame rate profile.
107 RateProfile rate_profile; 107 RateProfile rate_profile;
108 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); 108 SetRateProfile(&rate_profile, 0, 200, 30, 0);
109 SetRateProfilePars(&rate_profile, 1, 700, 30, 100); 109 SetRateProfile(&rate_profile, 1, 700, 30, 100);
110 SetRateProfilePars(&rate_profile, 2, 500, 30, 200); 110 SetRateProfile(&rate_profile, 2, 500, 30, 200);
111 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; 111 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1;
112 rate_profile.num_frames = kNumFramesLong; 112 rate_profile.num_frames = kNumFramesLong;
113 // Codec/network settings. 113 // Codec/network settings.
114 CodecConfigPars process_settings; 114 CodecParams process_settings;
115 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1, 115 SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
116 false, false, true, false); 116 false, false, true, false);
117 // Metrics for expected quality. 117 // Thresholds for expected quality.
118 QualityMetrics quality_metrics; 118 QualityThresholds quality_thresholds;
119 SetQualityMetrics(&quality_metrics, 35.5, 30.0, 0.90, 0.85); 119 SetQualityThresholds(&quality_thresholds, 35.5, 30.0, 0.90, 0.85);
120 // Metrics for rate control. 120 // Thresholds for rate control.
121 RateControlMetrics rc_metrics[3]; 121 RateControlThresholds rc_thresholds[3];
122 SetRateControlMetrics(rc_metrics, 0, 0, 30, 20, 20, 30, 0, 1); 122 SetRateControlThresholds(rc_thresholds, 0, 0, 30, 20, 20, 30, 0, 1);
123 SetRateControlMetrics(rc_metrics, 1, 2, 0, 20, 20, 60, 0, 0); 123 SetRateControlThresholds(rc_thresholds, 1, 2, 0, 20, 20, 60, 0, 0);
124 SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 20, 40, 0, 0); 124 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 25, 20, 40, 0, 0);
125 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 125 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings,
126 rc_metrics, nullptr /* visualization_params */); 126 rc_thresholds, nullptr /* visualization_params */);
127 } 127 }
128 128
129 // 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.
130 // 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.
131 // 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
132 // 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
133 // 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).
134 // 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
135 // metrics averaged over whole sequence run. 135 // metrics averaged over whole sequence run.
136 TEST_F(VideoProcessorIntegrationTest, 136 TEST_F(VideoProcessorIntegrationTest,
137 ProcessNoLossChangeFrameRateFrameDropVP9) { 137 ProcessNoLossChangeFrameRateFrameDropVP9) {
138 config_.networking_config.packet_loss_probability = 0; 138 config_.networking_config.packet_loss_probability = 0;
139 // Bitrate and frame rate profile. 139 // Bit rate and frame rate profile.
140 RateProfile rate_profile; 140 RateProfile rate_profile;
141 SetRateProfilePars(&rate_profile, 0, 100, 24, 0); 141 SetRateProfile(&rate_profile, 0, 100, 24, 0);
142 SetRateProfilePars(&rate_profile, 1, 100, 15, 100); 142 SetRateProfile(&rate_profile, 1, 100, 15, 100);
143 SetRateProfilePars(&rate_profile, 2, 100, 10, 200); 143 SetRateProfile(&rate_profile, 2, 100, 10, 200);
144 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; 144 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1;
145 rate_profile.num_frames = kNumFramesLong; 145 rate_profile.num_frames = kNumFramesLong;
146 // Codec/network settings. 146 // Codec/network settings.
147 CodecConfigPars process_settings; 147 CodecParams process_settings;
148 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1, 148 SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
149 false, false, true, false); 149 false, false, true, false);
150 // Metrics for expected quality. 150 // Thresholds for expected quality.
151 QualityMetrics quality_metrics; 151 QualityThresholds quality_thresholds;
152 SetQualityMetrics(&quality_metrics, 31.5, 18.0, 0.80, 0.43); 152 SetQualityThresholds(&quality_thresholds, 31.5, 18.0, 0.80, 0.43);
153 // Metrics for rate control. 153 // Thresholds for rate control.
154 RateControlMetrics rc_metrics[3]; 154 RateControlThresholds rc_thresholds[3];
155 SetRateControlMetrics(rc_metrics, 0, 38, 50, 75, 15, 45, 0, 1); 155 SetRateControlThresholds(rc_thresholds, 0, 38, 50, 75, 15, 45, 0, 1);
156 SetRateControlMetrics(rc_metrics, 1, 10, 0, 40, 10, 30, 0, 0); 156 SetRateControlThresholds(rc_thresholds, 1, 10, 0, 40, 10, 30, 0, 0);
157 SetRateControlMetrics(rc_metrics, 2, 5, 0, 30, 5, 20, 0, 0); 157 SetRateControlThresholds(rc_thresholds, 2, 5, 0, 30, 5, 20, 0, 0);
158 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 158 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings,
159 rc_metrics, nullptr /* visualization_params */); 159 rc_thresholds, nullptr /* visualization_params */);
160 } 160 }
161 161
162 // 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).
163 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { 163 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) {
164 // Bitrate and frame rate profile. 164 // Bit rate and frame rate profile.
165 RateProfile rate_profile; 165 RateProfile rate_profile;
166 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 166 SetRateProfile(&rate_profile, 0, 500, 30, 0);
167 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 167 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
168 rate_profile.num_frames = kNumFramesShort; 168 rate_profile.num_frames = kNumFramesShort;
169 // Codec/network settings. 169 // Codec/network settings.
170 CodecConfigPars process_settings; 170 CodecParams process_settings;
171 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1, 171 SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
172 false, true, true, false); 172 false, true, true, false);
173 // Metrics for expected quality. 173 // Thresholds for expected quality.
174 QualityMetrics quality_metrics; 174 QualityThresholds quality_thresholds;
175 SetQualityMetrics(&quality_metrics, 36.8, 35.8, 0.92, 0.91); 175 SetQualityThresholds(&quality_thresholds, 36.8, 35.8, 0.92, 0.91);
176 // Metrics for rate control. 176 // Thresholds for rate control.
177 RateControlMetrics rc_metrics[1]; 177 RateControlThresholds rc_thresholds[1];
178 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); 178 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1);
179 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 179 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings,
180 rc_metrics, nullptr /* visualization_params */); 180 rc_thresholds, nullptr /* visualization_params */);
181 } 181 }
182 182
183 // Run with no packet loss, at low bitrate. 183 // Run with no packet loss, at low bitrate.
184 // 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.
185 // 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).
186 TEST_F(VideoProcessorIntegrationTest, 186 TEST_F(VideoProcessorIntegrationTest,
187 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { 187 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) {
188 config_.networking_config.packet_loss_probability = 0; 188 config_.networking_config.packet_loss_probability = 0;
189 // Bitrate and frame rate profile. 189 // Bit rate and frame rate profile.
190 RateProfile rate_profile; 190 RateProfile rate_profile;
191 SetRateProfilePars(&rate_profile, 0, 50, 30, 0); 191 SetRateProfile(&rate_profile, 0, 50, 30, 0);
192 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; 192 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1;
193 rate_profile.num_frames = kNumFramesLong; 193 rate_profile.num_frames = kNumFramesLong;
194 // Codec/network settings. 194 // Codec/network settings.
195 CodecConfigPars process_settings; 195 CodecParams process_settings;
196 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1, 196 SetCodecParams(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
197 false, false, true, true); 197 false, false, true, true);
198 // Metrics for expected quality. 198 // Thresholds for expected quality.
199 QualityMetrics quality_metrics; 199 QualityThresholds quality_thresholds;
200 SetQualityMetrics(&quality_metrics, 24.0, 13.0, 0.65, 0.37); 200 SetQualityThresholds(&quality_thresholds, 24.0, 13.0, 0.65, 0.37);
201 // Metrics for rate control. 201 // Thresholds for rate control.
202 RateControlMetrics rc_metrics[1]; 202 RateControlThresholds rc_thresholds[1];
203 SetRateControlMetrics(rc_metrics, 0, 228, 70, 160, 15, 80, 1, 1); 203 SetRateControlThresholds(rc_thresholds, 0, 228, 70, 160, 15, 80, 1, 1);
204 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 204 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings,
205 rc_metrics, nullptr /* visualization_params */); 205 rc_thresholds, nullptr /* visualization_params */);
206 } 206 }
207 207
208 // 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
209 // vp9 wrapper for this. 209 // vp9 wrapper for this.
210 210
211 #endif // !defined(RTC_DISABLE_VP9) 211 #endif // !defined(RTC_DISABLE_VP9)
212 212
213 // 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.
214 // 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|
215 // to -1 below means no periodic key frames in test. 215 // to -1 below means no periodic key frames in test.
216 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { 216 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) {
217 // Bitrate and frame rate profile. 217 // Bit rate and frame rate profile.
218 RateProfile rate_profile; 218 RateProfile rate_profile;
219 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 219 SetRateProfile(&rate_profile, 0, 500, 30, 0);
220 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 220 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
221 rate_profile.num_frames = kNumFramesShort; 221 rate_profile.num_frames = kNumFramesShort;
222 // Codec/network settings. 222 // Codec/network settings.
223 CodecConfigPars process_settings; 223 CodecParams process_settings;
224 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 1, 224 SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 1,
225 false, true, true, false); 225 false, true, true, false);
226 // Metrics for expected quality. 226 // Thresholds for expected quality.
227 QualityMetrics quality_metrics; 227 QualityThresholds quality_thresholds;
228 SetQualityMetrics(&quality_metrics, 34.95, 33.0, 0.90, 0.89); 228 SetQualityThresholds(&quality_thresholds, 34.95, 33.0, 0.90, 0.89);
229 // Metrics for rate control. 229 // Thresholds for rate control.
230 RateControlMetrics rc_metrics[1]; 230 RateControlThresholds rc_thresholds[1];
231 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); 231 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1);
232 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 232 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings,
233 rc_metrics, nullptr /* visualization_params */); 233 rc_thresholds, nullptr /* visualization_params */);
234 } 234 }
235 235
236 // 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
237 // lower. One key frame (first frame only) in sequence. 237 // lower. One key frame (first frame only) in sequence.
238 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { 238 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) {
239 // Bitrate and frame rate profile. 239 // Bit rate and frame rate profile.
240 RateProfile rate_profile; 240 RateProfile rate_profile;
241 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 241 SetRateProfile(&rate_profile, 0, 500, 30, 0);
242 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 242 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
243 rate_profile.num_frames = kNumFramesShort; 243 rate_profile.num_frames = kNumFramesShort;
244 // Codec/network settings. 244 // Codec/network settings.
245 CodecConfigPars process_settings; 245 CodecParams process_settings;
246 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.05f, -1, 1, 246 SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, 0.05f, -1, 1,
247 false, true, true, false); 247 false, true, true, false);
248 // Metrics for expected quality. 248 // Thresholds for expected quality.
249 QualityMetrics quality_metrics; 249 QualityThresholds quality_thresholds;
250 SetQualityMetrics(&quality_metrics, 20.0, 16.0, 0.60, 0.40); 250 SetQualityThresholds(&quality_thresholds, 20.0, 16.0, 0.60, 0.40);
251 // Metrics for rate control. 251 // Thresholds for rate control.
252 RateControlMetrics rc_metrics[1]; 252 RateControlThresholds rc_thresholds[1];
253 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); 253 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1);
254 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 254 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings,
255 rc_metrics, nullptr /* visualization_params */); 255 rc_thresholds, nullptr /* visualization_params */);
256 } 256 }
257 257
258 // 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.
259 // One key frame (first frame only) in sequence. 259 // One key frame (first frame only) in sequence.
260 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { 260 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) {
261 // Bitrate and frame rate profile. 261 // Bit rate and frame rate profile.
262 RateProfile rate_profile; 262 RateProfile rate_profile;
263 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 263 SetRateProfile(&rate_profile, 0, 500, 30, 0);
264 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 264 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
265 rate_profile.num_frames = kNumFramesShort; 265 rate_profile.num_frames = kNumFramesShort;
266 // Codec/network settings. 266 // Codec/network settings.
267 CodecConfigPars process_settings; 267 CodecParams process_settings;
268 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.1f, -1, 1, 268 SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, 0.1f, -1, 1,
269 false, true, true, false); 269 false, true, true, false);
270 // Metrics for expected quality. 270 // Thresholds for expected quality.
271 QualityMetrics quality_metrics; 271 QualityThresholds quality_thresholds;
272 SetQualityMetrics(&quality_metrics, 19.0, 16.0, 0.50, 0.35); 272 SetQualityThresholds(&quality_thresholds, 19.0, 16.0, 0.50, 0.35);
273 // Metrics for rate control. 273 // Thresholds for rate control.
274 RateControlMetrics rc_metrics[1]; 274 RateControlThresholds rc_thresholds[1];
275 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); 275 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 15, 0, 1);
276 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 276 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings,
277 rc_metrics, nullptr /* visualization_params */); 277 rc_thresholds, nullptr /* visualization_params */);
278 } 278 }
279 279
280 #endif // !defined(WEBRTC_IOS) 280 #endif // !defined(WEBRTC_IOS)
281 281
282 // 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
283 // 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,
284 // which leads to significantly different quality. The quality and rate control 284 // which leads to significantly different quality. The quality and rate control
285 // settings in the tests below are defined for encoder speed setting 285 // settings in the tests below are defined for encoder speed setting
286 // |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
287 // 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
288 // disabled on Android. Some quality parameter in the above test has been 288 // disabled on Android. Some quality parameter in the above test has been
289 // adjusted to also pass for |cpu_speed| <= 12. 289 // adjusted to also pass for |cpu_speed| <= 12.
290 290
291 // VP8: Run with no packet loss, with varying bitrate (3 rate updates): 291 // VP8: Run with no packet loss, with varying bitrate (3 rate updates):
292 // low to high to medium. Check that quality and encoder response to the new 292 // low to high to medium. Check that quality and encoder response to the new
293 // target rate/per-frame bandwidth (for each rate update) is within limits. 293 // target rate/per-frame bandwidth (for each rate update) is within limits.
294 // One key frame (first frame only) in sequence. 294 // One key frame (first frame only) in sequence.
295 // Too slow to finish before timeout on iOS. See webrtc:4755. 295 // Too slow to finish before timeout on iOS. See webrtc:4755.
296 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) 296 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
297 #define MAYBE_ProcessNoLossChangeBitRateVP8 \ 297 #define MAYBE_ProcessNoLossChangeBitRateVP8 \
298 DISABLED_ProcessNoLossChangeBitRateVP8 298 DISABLED_ProcessNoLossChangeBitRateVP8
299 #else 299 #else
300 #define MAYBE_ProcessNoLossChangeBitRateVP8 ProcessNoLossChangeBitRateVP8 300 #define MAYBE_ProcessNoLossChangeBitRateVP8 ProcessNoLossChangeBitRateVP8
301 #endif 301 #endif
302 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) { 302 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) {
303 // Bitrate and frame rate profile. 303 // Bit rate and frame rate profile.
304 RateProfile rate_profile; 304 RateProfile rate_profile;
305 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); 305 SetRateProfile(&rate_profile, 0, 200, 30, 0);
306 SetRateProfilePars(&rate_profile, 1, 800, 30, 100); 306 SetRateProfile(&rate_profile, 1, 800, 30, 100);
307 SetRateProfilePars(&rate_profile, 2, 500, 30, 200); 307 SetRateProfile(&rate_profile, 2, 500, 30, 200);
308 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; 308 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1;
309 rate_profile.num_frames = kNumFramesLong; 309 rate_profile.num_frames = kNumFramesLong;
310 // Codec/network settings. 310 // Codec/network settings.
311 CodecConfigPars process_settings; 311 CodecParams process_settings;
312 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 1, 312 SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 1,
313 false, true, true, false); 313 false, true, true, false);
314 // Metrics for expected quality. 314 // Thresholds for expected quality.
315 QualityMetrics quality_metrics; 315 QualityThresholds quality_thresholds;
316 SetQualityMetrics(&quality_metrics, 34.0, 32.0, 0.85, 0.80); 316 SetQualityThresholds(&quality_thresholds, 34.0, 32.0, 0.85, 0.80);
317 // Metrics for rate control. 317 // Thresholds for rate control.
318 RateControlMetrics rc_metrics[3]; 318 RateControlThresholds rc_thresholds[3];
319 SetRateControlMetrics(rc_metrics, 0, 0, 45, 20, 10, 15, 0, 1); 319 SetRateControlThresholds(rc_thresholds, 0, 0, 45, 20, 10, 15, 0, 1);
320 SetRateControlMetrics(rc_metrics, 1, 0, 0, 25, 20, 10, 0, 0); 320 SetRateControlThresholds(rc_thresholds, 1, 0, 0, 25, 20, 10, 0, 0);
321 SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 15, 10, 0, 0); 321 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 25, 15, 10, 0, 0);
322 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 322 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings,
323 rc_metrics, nullptr /* visualization_params */); 323 rc_thresholds, nullptr /* visualization_params */);
324 } 324 }
325 325
326 // 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.
327 // 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.
328 // 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
329 // 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
330 // 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).
331 // 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
332 // metrics averaged over whole sequence run. 332 // metrics averaged over whole sequence run.
333 // Too slow to finish before timeout on iOS. See webrtc:4755. 333 // Too slow to finish before timeout on iOS. See webrtc:4755.
334 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) 334 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
335 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ 335 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \
336 DISABLED_ProcessNoLossChangeFrameRateFrameDropVP8 336 DISABLED_ProcessNoLossChangeFrameRateFrameDropVP8
337 #else 337 #else
338 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ 338 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \
339 ProcessNoLossChangeFrameRateFrameDropVP8 339 ProcessNoLossChangeFrameRateFrameDropVP8
340 #endif 340 #endif
341 TEST_F(VideoProcessorIntegrationTest, 341 TEST_F(VideoProcessorIntegrationTest,
342 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) { 342 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) {
343 config_.networking_config.packet_loss_probability = 0; 343 config_.networking_config.packet_loss_probability = 0;
344 // Bitrate and frame rate profile. 344 // Bit rate and frame rate profile.
345 RateProfile rate_profile; 345 RateProfile rate_profile;
346 SetRateProfilePars(&rate_profile, 0, 80, 24, 0); 346 SetRateProfile(&rate_profile, 0, 80, 24, 0);
347 SetRateProfilePars(&rate_profile, 1, 80, 15, 100); 347 SetRateProfile(&rate_profile, 1, 80, 15, 100);
348 SetRateProfilePars(&rate_profile, 2, 80, 10, 200); 348 SetRateProfile(&rate_profile, 2, 80, 10, 200);
349 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; 349 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1;
350 rate_profile.num_frames = kNumFramesLong; 350 rate_profile.num_frames = kNumFramesLong;
351 // Codec/network settings. 351 // Codec/network settings.
352 CodecConfigPars process_settings; 352 CodecParams process_settings;
353 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 1, 353 SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 1,
354 false, true, true, false); 354 false, true, true, false);
355 // Metrics for expected quality. 355 // Thresholds for expected quality.
356 QualityMetrics quality_metrics; 356 QualityThresholds quality_thresholds;
357 SetQualityMetrics(&quality_metrics, 31.0, 22.0, 0.80, 0.65); 357 SetQualityThresholds(&quality_thresholds, 31.0, 22.0, 0.80, 0.65);
358 // Metrics for rate control. 358 // Thresholds for rate control.
359 RateControlMetrics rc_metrics[3]; 359 RateControlThresholds rc_thresholds[3];
360 SetRateControlMetrics(rc_metrics, 0, 40, 20, 75, 15, 60, 0, 1); 360 SetRateControlThresholds(rc_thresholds, 0, 40, 20, 75, 15, 60, 0, 1);
361 SetRateControlMetrics(rc_metrics, 1, 10, 0, 25, 10, 35, 0, 0); 361 SetRateControlThresholds(rc_thresholds, 1, 10, 0, 25, 10, 35, 0, 0);
362 SetRateControlMetrics(rc_metrics, 2, 0, 0, 20, 10, 15, 0, 0); 362 SetRateControlThresholds(rc_thresholds, 2, 0, 0, 20, 10, 15, 0, 0);
363 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 363 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings,
364 rc_metrics, nullptr /* visualization_params */); 364 rc_thresholds, nullptr /* visualization_params */);
365 } 365 }
366 366
367 // 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
368 // 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
369 // encoding rate mismatch are applied to each layer. 369 // encoding rate mismatch are applied to each layer.
370 // 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.
371 // 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.
372 // Too slow to finish before timeout on iOS. See webrtc:4755. 372 // Too slow to finish before timeout on iOS. See webrtc:4755.
373 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) 373 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
374 #define MAYBE_ProcessNoLossTemporalLayersVP8 \ 374 #define MAYBE_ProcessNoLossTemporalLayersVP8 \
375 DISABLED_ProcessNoLossTemporalLayersVP8 375 DISABLED_ProcessNoLossTemporalLayersVP8
376 #else 376 #else
377 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8 377 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8
378 #endif 378 #endif
379 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { 379 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) {
380 config_.networking_config.packet_loss_probability = 0; 380 config_.networking_config.packet_loss_probability = 0;
381 // Bitrate and frame rate profile. 381 // Bit rate and frame rate profile.
382 RateProfile rate_profile; 382 RateProfile rate_profile;
383 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); 383 SetRateProfile(&rate_profile, 0, 200, 30, 0);
384 SetRateProfilePars(&rate_profile, 1, 400, 30, 150); 384 SetRateProfile(&rate_profile, 1, 400, 30, 150);
385 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; 385 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1;
386 rate_profile.num_frames = kNumFramesLong; 386 rate_profile.num_frames = kNumFramesLong;
387 // Codec/network settings. 387 // Codec/network settings.
388 CodecConfigPars process_settings; 388 CodecParams process_settings;
389 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 3, 389 SetCodecParams(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 3,
390 false, true, true, false); 390 false, true, true, false);
391 // Metrics for expected quality. 391 // Thresholds for expected quality.
392 QualityMetrics quality_metrics; 392 QualityThresholds quality_thresholds;
393 SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80); 393 SetQualityThresholds(&quality_thresholds, 32.5, 30.0, 0.85, 0.80);
394 // Metrics for rate control. 394 // Thresholds for rate control.
395 RateControlMetrics rc_metrics[2]; 395 RateControlThresholds rc_thresholds[2];
396 SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1); 396 SetRateControlThresholds(rc_thresholds, 0, 0, 20, 30, 10, 10, 0, 1);
397 SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0); 397 SetRateControlThresholds(rc_thresholds, 1, 0, 0, 30, 15, 10, 0, 0);
398 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 398 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings,
399 rc_metrics, nullptr /* visualization_params */); 399 rc_thresholds, nullptr /* visualization_params */);
400 } 400 }
401 } // namespace test 401 } // namespace test
402 } // namespace webrtc 402 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698