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