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 #if defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) | 16 #if defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) |
17 | 17 |
18 // H264: Run with no packet loss and fixed bitrate. Quality should be very high. | 18 // 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 | 19 // 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 | 20 // these unittests appears to drop "packets" in a way that is not compatible |
21 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have | 21 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have |
22 // not been added. | 22 // not been added. |
23 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { | 23 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { |
24 // Bitrate and frame rate profile. | 24 // Bitrate and frame rate profile. |
25 RateProfile rate_profile; | 25 RateProfile rate_profile; |
26 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 26 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
27 rate_profile.frame_index_rate_update[1] = kNbrFramesShort + 1; | 27 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
28 rate_profile.num_frames = kNbrFramesShort; | 28 rate_profile.num_frames = kNumFramesShort; |
29 // Codec/network settings. | 29 // Codec/network settings. |
30 CodecConfigPars process_settings; | 30 CodecConfigPars process_settings; |
31 SetCodecParameters(&process_settings, kVideoCodecH264, 0.0f, -1, 1, false, | 31 SetCodecParameters(&process_settings, kVideoCodecH264, 0.0f, -1, 1, false, |
32 false, true, false); | 32 false, true, false); |
33 // Metrics for expected quality. | 33 // Metrics for expected quality. |
34 QualityMetrics quality_metrics; | 34 QualityMetrics quality_metrics; |
35 SetQualityMetrics(&quality_metrics, 35.0, 25.0, 0.93, 0.70); | 35 SetQualityMetrics(&quality_metrics, 35.0, 25.0, 0.93, 0.70); |
36 // Metrics for rate control. | 36 // Metrics for rate control. |
37 RateControlMetrics rc_metrics[1]; | 37 RateControlMetrics rc_metrics[1]; |
38 SetRateControlMetrics(rc_metrics, 0, 2, 60, 20, 10, 20, 0, 1); | 38 SetRateControlMetrics(rc_metrics, 0, 2, 60, 20, 10, 20, 0, 1); |
39 ProcessFramesAndVerify(quality_metrics, | 39 ProcessFramesAndVerify(quality_metrics, |
40 rate_profile, | 40 rate_profile, |
41 process_settings, | 41 process_settings, |
42 rc_metrics); | 42 rc_metrics); |
43 } | 43 } |
44 | 44 |
45 #endif // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) | 45 #endif // defined(WEBRTC_VIDEOPROCESSOR_H264_TESTS) |
46 | 46 |
47 // Fails on iOS. See webrtc:4755. | 47 // Fails on iOS. See webrtc:4755. |
48 #if !defined(WEBRTC_IOS) | 48 #if !defined(WEBRTC_IOS) |
49 | 49 |
50 #if !defined(RTC_DISABLE_VP9) | 50 #if !defined(RTC_DISABLE_VP9) |
51 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. | 51 // 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| | 52 // One key frame (first frame only) in sequence. Setting |key_frame_interval| |
53 // to -1 below means no periodic key frames in test. | 53 // to -1 below means no periodic key frames in test. |
54 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { | 54 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { |
55 // Bitrate and frame rate profile. | 55 // Bitrate and frame rate profile. |
56 RateProfile rate_profile; | 56 RateProfile rate_profile; |
57 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 57 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
58 rate_profile.frame_index_rate_update[1] = kNbrFramesShort + 1; | 58 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
59 rate_profile.num_frames = kNbrFramesShort; | 59 rate_profile.num_frames = kNumFramesShort; |
60 // Codec/network settings. | 60 // Codec/network settings. |
61 CodecConfigPars process_settings; | 61 CodecConfigPars process_settings; |
62 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, | 62 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, |
63 false, true, false); | 63 false, true, false); |
64 // Metrics for expected quality. | 64 // Metrics for expected quality. |
65 QualityMetrics quality_metrics; | 65 QualityMetrics quality_metrics; |
66 SetQualityMetrics(&quality_metrics, 37.0, 36.0, 0.93, 0.92); | 66 SetQualityMetrics(&quality_metrics, 37.0, 36.0, 0.93, 0.92); |
67 // Metrics for rate control. | 67 // Metrics for rate control. |
68 RateControlMetrics rc_metrics[1]; | 68 RateControlMetrics rc_metrics[1]; |
69 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); | 69 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); |
70 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 70 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
71 rc_metrics); | 71 rc_metrics); |
72 } | 72 } |
73 | 73 |
74 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit | 74 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit |
75 // lower. One key frame (first frame only) in sequence. | 75 // lower. One key frame (first frame only) in sequence. |
76 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { | 76 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { |
77 // Bitrate and frame rate profile. | 77 // Bitrate and frame rate profile. |
78 RateProfile rate_profile; | 78 RateProfile rate_profile; |
79 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 79 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
80 rate_profile.frame_index_rate_update[1] = kNbrFramesShort + 1; | 80 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
81 rate_profile.num_frames = kNbrFramesShort; | 81 rate_profile.num_frames = kNumFramesShort; |
82 // Codec/network settings. | 82 // Codec/network settings. |
83 CodecConfigPars process_settings; | 83 CodecConfigPars process_settings; |
84 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.05f, -1, 1, false, | 84 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.05f, -1, 1, false, |
85 false, true, false); | 85 false, true, false); |
86 // Metrics for expected quality. | 86 // Metrics for expected quality. |
87 QualityMetrics quality_metrics; | 87 QualityMetrics quality_metrics; |
88 SetQualityMetrics(&quality_metrics, 17.0, 14.0, 0.45, 0.36); | 88 SetQualityMetrics(&quality_metrics, 17.0, 14.0, 0.45, 0.36); |
89 // Metrics for rate control. | 89 // Metrics for rate control. |
90 RateControlMetrics rc_metrics[1]; | 90 RateControlMetrics rc_metrics[1]; |
91 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); | 91 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); |
92 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 92 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
93 rc_metrics); | 93 rc_metrics); |
94 } | 94 } |
95 | 95 |
96 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): | 96 // 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 | 97 // 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. | 98 // target rate/per-frame bandwidth (for each rate update) is within limits. |
99 // One key frame (first frame only) in sequence. | 99 // One key frame (first frame only) in sequence. |
100 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { | 100 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { |
101 // Bitrate and frame rate profile. | 101 // Bitrate and frame rate profile. |
102 RateProfile rate_profile; | 102 RateProfile rate_profile; |
103 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); | 103 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); |
104 SetRateProfilePars(&rate_profile, 1, 700, 30, 100); | 104 SetRateProfilePars(&rate_profile, 1, 700, 30, 100); |
105 SetRateProfilePars(&rate_profile, 2, 500, 30, 200); | 105 SetRateProfilePars(&rate_profile, 2, 500, 30, 200); |
106 rate_profile.frame_index_rate_update[3] = kNbrFramesLong + 1; | 106 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
107 rate_profile.num_frames = kNbrFramesLong; | 107 rate_profile.num_frames = kNumFramesLong; |
108 // Codec/network settings. | 108 // Codec/network settings. |
109 CodecConfigPars process_settings; | 109 CodecConfigPars process_settings; |
110 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, | 110 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, |
111 false, true, false); | 111 false, true, false); |
112 // Metrics for expected quality. | 112 // Metrics for expected quality. |
113 QualityMetrics quality_metrics; | 113 QualityMetrics quality_metrics; |
114 SetQualityMetrics(&quality_metrics, 35.5, 30.0, 0.90, 0.85); | 114 SetQualityMetrics(&quality_metrics, 35.5, 30.0, 0.90, 0.85); |
115 // Metrics for rate control. | 115 // Metrics for rate control. |
116 RateControlMetrics rc_metrics[3]; | 116 RateControlMetrics rc_metrics[3]; |
117 SetRateControlMetrics(rc_metrics, 0, 0, 30, 20, 20, 30, 0, 1); | 117 SetRateControlMetrics(rc_metrics, 0, 0, 30, 20, 20, 30, 0, 1); |
(...skipping 11 matching lines...) Expand all Loading... |
129 // Note: quality after update should be higher but we currently compute quality | 129 // Note: quality after update should be higher but we currently compute quality |
130 // metrics averaged over whole sequence run. | 130 // metrics averaged over whole sequence run. |
131 TEST_F(VideoProcessorIntegrationTest, | 131 TEST_F(VideoProcessorIntegrationTest, |
132 ProcessNoLossChangeFrameRateFrameDropVP9) { | 132 ProcessNoLossChangeFrameRateFrameDropVP9) { |
133 config_.networking_config.packet_loss_probability = 0; | 133 config_.networking_config.packet_loss_probability = 0; |
134 // Bitrate and frame rate profile. | 134 // Bitrate and frame rate profile. |
135 RateProfile rate_profile; | 135 RateProfile rate_profile; |
136 SetRateProfilePars(&rate_profile, 0, 100, 24, 0); | 136 SetRateProfilePars(&rate_profile, 0, 100, 24, 0); |
137 SetRateProfilePars(&rate_profile, 1, 100, 15, 100); | 137 SetRateProfilePars(&rate_profile, 1, 100, 15, 100); |
138 SetRateProfilePars(&rate_profile, 2, 100, 10, 200); | 138 SetRateProfilePars(&rate_profile, 2, 100, 10, 200); |
139 rate_profile.frame_index_rate_update[3] = kNbrFramesLong + 1; | 139 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
140 rate_profile.num_frames = kNbrFramesLong; | 140 rate_profile.num_frames = kNumFramesLong; |
141 // Codec/network settings. | 141 // Codec/network settings. |
142 CodecConfigPars process_settings; | 142 CodecConfigPars process_settings; |
143 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, | 143 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, |
144 false, true, false); | 144 false, true, false); |
145 // Metrics for expected quality. | 145 // Metrics for expected quality. |
146 QualityMetrics quality_metrics; | 146 QualityMetrics quality_metrics; |
147 SetQualityMetrics(&quality_metrics, 31.5, 18.0, 0.80, 0.43); | 147 SetQualityMetrics(&quality_metrics, 31.5, 18.0, 0.80, 0.43); |
148 // Metrics for rate control. | 148 // Metrics for rate control. |
149 RateControlMetrics rc_metrics[3]; | 149 RateControlMetrics rc_metrics[3]; |
150 SetRateControlMetrics(rc_metrics, 0, 38, 50, 75, 15, 45, 0, 1); | 150 SetRateControlMetrics(rc_metrics, 0, 38, 50, 75, 15, 45, 0, 1); |
151 SetRateControlMetrics(rc_metrics, 1, 10, 0, 40, 10, 30, 0, 0); | 151 SetRateControlMetrics(rc_metrics, 1, 10, 0, 40, 10, 30, 0, 0); |
152 SetRateControlMetrics(rc_metrics, 2, 5, 0, 30, 5, 20, 0, 0); | 152 SetRateControlMetrics(rc_metrics, 2, 5, 0, 30, 5, 20, 0, 0); |
153 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 153 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
154 rc_metrics); | 154 rc_metrics); |
155 } | 155 } |
156 | 156 |
157 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). | 157 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). |
158 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { | 158 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { |
159 // Bitrate and frame rate profile. | 159 // Bitrate and frame rate profile. |
160 RateProfile rate_profile; | 160 RateProfile rate_profile; |
161 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 161 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
162 rate_profile.frame_index_rate_update[1] = kNbrFramesShort + 1; | 162 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
163 rate_profile.num_frames = kNbrFramesShort; | 163 rate_profile.num_frames = kNumFramesShort; |
164 // Codec/network settings. | 164 // Codec/network settings. |
165 CodecConfigPars process_settings; | 165 CodecConfigPars process_settings; |
166 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, | 166 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, |
167 true, true, false); | 167 true, true, false); |
168 // Metrics for expected quality. | 168 // Metrics for expected quality. |
169 QualityMetrics quality_metrics; | 169 QualityMetrics quality_metrics; |
170 SetQualityMetrics(&quality_metrics, 36.8, 35.8, 0.92, 0.91); | 170 SetQualityMetrics(&quality_metrics, 36.8, 35.8, 0.92, 0.91); |
171 // Metrics for rate control. | 171 // Metrics for rate control. |
172 RateControlMetrics rc_metrics[1]; | 172 RateControlMetrics rc_metrics[1]; |
173 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); | 173 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 20, 0, 1); |
174 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 174 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
175 rc_metrics); | 175 rc_metrics); |
176 } | 176 } |
177 | 177 |
178 // Run with no packet loss, at low bitrate. | 178 // Run with no packet loss, at low bitrate. |
179 // spatial_resize is on, for this low bitrate expect one resize in sequence. | 179 // 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). | 180 // Resize happens on delta frame. Expect only one key frame (first frame). |
181 TEST_F(VideoProcessorIntegrationTest, | 181 TEST_F(VideoProcessorIntegrationTest, |
182 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { | 182 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { |
183 config_.networking_config.packet_loss_probability = 0; | 183 config_.networking_config.packet_loss_probability = 0; |
184 // Bitrate and frame rate profile. | 184 // Bitrate and frame rate profile. |
185 RateProfile rate_profile; | 185 RateProfile rate_profile; |
186 SetRateProfilePars(&rate_profile, 0, 50, 30, 0); | 186 SetRateProfilePars(&rate_profile, 0, 50, 30, 0); |
187 rate_profile.frame_index_rate_update[1] = kNbrFramesLong + 1; | 187 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; |
188 rate_profile.num_frames = kNbrFramesLong; | 188 rate_profile.num_frames = kNumFramesLong; |
189 // Codec/network settings. | 189 // Codec/network settings. |
190 CodecConfigPars process_settings; | 190 CodecConfigPars process_settings; |
191 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, | 191 SetCodecParameters(&process_settings, kVideoCodecVP9, 0.0f, -1, 1, false, |
192 false, true, true); | 192 false, true, true); |
193 // Metrics for expected quality. | 193 // Metrics for expected quality. |
194 QualityMetrics quality_metrics; | 194 QualityMetrics quality_metrics; |
195 SetQualityMetrics(&quality_metrics, 24.0, 13.0, 0.65, 0.37); | 195 SetQualityMetrics(&quality_metrics, 24.0, 13.0, 0.65, 0.37); |
196 // Metrics for rate control. | 196 // Metrics for rate control. |
197 RateControlMetrics rc_metrics[1]; | 197 RateControlMetrics rc_metrics[1]; |
198 SetRateControlMetrics(rc_metrics, 0, 228, 70, 160, 15, 80, 1, 1); | 198 SetRateControlMetrics(rc_metrics, 0, 228, 70, 160, 15, 80, 1, 1); |
199 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 199 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
200 rc_metrics); | 200 rc_metrics); |
201 } | 201 } |
202 | 202 |
203 // TODO(marpan): Add temporal layer test for VP9, once changes are in | 203 // TODO(marpan): Add temporal layer test for VP9, once changes are in |
204 // vp9 wrapper for this. | 204 // vp9 wrapper for this. |
205 | 205 |
206 #endif // !defined(RTC_DISABLE_VP9) | 206 #endif // !defined(RTC_DISABLE_VP9) |
207 | 207 |
208 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. | 208 // 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| | 209 // One key frame (first frame only) in sequence. Setting |key_frame_interval| |
210 // to -1 below means no periodic key frames in test. | 210 // to -1 below means no periodic key frames in test. |
211 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { | 211 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { |
212 // Bitrate and frame rate profile. | 212 // Bitrate and frame rate profile. |
213 RateProfile rate_profile; | 213 RateProfile rate_profile; |
214 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 214 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
215 rate_profile.frame_index_rate_update[1] = kNbrFramesShort + 1; | 215 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
216 rate_profile.num_frames = kNbrFramesShort; | 216 rate_profile.num_frames = kNumFramesShort; |
217 // Codec/network settings. | 217 // Codec/network settings. |
218 CodecConfigPars process_settings; | 218 CodecConfigPars process_settings; |
219 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.0f, -1, 1, false, | 219 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.0f, -1, 1, false, |
220 true, true, false); | 220 true, true, false); |
221 // Metrics for expected quality. | 221 // Metrics for expected quality. |
222 QualityMetrics quality_metrics; | 222 QualityMetrics quality_metrics; |
223 SetQualityMetrics(&quality_metrics, 34.95, 33.0, 0.90, 0.89); | 223 SetQualityMetrics(&quality_metrics, 34.95, 33.0, 0.90, 0.89); |
224 // Metrics for rate control. | 224 // Metrics for rate control. |
225 RateControlMetrics rc_metrics[1]; | 225 RateControlMetrics rc_metrics[1]; |
226 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); | 226 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); |
227 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 227 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
228 rc_metrics); | 228 rc_metrics); |
229 } | 229 } |
230 | 230 |
231 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit | 231 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit |
232 // lower. One key frame (first frame only) in sequence. | 232 // lower. One key frame (first frame only) in sequence. |
233 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { | 233 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { |
234 // Bitrate and frame rate profile. | 234 // Bitrate and frame rate profile. |
235 RateProfile rate_profile; | 235 RateProfile rate_profile; |
236 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 236 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
237 rate_profile.frame_index_rate_update[1] = kNbrFramesShort + 1; | 237 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
238 rate_profile.num_frames = kNbrFramesShort; | 238 rate_profile.num_frames = kNumFramesShort; |
239 // Codec/network settings. | 239 // Codec/network settings. |
240 CodecConfigPars process_settings; | 240 CodecConfigPars process_settings; |
241 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.05f, -1, 1, false, | 241 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.05f, -1, 1, false, |
242 true, true, false); | 242 true, true, false); |
243 // Metrics for expected quality. | 243 // Metrics for expected quality. |
244 QualityMetrics quality_metrics; | 244 QualityMetrics quality_metrics; |
245 SetQualityMetrics(&quality_metrics, 20.0, 16.0, 0.60, 0.40); | 245 SetQualityMetrics(&quality_metrics, 20.0, 16.0, 0.60, 0.40); |
246 // Metrics for rate control. | 246 // Metrics for rate control. |
247 RateControlMetrics rc_metrics[1]; | 247 RateControlMetrics rc_metrics[1]; |
248 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); | 248 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); |
249 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 249 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
250 rc_metrics); | 250 rc_metrics); |
251 } | 251 } |
252 | 252 |
253 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. | 253 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. |
254 // One key frame (first frame only) in sequence. | 254 // One key frame (first frame only) in sequence. |
255 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { | 255 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { |
256 // Bitrate and frame rate profile. | 256 // Bitrate and frame rate profile. |
257 RateProfile rate_profile; | 257 RateProfile rate_profile; |
258 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); | 258 SetRateProfilePars(&rate_profile, 0, 500, 30, 0); |
259 rate_profile.frame_index_rate_update[1] = kNbrFramesShort + 1; | 259 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
260 rate_profile.num_frames = kNbrFramesShort; | 260 rate_profile.num_frames = kNumFramesShort; |
261 // Codec/network settings. | 261 // Codec/network settings. |
262 CodecConfigPars process_settings; | 262 CodecConfigPars process_settings; |
263 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.1f, -1, 1, false, | 263 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.1f, -1, 1, false, |
264 true, true, false); | 264 true, true, false); |
265 // Metrics for expected quality. | 265 // Metrics for expected quality. |
266 QualityMetrics quality_metrics; | 266 QualityMetrics quality_metrics; |
267 SetQualityMetrics(&quality_metrics, 19.0, 16.0, 0.50, 0.35); | 267 SetQualityMetrics(&quality_metrics, 19.0, 16.0, 0.50, 0.35); |
268 // Metrics for rate control. | 268 // Metrics for rate control. |
269 RateControlMetrics rc_metrics[1]; | 269 RateControlMetrics rc_metrics[1]; |
270 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); | 270 SetRateControlMetrics(rc_metrics, 0, 0, 40, 20, 10, 15, 0, 1); |
(...skipping 22 matching lines...) Expand all Loading... |
293 DISABLED_ProcessNoLossChangeBitRateVP8 | 293 DISABLED_ProcessNoLossChangeBitRateVP8 |
294 #else | 294 #else |
295 #define MAYBE_ProcessNoLossChangeBitRateVP8 ProcessNoLossChangeBitRateVP8 | 295 #define MAYBE_ProcessNoLossChangeBitRateVP8 ProcessNoLossChangeBitRateVP8 |
296 #endif | 296 #endif |
297 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) { | 297 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) { |
298 // Bitrate and frame rate profile. | 298 // Bitrate and frame rate profile. |
299 RateProfile rate_profile; | 299 RateProfile rate_profile; |
300 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); | 300 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); |
301 SetRateProfilePars(&rate_profile, 1, 800, 30, 100); | 301 SetRateProfilePars(&rate_profile, 1, 800, 30, 100); |
302 SetRateProfilePars(&rate_profile, 2, 500, 30, 200); | 302 SetRateProfilePars(&rate_profile, 2, 500, 30, 200); |
303 rate_profile.frame_index_rate_update[3] = kNbrFramesLong + 1; | 303 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
304 rate_profile.num_frames = kNbrFramesLong; | 304 rate_profile.num_frames = kNumFramesLong; |
305 // Codec/network settings. | 305 // Codec/network settings. |
306 CodecConfigPars process_settings; | 306 CodecConfigPars process_settings; |
307 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.0f, -1, 1, false, | 307 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.0f, -1, 1, false, |
308 true, true, false); | 308 true, true, false); |
309 // Metrics for expected quality. | 309 // Metrics for expected quality. |
310 QualityMetrics quality_metrics; | 310 QualityMetrics quality_metrics; |
311 SetQualityMetrics(&quality_metrics, 34.0, 32.0, 0.85, 0.80); | 311 SetQualityMetrics(&quality_metrics, 34.0, 32.0, 0.85, 0.80); |
312 // Metrics for rate control. | 312 // Metrics for rate control. |
313 RateControlMetrics rc_metrics[3]; | 313 RateControlMetrics rc_metrics[3]; |
314 SetRateControlMetrics(rc_metrics, 0, 0, 45, 20, 10, 15, 0, 1); | 314 SetRateControlMetrics(rc_metrics, 0, 0, 45, 20, 10, 15, 0, 1); |
(...skipping 19 matching lines...) Expand all Loading... |
334 ProcessNoLossChangeFrameRateFrameDropVP8 | 334 ProcessNoLossChangeFrameRateFrameDropVP8 |
335 #endif | 335 #endif |
336 TEST_F(VideoProcessorIntegrationTest, | 336 TEST_F(VideoProcessorIntegrationTest, |
337 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) { | 337 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) { |
338 config_.networking_config.packet_loss_probability = 0; | 338 config_.networking_config.packet_loss_probability = 0; |
339 // Bitrate and frame rate profile. | 339 // Bitrate and frame rate profile. |
340 RateProfile rate_profile; | 340 RateProfile rate_profile; |
341 SetRateProfilePars(&rate_profile, 0, 80, 24, 0); | 341 SetRateProfilePars(&rate_profile, 0, 80, 24, 0); |
342 SetRateProfilePars(&rate_profile, 1, 80, 15, 100); | 342 SetRateProfilePars(&rate_profile, 1, 80, 15, 100); |
343 SetRateProfilePars(&rate_profile, 2, 80, 10, 200); | 343 SetRateProfilePars(&rate_profile, 2, 80, 10, 200); |
344 rate_profile.frame_index_rate_update[3] = kNbrFramesLong + 1; | 344 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
345 rate_profile.num_frames = kNbrFramesLong; | 345 rate_profile.num_frames = kNumFramesLong; |
346 // Codec/network settings. | 346 // Codec/network settings. |
347 CodecConfigPars process_settings; | 347 CodecConfigPars process_settings; |
348 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.0f, -1, 1, false, | 348 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.0f, -1, 1, false, |
349 true, true, false); | 349 true, true, false); |
350 // Metrics for expected quality. | 350 // Metrics for expected quality. |
351 QualityMetrics quality_metrics; | 351 QualityMetrics quality_metrics; |
352 SetQualityMetrics(&quality_metrics, 31.0, 22.0, 0.80, 0.65); | 352 SetQualityMetrics(&quality_metrics, 31.0, 22.0, 0.80, 0.65); |
353 // Metrics for rate control. | 353 // Metrics for rate control. |
354 RateControlMetrics rc_metrics[3]; | 354 RateControlMetrics rc_metrics[3]; |
355 SetRateControlMetrics(rc_metrics, 0, 40, 20, 75, 15, 60, 0, 1); | 355 SetRateControlMetrics(rc_metrics, 0, 40, 20, 75, 15, 60, 0, 1); |
(...skipping 14 matching lines...) Expand all Loading... |
370 DISABLED_ProcessNoLossTemporalLayersVP8 | 370 DISABLED_ProcessNoLossTemporalLayersVP8 |
371 #else | 371 #else |
372 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8 | 372 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8 |
373 #endif | 373 #endif |
374 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { | 374 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { |
375 config_.networking_config.packet_loss_probability = 0; | 375 config_.networking_config.packet_loss_probability = 0; |
376 // Bitrate and frame rate profile. | 376 // Bitrate and frame rate profile. |
377 RateProfile rate_profile; | 377 RateProfile rate_profile; |
378 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); | 378 SetRateProfilePars(&rate_profile, 0, 200, 30, 0); |
379 SetRateProfilePars(&rate_profile, 1, 400, 30, 150); | 379 SetRateProfilePars(&rate_profile, 1, 400, 30, 150); |
380 rate_profile.frame_index_rate_update[2] = kNbrFramesLong + 1; | 380 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; |
381 rate_profile.num_frames = kNbrFramesLong; | 381 rate_profile.num_frames = kNumFramesLong; |
382 // Codec/network settings. | 382 // Codec/network settings. |
383 CodecConfigPars process_settings; | 383 CodecConfigPars process_settings; |
384 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.0f, -1, 3, false, | 384 SetCodecParameters(&process_settings, kVideoCodecVP8, 0.0f, -1, 3, false, |
385 true, true, false); | 385 true, true, false); |
386 // Metrics for expected quality. | 386 // Metrics for expected quality. |
387 QualityMetrics quality_metrics; | 387 QualityMetrics quality_metrics; |
388 SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80); | 388 SetQualityMetrics(&quality_metrics, 32.5, 30.0, 0.85, 0.80); |
389 // Metrics for rate control. | 389 // Metrics for rate control. |
390 RateControlMetrics rc_metrics[2]; | 390 RateControlMetrics rc_metrics[2]; |
391 SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1); | 391 SetRateControlMetrics(rc_metrics, 0, 0, 20, 30, 10, 10, 0, 1); |
392 SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0); | 392 SetRateControlMetrics(rc_metrics, 1, 0, 0, 30, 15, 10, 0, 0); |
393 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 393 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, |
394 rc_metrics); | 394 rc_metrics); |
395 } | 395 } |
396 } // namespace test | 396 } // namespace test |
397 } // namespace webrtc | 397 } // namespace webrtc |
OLD | NEW |