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