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

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

Issue 2695653002: Add support for creating HW codecs in VideoProcessor tests. (Closed)
Patch Set: Don't forget the mac! 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
« no previous file with comments | « webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 #include "webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest .h" 11 #include "webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest .h"
12 12
13 namespace webrtc { 13 namespace webrtc {
14 namespace test { 14 namespace test {
15 15
16 namespace {
17
18 // In these correctness tests, we only consider SW codecs.
19 const bool kHwCodec = false;
20
21 } // namespace
22
16 #if defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) 23 #if defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS)
17 24
18 // 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.
19 // Note(hbos): The PacketManipulatorImpl code used to simulate packet loss in 26 // Note(hbos): The PacketManipulatorImpl code used to simulate packet loss in
20 // 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
21 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have 28 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have
22 // not been added. 29 // not been added.
23 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { 30 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) {
24 // Bitrate and frame rate profile. 31 // Bitrate and frame rate profile.
25 RateProfile rate_profile; 32 RateProfile rate_profile;
26 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 33 SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
27 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 34 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
28 rate_profile.num_frames = kNumFramesShort; 35 rate_profile.num_frames = kNumFramesShort;
29 // Codec/network settings. 36 // Codec/network settings.
30 CodecConfigPars process_settings; 37 CodecConfigPars process_settings;
31 SetCodecParameters(&process_settings, kVideoCodecH264, 0.0f, -1, 1, false, 38 SetCodecParameters(&process_settings, kVideoCodecH264, kHwCodec, 0.0f, -1, 1,
32 false, true, false); 39 false, false, true, false);
33 // Metrics for expected quality. 40 // Metrics for expected quality.
34 QualityMetrics quality_metrics; 41 QualityMetrics quality_metrics;
35 SetQualityMetrics(&quality_metrics, 35.0, 25.0, 0.93, 0.70); 42 SetQualityMetrics(&quality_metrics, 35.0, 25.0, 0.93, 0.70);
36 // Metrics for rate control. 43 // Metrics for rate control.
37 RateControlMetrics rc_metrics[1]; 44 RateControlMetrics rc_metrics[1];
38 SetRateControlMetrics(rc_metrics, 0, 2, 60, 20, 10, 20, 0, 1); 45 SetRateControlMetrics(rc_metrics, 0, 2, 60, 20, 10, 20, 0, 1);
39 ProcessFramesAndVerify(quality_metrics, 46 ProcessFramesAndVerify(quality_metrics,
40 rate_profile, 47 rate_profile,
41 process_settings, 48 process_settings,
42 rc_metrics); 49 rc_metrics);
43 } 50 }
44 51
45 #endif // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) 52 #endif // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS)
46 53
47 // Fails on iOS. See webrtc:4755. 54 // Fails on iOS. See webrtc:4755.
48 #if !defined(WEBRTC_IOS) 55 #if !defined(WEBRTC_IOS)
49 56
50 #if !defined(RTC_DISABLE_VP9) 57 #if !defined(RTC_DISABLE_VP9)
51 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. 58 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high.
52 // One key frame (first frame only) in sequence. Setting |key_frame_interval| 59 // One key frame (first frame only) in sequence. Setting |key_frame_interval|
53 // to -1 below means no periodic key frames in test. 60 // to -1 below means no periodic key frames in test.
54 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { 61 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) {
55 // Bitrate and frame rate profile. 62 // Bitrate and frame rate profile.
56 RateProfile rate_profile; 63 RateProfile rate_profile;
57 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 64 SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
58 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 65 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
59 rate_profile.num_frames = kNumFramesShort; 66 rate_profile.num_frames = kNumFramesShort;
60 // Codec/network settings. 67 // Codec/network settings.
61 CodecConfigPars process_settings; 68 CodecConfigPars process_settings;
62 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, 69 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
63 false, true, false); 70 false, false, true, false);
64 // Metrics for expected quality. 71 // Metrics for expected quality.
65 QualityMetrics quality_metrics; 72 QualityMetrics quality_metrics;
66 SetQualityMetrics(&quality_metrics, 37.0, 36.0, 0.93, 0.92); 73 SetQualityMetrics(&quality_metrics, 37.0, 36.0, 0.93, 0.92);
67 // Metrics for rate control. 74 // Metrics for rate control.
68 RateControlMetrics rc_metrics[1]; 75 RateControlMetrics rc_metrics[1];
69 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); 76 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1);
70 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 77 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
71 rc_metrics); 78 rc_metrics);
72 } 79 }
73 80
74 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit 81 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit
75 // lower. One key frame (first frame only) in sequence. 82 // lower. One key frame (first frame only) in sequence.
76 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { 83 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) {
77 // Bitrate and frame rate profile. 84 // Bitrate and frame rate profile.
78 RateProfile rate_profile; 85 RateProfile rate_profile;
79 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 86 SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
80 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 87 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
81 rate_profile.num_frames = kNumFramesShort; 88 rate_profile.num_frames = kNumFramesShort;
82 // Codec/network settings. 89 // Codec/network settings.
83 CodecConfigPars process_settings; 90 CodecConfigPars process_settings;
84 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.05f, -1, 1, false, 91 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.05f, -1, 1,
85 false, true, false); 92 false, false, true, false);
86 // Metrics for expected quality. 93 // Metrics for expected quality.
87 QualityMetrics quality_metrics; 94 QualityMetrics quality_metrics;
88 SetQualityMetrics(&quality_metrics, 17.0, 14.0, 0.45, 0.36); 95 SetQualityMetrics(&quality_metrics, 17.0, 14.0, 0.45, 0.36);
89 // Metrics for rate control. 96 // Metrics for rate control.
90 RateControlMetrics rc_metrics[1]; 97 RateControlMetrics rc_metrics[1];
91 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); 98 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1);
92 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 99 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
93 rc_metrics); 100 rc_metrics);
94 } 101 }
95 102
96 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): 103 // VP9: Run with no packet loss, with varying bitrate (3 rate updates):
97 // low to high to medium. Check that quality and encoder response to the new 104 // low to high to medium. Check that quality and encoder response to the new
98 // target rate/per-frame bandwidth (for each rate update) is within limits. 105 // target rate/per-frame bandwidth (for each rate update) is within limits.
99 // One key frame (first frame only) in sequence. 106 // One key frame (first frame only) in sequence.
100 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { 107 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) {
101 // Bitrate and frame rate profile. 108 // Bitrate and frame rate profile.
102 RateProfile rate_profile; 109 RateProfile rate_profile;
103 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); 110 SetRateProfilePars(&rate_profile, 0, 200, 30, 0);
104 SetRateProfilePars(&rate_profile, 1, 700, 30, 100); 111 SetRateProfilePars(&rate_profile, 1, 700, 30, 100);
105 SetRateProfilePars(&rate_profile, 2, 500, 30, 200); 112 SetRateProfilePars(&rate_profile, 2, 500, 30, 200);
106 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; 113 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1;
107 rate_profile.num_frames = kNumFramesLong; 114 rate_profile.num_frames = kNumFramesLong;
108 // Codec/network settings. 115 // Codec/network settings.
109 CodecConfigPars process_settings; 116 CodecConfigPars process_settings;
110 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, 117 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
111 false, true, false); 118 false, false, true, false);
112 // Metrics for expected quality. 119 // Metrics for expected quality.
113 QualityMetrics quality_metrics; 120 QualityMetrics quality_metrics;
114 SetQualityMetrics(&quality_metrics, 35.5, 30.0, 0.90, 0.85); 121 SetQualityMetrics(&quality_metrics, 35.5, 30.0, 0.90, 0.85);
115 // Metrics for rate control. 122 // Metrics for rate control.
116 RateControlMetrics rc_metrics[3]; 123 RateControlMetrics rc_metrics[3];
117 SetRateControlMetrics(rc_metrics, 0, 0, 30, 20, 20, 30, 0, 1); 124 SetRateControlMetrics(rc_metrics, 0, 0, 30, 20, 20, 30, 0, 1);
118 SetRateControlMetrics(rc_metrics, 1, 2, 0, 20, 20, 60, 0, 0); 125 SetRateControlMetrics(rc_metrics, 1, 2, 0, 20, 20, 60, 0, 0);
119 SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 20, 40, 0, 0); 126 SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 20, 40, 0, 0);
120 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 127 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
121 rc_metrics); 128 rc_metrics);
(...skipping 11 matching lines...) Expand all
133 config_.networking_config.packet_loss_probability = 0; 140 config_.networking_config.packet_loss_probability = 0;
134 // Bitrate and frame rate profile. 141 // Bitrate and frame rate profile.
135 RateProfile rate_profile; 142 RateProfile rate_profile;
136 SetRateProfilePars(&rate_profile, 0, 100, 24, 0); 143 SetRateProfilePars(&rate_profile, 0, 100, 24, 0);
137 SetRateProfilePars(&rate_profile, 1, 100, 15, 100); 144 SetRateProfilePars(&rate_profile, 1, 100, 15, 100);
138 SetRateProfilePars(&rate_profile, 2, 100, 10, 200); 145 SetRateProfilePars(&rate_profile, 2, 100, 10, 200);
139 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; 146 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1;
140 rate_profile.num_frames = kNumFramesLong; 147 rate_profile.num_frames = kNumFramesLong;
141 // Codec/network settings. 148 // Codec/network settings.
142 CodecConfigPars process_settings; 149 CodecConfigPars process_settings;
143 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, 150 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
144 false, true, false); 151 false, false, true, false);
145 // Metrics for expected quality. 152 // Metrics for expected quality.
146 QualityMetrics quality_metrics; 153 QualityMetrics quality_metrics;
147 SetQualityMetrics(&quality_metrics, 31.5, 18.0, 0.80, 0.43); 154 SetQualityMetrics(&quality_metrics, 31.5, 18.0, 0.80, 0.43);
148 // Metrics for rate control. 155 // Metrics for rate control.
149 RateControlMetrics rc_metrics[3]; 156 RateControlMetrics rc_metrics[3];
150 SetRateControlMetrics(rc_metrics, 0, 38, 50, 75, 15, 45, 0, 1); 157 SetRateControlMetrics(rc_metrics, 0, 38, 50, 75, 15, 45, 0, 1);
151 SetRateControlMetrics(rc_metrics, 1, 10, 0, 40, 10, 30, 0, 0); 158 SetRateControlMetrics(rc_metrics, 1, 10, 0, 40, 10, 30, 0, 0);
152 SetRateControlMetrics(rc_metrics, 2, 5, 0, 30, 5, 20, 0, 0); 159 SetRateControlMetrics(rc_metrics, 2, 5, 0, 30, 5, 20, 0, 0);
153 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 160 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
154 rc_metrics); 161 rc_metrics);
155 } 162 }
156 163
157 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). 164 // VP9: Run with no packet loss and denoiser on. One key frame (first frame).
158 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { 165 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) {
159 // Bitrate and frame rate profile. 166 // Bitrate and frame rate profile.
160 RateProfile rate_profile; 167 RateProfile rate_profile;
161 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 168 SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
162 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 169 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
163 rate_profile.num_frames = kNumFramesShort; 170 rate_profile.num_frames = kNumFramesShort;
164 // Codec/network settings. 171 // Codec/network settings.
165 CodecConfigPars process_settings; 172 CodecConfigPars process_settings;
166 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, 173 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
167 true, true, false); 174 false, true, true, false);
168 // Metrics for expected quality. 175 // Metrics for expected quality.
169 QualityMetrics quality_metrics; 176 QualityMetrics quality_metrics;
170 SetQualityMetrics(&quality_metrics, 36.8, 35.8, 0.92, 0.91); 177 SetQualityMetrics(&quality_metrics, 36.8, 35.8, 0.92, 0.91);
171 // Metrics for rate control. 178 // Metrics for rate control.
172 RateControlMetrics rc_metrics[1]; 179 RateControlMetrics rc_metrics[1];
173 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); 180 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1);
174 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 181 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
175 rc_metrics); 182 rc_metrics);
176 } 183 }
177 184
178 // Run with no packet loss, at low bitrate. 185 // Run with no packet loss, at low bitrate.
179 // spatial_resize is on, for this low bitrate expect one resize in sequence. 186 // spatial_resize is on, for this low bitrate expect one resize in sequence.
180 // Resize happens on delta frame. Expect only one key frame (first frame). 187 // Resize happens on delta frame. Expect only one key frame (first frame).
181 TEST_F(VideoProcessorIntegrationTest, 188 TEST_F(VideoProcessorIntegrationTest,
182 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { 189 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) {
183 config_.networking_config.packet_loss_probability = 0; 190 config_.networking_config.packet_loss_probability = 0;
184 // Bitrate and frame rate profile. 191 // Bitrate and frame rate profile.
185 RateProfile rate_profile; 192 RateProfile rate_profile;
186 SetRateProfilePars(&rate_profile, 0, 50, 30, 0); 193 SetRateProfilePars(&rate_profile, 0, 50, 30, 0);
187 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; 194 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1;
188 rate_profile.num_frames = kNumFramesLong; 195 rate_profile.num_frames = kNumFramesLong;
189 // Codec/network settings. 196 // Codec/network settings.
190 CodecConfigPars process_settings; 197 CodecConfigPars process_settings;
191 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, 198 SetCodecParameters(&process_settings, kVideoCodecVP9, kHwCodec, 0.0f, -1, 1,
192 false, true, true); 199 false, false, true, true);
193 // Metrics for expected quality. 200 // Metrics for expected quality.
194 QualityMetrics quality_metrics; 201 QualityMetrics quality_metrics;
195 SetQualityMetrics(&quality_metrics, 24.0, 13.0, 0.65, 0.37); 202 SetQualityMetrics(&quality_metrics, 24.0, 13.0, 0.65, 0.37);
196 // Metrics for rate control. 203 // Metrics for rate control.
197 RateControlMetrics rc_metrics[1]; 204 RateControlMetrics rc_metrics[1];
198 SetRateControlMetrics(rc_metrics, 0, 228, 70, 160, 15, 80, 1, 1); 205 SetRateControlMetrics(rc_metrics, 0, 228, 70, 160, 15, 80, 1, 1);
199 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 206 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
200 rc_metrics); 207 rc_metrics);
201 } 208 }
202 209
203 // TODO(marpan): Add temporal layer test for VP9, once changes are in 210 // TODO(marpan): Add temporal layer test for VP9, once changes are in
204 // vp9 wrapper for this. 211 // vp9 wrapper for this.
205 212
206 #endif // !defined(RTC_DISABLE_VP9) 213 #endif // !defined(RTC_DISABLE_VP9)
207 214
208 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. 215 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high.
209 // One key frame (first frame only) in sequence. Setting |key_frame_interval| 216 // One key frame (first frame only) in sequence. Setting |key_frame_interval|
210 // to -1 below means no periodic key frames in test. 217 // to -1 below means no periodic key frames in test.
211 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { 218 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) {
212 // Bitrate and frame rate profile. 219 // Bitrate and frame rate profile.
213 RateProfile rate_profile; 220 RateProfile rate_profile;
214 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 221 SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
215 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 222 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
216 rate_profile.num_frames = kNumFramesShort; 223 rate_profile.num_frames = kNumFramesShort;
217 // Codec/network settings. 224 // Codec/network settings.
218 CodecConfigPars process_settings; 225 CodecConfigPars process_settings;
219 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.0f, -1, 1, false, 226 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 1,
220 true, true, false); 227 false, true, true, false);
221 // Metrics for expected quality. 228 // Metrics for expected quality.
222 QualityMetrics quality_metrics; 229 QualityMetrics quality_metrics;
223 SetQualityMetrics(&quality_metrics, 34.95, 33.0, 0.90, 0.89); 230 SetQualityMetrics(&quality_metrics, 34.95, 33.0, 0.90, 0.89);
224 // Metrics for rate control. 231 // Metrics for rate control.
225 RateControlMetrics rc_metrics[1]; 232 RateControlMetrics rc_metrics[1];
226 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); 233 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1);
227 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 234 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
228 rc_metrics); 235 rc_metrics);
229 } 236 }
230 237
231 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit 238 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit
232 // lower. One key frame (first frame only) in sequence. 239 // lower. One key frame (first frame only) in sequence.
233 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { 240 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) {
234 // Bitrate and frame rate profile. 241 // Bitrate and frame rate profile.
235 RateProfile rate_profile; 242 RateProfile rate_profile;
236 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 243 SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
237 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 244 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
238 rate_profile.num_frames = kNumFramesShort; 245 rate_profile.num_frames = kNumFramesShort;
239 // Codec/network settings. 246 // Codec/network settings.
240 CodecConfigPars process_settings; 247 CodecConfigPars process_settings;
241 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.05f, -1, 1, false, 248 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.05f, -1, 1,
242 true, true, false); 249 false, true, true, false);
243 // Metrics for expected quality. 250 // Metrics for expected quality.
244 QualityMetrics quality_metrics; 251 QualityMetrics quality_metrics;
245 SetQualityMetrics(&quality_metrics, 20.0, 16.0, 0.60, 0.40); 252 SetQualityMetrics(&quality_metrics, 20.0, 16.0, 0.60, 0.40);
246 // Metrics for rate control. 253 // Metrics for rate control.
247 RateControlMetrics rc_metrics[1]; 254 RateControlMetrics rc_metrics[1];
248 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); 255 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1);
249 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 256 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
250 rc_metrics); 257 rc_metrics);
251 } 258 }
252 259
253 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. 260 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower.
254 // One key frame (first frame only) in sequence. 261 // One key frame (first frame only) in sequence.
255 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { 262 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) {
256 // Bitrate and frame rate profile. 263 // Bitrate and frame rate profile.
257 RateProfile rate_profile; 264 RateProfile rate_profile;
258 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); 265 SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
259 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; 266 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1;
260 rate_profile.num_frames = kNumFramesShort; 267 rate_profile.num_frames = kNumFramesShort;
261 // Codec/network settings. 268 // Codec/network settings.
262 CodecConfigPars process_settings; 269 CodecConfigPars process_settings;
263 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.1f, -1, 1, false, 270 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.1f, -1, 1,
264 true, true, false); 271 false, true, true, false);
265 // Metrics for expected quality. 272 // Metrics for expected quality.
266 QualityMetrics quality_metrics; 273 QualityMetrics quality_metrics;
267 SetQualityMetrics(&quality_metrics, 19.0, 16.0, 0.50, 0.35); 274 SetQualityMetrics(&quality_metrics, 19.0, 16.0, 0.50, 0.35);
268 // Metrics for rate control. 275 // Metrics for rate control.
269 RateControlMetrics rc_metrics[1]; 276 RateControlMetrics rc_metrics[1];
270 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); 277 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1);
271 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 278 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
272 rc_metrics); 279 rc_metrics);
273 } 280 }
274 281
(...skipping 22 matching lines...) Expand all
297 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) { 304 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) {
298 // Bitrate and frame rate profile. 305 // Bitrate and frame rate profile.
299 RateProfile rate_profile; 306 RateProfile rate_profile;
300 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); 307 SetRateProfilePars(&rate_profile, 0, 200, 30, 0);
301 SetRateProfilePars(&rate_profile, 1, 800, 30, 100); 308 SetRateProfilePars(&rate_profile, 1, 800, 30, 100);
302 SetRateProfilePars(&rate_profile, 2, 500, 30, 200); 309 SetRateProfilePars(&rate_profile, 2, 500, 30, 200);
303 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; 310 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1;
304 rate_profile.num_frames = kNumFramesLong; 311 rate_profile.num_frames = kNumFramesLong;
305 // Codec/network settings. 312 // Codec/network settings.
306 CodecConfigPars process_settings; 313 CodecConfigPars process_settings;
307 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.0f, -1, 1, false, 314 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 1,
308 true, true, false); 315 false, true, true, false);
309 // Metrics for expected quality. 316 // Metrics for expected quality.
310 QualityMetrics quality_metrics; 317 QualityMetrics quality_metrics;
311 SetQualityMetrics(&quality_metrics, 34.0, 32.0, 0.85, 0.80); 318 SetQualityMetrics(&quality_metrics, 34.0, 32.0, 0.85, 0.80);
312 // Metrics for rate control. 319 // Metrics for rate control.
313 RateControlMetrics rc_metrics[3]; 320 RateControlMetrics rc_metrics[3];
314 SetRateControlMetrics(rc_metrics, 0, 0, 45, 20, 10, 15, 0, 1); 321 SetRateControlMetrics(rc_metrics, 0, 0, 45, 20, 10, 15, 0, 1);
315 SetRateControlMetrics(rc_metrics, 1, 0, 0, 25, 20, 10, 0, 0); 322 SetRateControlMetrics(rc_metrics, 1, 0, 0, 25, 20, 10, 0, 0);
316 SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 15, 10, 0, 0); 323 SetRateControlMetrics(rc_metrics, 2, 0, 0, 25, 15, 10, 0, 0);
317 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 324 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
318 rc_metrics); 325 rc_metrics);
(...skipping 19 matching lines...) Expand all
338 config_.networking_config.packet_loss_probability = 0; 345 config_.networking_config.packet_loss_probability = 0;
339 // Bitrate and frame rate profile. 346 // Bitrate and frame rate profile.
340 RateProfile rate_profile; 347 RateProfile rate_profile;
341 SetRateProfilePars(&rate_profile, 0, 80, 24, 0); 348 SetRateProfilePars(&rate_profile, 0, 80, 24, 0);
342 SetRateProfilePars(&rate_profile, 1, 80, 15, 100); 349 SetRateProfilePars(&rate_profile, 1, 80, 15, 100);
343 SetRateProfilePars(&rate_profile, 2, 80, 10, 200); 350 SetRateProfilePars(&rate_profile, 2, 80, 10, 200);
344 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; 351 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1;
345 rate_profile.num_frames = kNumFramesLong; 352 rate_profile.num_frames = kNumFramesLong;
346 // Codec/network settings. 353 // Codec/network settings.
347 CodecConfigPars process_settings; 354 CodecConfigPars process_settings;
348 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.0f, -1, 1, false, 355 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 1,
349 true, true, false); 356 false, true, true, false);
350 // Metrics for expected quality. 357 // Metrics for expected quality.
351 QualityMetrics quality_metrics; 358 QualityMetrics quality_metrics;
352 SetQualityMetrics(&quality_metrics, 31.0, 22.0, 0.80, 0.65); 359 SetQualityMetrics(&quality_metrics, 31.0, 22.0, 0.80, 0.65);
353 // Metrics for rate control. 360 // Metrics for rate control.
354 RateControlMetrics rc_metrics[3]; 361 RateControlMetrics rc_metrics[3];
355 SetRateControlMetrics(rc_metrics, 0, 40, 20, 75, 15, 60, 0, 1); 362 SetRateControlMetrics(rc_metrics, 0, 40, 20, 75, 15, 60, 0, 1);
356 SetRateControlMetrics(rc_metrics, 1, 10, 0, 25, 10, 35, 0, 0); 363 SetRateControlMetrics(rc_metrics, 1, 10, 0, 25, 10, 35, 0, 0);
357 SetRateControlMetrics(rc_metrics, 2, 0, 0, 20, 10, 15, 0, 0); 364 SetRateControlMetrics(rc_metrics, 2, 0, 0, 20, 10, 15, 0, 0);
358 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 365 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
359 rc_metrics); 366 rc_metrics);
(...skipping 14 matching lines...) Expand all
374 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { 381 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) {
375 config_.networking_config.packet_loss_probability = 0; 382 config_.networking_config.packet_loss_probability = 0;
376 // Bitrate and frame rate profile. 383 // Bitrate and frame rate profile.
377 RateProfile rate_profile; 384 RateProfile rate_profile;
378 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); 385 SetRateProfilePars(&rate_profile, 0, 200, 30, 0);
379 SetRateProfilePars(&rate_profile, 1, 400, 30, 150); 386 SetRateProfilePars(&rate_profile, 1, 400, 30, 150);
380 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; 387 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1;
381 rate_profile.num_frames = kNumFramesLong; 388 rate_profile.num_frames = kNumFramesLong;
382 // Codec/network settings. 389 // Codec/network settings.
383 CodecConfigPars process_settings; 390 CodecConfigPars process_settings;
384 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.0f, -1, 3, false, 391 SetCodecParameters(&process_settings, kVideoCodecVP8, kHwCodec, 0.0f, -1, 3,
385 true, true, false); 392 false, true, true, false);
386 // Metrics for expected quality. 393 // Metrics for expected quality.
387 QualityMetrics quality_metrics; 394 QualityMetrics quality_metrics;
388 SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80); 395 SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80);
389 // Metrics for rate control. 396 // Metrics for rate control.
390 RateControlMetrics rc_metrics[2]; 397 RateControlMetrics rc_metrics[2];
391 SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1); 398 SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1);
392 SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0); 399 SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0);
393 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, 400 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings,
394 rc_metrics); 401 rc_metrics);
395 } 402 }
396 } // namespace test 403 } // namespace test
397 } // namespace webrtc 404 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698