| 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 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 namespace webrtc { | 15 namespace webrtc { |
| 16 namespace test { | 16 namespace test { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 // Test settings. | 20 // Test settings. |
| 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 const bool kVerboseLogging = false; | 23 const bool kVerboseLogging = false; |
| 24 const bool kHwCodec = false; | 24 const bool kHwCodec = false; |
| 25 const bool kBatchMode = false; | |
| 26 | 25 |
| 27 // Codec settings. | 26 // Codec settings. |
| 28 const bool kResilienceOn = true; | 27 const bool kResilienceOn = true; |
| 29 | 28 |
| 30 // Default sequence is foreman (CIF): may be better to use VGA for resize test. | 29 // Default sequence is foreman (CIF): may be better to use VGA for resize test. |
| 31 const int kCifWidth = 352; | 30 const int kCifWidth = 352; |
| 32 const int kCifHeight = 288; | 31 const int kCifHeight = 288; |
| 33 const char kForemanCif[] = "foreman_cif"; | 32 const char kForemanCif[] = "foreman_cif"; |
| 34 #if !defined(WEBRTC_IOS) | 33 #if !defined(WEBRTC_IOS) |
| 35 const int kNumFramesShort = 100; | 34 const int kNumFramesShort = 100; |
| 36 #endif | 35 #endif |
| 37 const int kNumFramesLong = 300; | 36 const int kNumFramesLong = 300; |
| 38 | 37 |
| 39 const std::nullptr_t kNoVisualizationParams = nullptr; | 38 const std::nullptr_t kNoVisualizationParams = nullptr; |
| 40 | 39 |
| 41 } // namespace | 40 } // namespace |
| 42 | 41 |
| 43 #if defined(WEBRTC_USE_H264) | 42 #if defined(WEBRTC_USE_H264) |
| 44 | 43 |
| 45 // H264: Run with no packet loss and fixed bitrate. Quality should be very high. | 44 // H264: Run with no packet loss and fixed bitrate. Quality should be very high. |
| 46 // Note(hbos): The PacketManipulatorImpl code used to simulate packet loss in | 45 // Note(hbos): The PacketManipulatorImpl code used to simulate packet loss in |
| 47 // these unittests appears to drop "packets" in a way that is not compatible | 46 // these unittests appears to drop "packets" in a way that is not compatible |
| 48 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have | 47 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have |
| 49 // not been added. | 48 // not been added. |
| 50 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { | 49 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { |
| 51 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 50 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, |
| 52 kVerboseLogging, kBatchMode); | 51 kVerboseLogging); |
| 53 SetCodecSettings(&config_, kVideoCodecH264, 1, false, false, true, false, | 52 SetCodecSettings(&config_, kVideoCodecH264, 1, false, false, true, false, |
| 54 kResilienceOn, kCifWidth, kCifHeight); | 53 kResilienceOn, kCifWidth, kCifHeight); |
| 55 | 54 |
| 56 RateProfile rate_profile; | 55 RateProfile rate_profile; |
| 57 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 56 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 58 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 57 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 59 rate_profile.num_frames = kNumFramesShort; | 58 rate_profile.num_frames = kNumFramesShort; |
| 60 | 59 |
| 61 std::vector<RateControlThresholds> rc_thresholds; | 60 std::vector<RateControlThresholds> rc_thresholds; |
| 62 AddRateControlThresholds(2, 60, 20, 10, 20, 0, 1, &rc_thresholds); | 61 AddRateControlThresholds(2, 60, 20, 10, 20, 0, 1, &rc_thresholds); |
| 63 | 62 |
| 64 QualityThresholds quality_thresholds(35.0, 25.0, 0.93, 0.70); | 63 QualityThresholds quality_thresholds(35.0, 25.0, 0.93, 0.70); |
| 65 | 64 |
| 66 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 65 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 67 kNoVisualizationParams); | 66 kNoVisualizationParams); |
| 68 } | 67 } |
| 69 | 68 |
| 70 #endif // defined(WEBRTC_USE_H264) | 69 #endif // defined(WEBRTC_USE_H264) |
| 71 | 70 |
| 72 // Fails on iOS. See webrtc:4755. | 71 // Fails on iOS. See webrtc:4755. |
| 73 #if !defined(WEBRTC_IOS) | 72 #if !defined(WEBRTC_IOS) |
| 74 | 73 |
| 75 #if !defined(RTC_DISABLE_VP9) | 74 #if !defined(RTC_DISABLE_VP9) |
| 76 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. | 75 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. |
| 77 // One key frame (first frame only) in sequence. | 76 // One key frame (first frame only) in sequence. |
| 78 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { | 77 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { |
| 79 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 78 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, |
| 80 kVerboseLogging, kBatchMode); | 79 kVerboseLogging); |
| 81 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, | 80 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
| 82 kResilienceOn, kCifWidth, kCifHeight); | 81 kResilienceOn, kCifWidth, kCifHeight); |
| 83 | 82 |
| 84 RateProfile rate_profile; | 83 RateProfile rate_profile; |
| 85 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 84 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 86 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 85 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 87 rate_profile.num_frames = kNumFramesShort; | 86 rate_profile.num_frames = kNumFramesShort; |
| 88 | 87 |
| 89 std::vector<RateControlThresholds> rc_thresholds; | 88 std::vector<RateControlThresholds> rc_thresholds; |
| 90 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); | 89 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); |
| 91 | 90 |
| 92 QualityThresholds quality_thresholds(37.0, 36.0, 0.93, 0.92); | 91 QualityThresholds quality_thresholds(37.0, 36.0, 0.93, 0.92); |
| 93 | 92 |
| 94 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 93 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 95 kNoVisualizationParams); | 94 kNoVisualizationParams); |
| 96 } | 95 } |
| 97 | 96 |
| 98 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit | 97 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit |
| 99 // lower. One key frame (first frame only) in sequence. | 98 // lower. One key frame (first frame only) in sequence. |
| 100 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { | 99 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { |
| 101 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.05f, kForemanCif, | 100 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.05f, kForemanCif, |
| 102 kVerboseLogging, kBatchMode); | 101 kVerboseLogging); |
| 103 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, | 102 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
| 104 kResilienceOn, kCifWidth, kCifHeight); | 103 kResilienceOn, kCifWidth, kCifHeight); |
| 105 | 104 |
| 106 RateProfile rate_profile; | 105 RateProfile rate_profile; |
| 107 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 106 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 108 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 107 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 109 rate_profile.num_frames = kNumFramesShort; | 108 rate_profile.num_frames = kNumFramesShort; |
| 110 | 109 |
| 111 std::vector<RateControlThresholds> rc_thresholds; | 110 std::vector<RateControlThresholds> rc_thresholds; |
| 112 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); | 111 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); |
| 113 | 112 |
| 114 QualityThresholds quality_thresholds(17.0, 14.0, 0.45, 0.36); | 113 QualityThresholds quality_thresholds(17.0, 14.0, 0.45, 0.36); |
| 115 | 114 |
| 116 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 115 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 117 kNoVisualizationParams); | 116 kNoVisualizationParams); |
| 118 } | 117 } |
| 119 | 118 |
| 120 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): | 119 // VP9: Run with no packet loss, with varying bitrate (3 rate updates): |
| 121 // low to high to medium. Check that quality and encoder response to the new | 120 // low to high to medium. Check that quality and encoder response to the new |
| 122 // target rate/per-frame bandwidth (for each rate update) is within limits. | 121 // target rate/per-frame bandwidth (for each rate update) is within limits. |
| 123 // One key frame (first frame only) in sequence. | 122 // One key frame (first frame only) in sequence. |
| 124 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { | 123 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { |
| 125 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 124 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, |
| 126 kVerboseLogging, kBatchMode); | 125 kVerboseLogging); |
| 127 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, | 126 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
| 128 kResilienceOn, kCifWidth, kCifHeight); | 127 kResilienceOn, kCifWidth, kCifHeight); |
| 129 | 128 |
| 130 RateProfile rate_profile; | 129 RateProfile rate_profile; |
| 131 SetRateProfile(&rate_profile, 0, 200, 30, 0); | 130 SetRateProfile(&rate_profile, 0, 200, 30, 0); |
| 132 SetRateProfile(&rate_profile, 1, 700, 30, 100); | 131 SetRateProfile(&rate_profile, 1, 700, 30, 100); |
| 133 SetRateProfile(&rate_profile, 2, 500, 30, 200); | 132 SetRateProfile(&rate_profile, 2, 500, 30, 200); |
| 134 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 133 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 135 rate_profile.num_frames = kNumFramesLong; | 134 rate_profile.num_frames = kNumFramesLong; |
| 136 | 135 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 148 // VP9: Run with no packet loss, with an update (decrease) in frame rate. | 147 // VP9: Run with no packet loss, with an update (decrease) in frame rate. |
| 149 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. | 148 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. |
| 150 // At the low bitrate in this test, this means better rate control after the | 149 // At the low bitrate in this test, this means better rate control after the |
| 151 // update(s) to lower frame rate. So expect less frame drops, and max values | 150 // update(s) to lower frame rate. So expect less frame drops, and max values |
| 152 // for the rate control metrics can be lower. One key frame (first frame only). | 151 // for the rate control metrics can be lower. One key frame (first frame only). |
| 153 // Note: quality after update should be higher but we currently compute quality | 152 // Note: quality after update should be higher but we currently compute quality |
| 154 // metrics averaged over whole sequence run. | 153 // metrics averaged over whole sequence run. |
| 155 TEST_F(VideoProcessorIntegrationTest, | 154 TEST_F(VideoProcessorIntegrationTest, |
| 156 ProcessNoLossChangeFrameRateFrameDropVP9) { | 155 ProcessNoLossChangeFrameRateFrameDropVP9) { |
| 157 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 156 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, |
| 158 kVerboseLogging, kBatchMode); | 157 kVerboseLogging); |
| 159 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, | 158 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
| 160 kResilienceOn, kCifWidth, kCifHeight); | 159 kResilienceOn, kCifWidth, kCifHeight); |
| 161 | 160 |
| 162 RateProfile rate_profile; | 161 RateProfile rate_profile; |
| 163 SetRateProfile(&rate_profile, 0, 100, 24, 0); | 162 SetRateProfile(&rate_profile, 0, 100, 24, 0); |
| 164 SetRateProfile(&rate_profile, 1, 100, 15, 100); | 163 SetRateProfile(&rate_profile, 1, 100, 15, 100); |
| 165 SetRateProfile(&rate_profile, 2, 100, 10, 200); | 164 SetRateProfile(&rate_profile, 2, 100, 10, 200); |
| 166 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 165 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 167 rate_profile.num_frames = kNumFramesLong; | 166 rate_profile.num_frames = kNumFramesLong; |
| 168 | 167 |
| 169 std::vector<RateControlThresholds> rc_thresholds; | 168 std::vector<RateControlThresholds> rc_thresholds; |
| 170 AddRateControlThresholds(45, 50, 95, 15, 45, 0, 1, &rc_thresholds); | 169 AddRateControlThresholds(45, 50, 95, 15, 45, 0, 1, &rc_thresholds); |
| 171 AddRateControlThresholds(20, 0, 50, 10, 30, 0, 0, &rc_thresholds); | 170 AddRateControlThresholds(20, 0, 50, 10, 30, 0, 0, &rc_thresholds); |
| 172 AddRateControlThresholds(5, 0, 30, 5, 25, 0, 0, &rc_thresholds); | 171 AddRateControlThresholds(5, 0, 30, 5, 25, 0, 0, &rc_thresholds); |
| 173 | 172 |
| 174 QualityThresholds quality_thresholds(31.5, 18.0, 0.80, 0.43); | 173 QualityThresholds quality_thresholds(31.5, 18.0, 0.80, 0.43); |
| 175 | 174 |
| 176 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 175 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 177 kNoVisualizationParams); | 176 kNoVisualizationParams); |
| 178 } | 177 } |
| 179 | 178 |
| 180 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). | 179 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). |
| 181 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { | 180 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { |
| 182 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 181 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, |
| 183 kVerboseLogging, kBatchMode); | 182 kVerboseLogging); |
| 184 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, true, true, false, | 183 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, true, true, false, |
| 185 kResilienceOn, kCifWidth, kCifHeight); | 184 kResilienceOn, kCifWidth, kCifHeight); |
| 186 | 185 |
| 187 RateProfile rate_profile; | 186 RateProfile rate_profile; |
| 188 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 187 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 189 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 188 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 190 rate_profile.num_frames = kNumFramesShort; | 189 rate_profile.num_frames = kNumFramesShort; |
| 191 | 190 |
| 192 std::vector<RateControlThresholds> rc_thresholds; | 191 std::vector<RateControlThresholds> rc_thresholds; |
| 193 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); | 192 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); |
| 194 | 193 |
| 195 QualityThresholds quality_thresholds(36.8, 35.8, 0.92, 0.91); | 194 QualityThresholds quality_thresholds(36.8, 35.8, 0.92, 0.91); |
| 196 | 195 |
| 197 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 196 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 198 kNoVisualizationParams); | 197 kNoVisualizationParams); |
| 199 } | 198 } |
| 200 | 199 |
| 201 // Run with no packet loss, at low bitrate. | 200 // Run with no packet loss, at low bitrate. |
| 202 // spatial_resize is on, for this low bitrate expect one resize in sequence. | 201 // spatial_resize is on, for this low bitrate expect one resize in sequence. |
| 203 // Resize happens on delta frame. Expect only one key frame (first frame). | 202 // Resize happens on delta frame. Expect only one key frame (first frame). |
| 204 TEST_F(VideoProcessorIntegrationTest, | 203 TEST_F(VideoProcessorIntegrationTest, |
| 205 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { | 204 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { |
| 206 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 205 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, |
| 207 kVerboseLogging, kBatchMode); | 206 kVerboseLogging); |
| 208 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, true, | 207 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, true, |
| 209 kResilienceOn, kCifWidth, kCifHeight); | 208 kResilienceOn, kCifWidth, kCifHeight); |
| 210 | 209 |
| 211 RateProfile rate_profile; | 210 RateProfile rate_profile; |
| 212 SetRateProfile(&rate_profile, 0, 50, 30, 0); | 211 SetRateProfile(&rate_profile, 0, 50, 30, 0); |
| 213 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; | 212 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; |
| 214 rate_profile.num_frames = kNumFramesLong; | 213 rate_profile.num_frames = kNumFramesLong; |
| 215 | 214 |
| 216 std::vector<RateControlThresholds> rc_thresholds; | 215 std::vector<RateControlThresholds> rc_thresholds; |
| 217 AddRateControlThresholds(228, 70, 160, 15, 80, 1, 1, &rc_thresholds); | 216 AddRateControlThresholds(228, 70, 160, 15, 80, 1, 1, &rc_thresholds); |
| 218 | 217 |
| 219 QualityThresholds quality_thresholds(24.0, 13.0, 0.65, 0.37); | 218 QualityThresholds quality_thresholds(24.0, 13.0, 0.65, 0.37); |
| 220 | 219 |
| 221 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 220 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 222 kNoVisualizationParams); | 221 kNoVisualizationParams); |
| 223 } | 222 } |
| 224 | 223 |
| 225 // TODO(marpan): Add temporal layer test for VP9, once changes are in | 224 // TODO(marpan): Add temporal layer test for VP9, once changes are in |
| 226 // vp9 wrapper for this. | 225 // vp9 wrapper for this. |
| 227 | 226 |
| 228 #endif // !defined(RTC_DISABLE_VP9) | 227 #endif // !defined(RTC_DISABLE_VP9) |
| 229 | 228 |
| 230 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. | 229 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. |
| 231 // One key frame (first frame only) in sequence. Setting |key_frame_interval| | 230 // One key frame (first frame only) in sequence. Setting |key_frame_interval| |
| 232 // to -1 below means no periodic key frames in test. | 231 // to -1 below means no periodic key frames in test. |
| 233 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { | 232 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { |
| 234 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 233 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, |
| 235 kVerboseLogging, kBatchMode); | 234 kVerboseLogging); |
| 236 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 235 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 237 kResilienceOn, kCifWidth, kCifHeight); | 236 kResilienceOn, kCifWidth, kCifHeight); |
| 238 | 237 |
| 239 RateProfile rate_profile; | 238 RateProfile rate_profile; |
| 240 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 239 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 241 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 240 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 242 rate_profile.num_frames = kNumFramesShort; | 241 rate_profile.num_frames = kNumFramesShort; |
| 243 | 242 |
| 244 std::vector<RateControlThresholds> rc_thresholds; | 243 std::vector<RateControlThresholds> rc_thresholds; |
| 245 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); | 244 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); |
| 246 | 245 |
| 247 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89); | 246 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89); |
| 248 | 247 |
| 249 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 248 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 250 kNoVisualizationParams); | 249 kNoVisualizationParams); |
| 251 } | 250 } |
| 252 | 251 |
| 253 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit | 252 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit |
| 254 // lower. One key frame (first frame only) in sequence. | 253 // lower. One key frame (first frame only) in sequence. |
| 255 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { | 254 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { |
| 256 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.05f, kForemanCif, | 255 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.05f, kForemanCif, |
| 257 kVerboseLogging, kBatchMode); | 256 kVerboseLogging); |
| 258 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 257 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 259 kResilienceOn, kCifWidth, kCifHeight); | 258 kResilienceOn, kCifWidth, kCifHeight); |
| 260 | 259 |
| 261 RateProfile rate_profile; | 260 RateProfile rate_profile; |
| 262 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 261 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 263 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 262 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 264 rate_profile.num_frames = kNumFramesShort; | 263 rate_profile.num_frames = kNumFramesShort; |
| 265 | 264 |
| 266 std::vector<RateControlThresholds> rc_thresholds; | 265 std::vector<RateControlThresholds> rc_thresholds; |
| 267 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); | 266 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); |
| 268 | 267 |
| 269 QualityThresholds quality_thresholds(20.0, 16.0, 0.60, 0.40); | 268 QualityThresholds quality_thresholds(20.0, 16.0, 0.60, 0.40); |
| 270 | 269 |
| 271 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 270 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 272 kNoVisualizationParams); | 271 kNoVisualizationParams); |
| 273 } | 272 } |
| 274 | 273 |
| 275 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. | 274 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. |
| 276 // One key frame (first frame only) in sequence. | 275 // One key frame (first frame only) in sequence. |
| 277 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { | 276 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { |
| 278 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.1f, kForemanCif, | 277 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.1f, kForemanCif, |
| 279 kVerboseLogging, kBatchMode); | 278 kVerboseLogging); |
| 280 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 279 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 281 kResilienceOn, kCifWidth, kCifHeight); | 280 kResilienceOn, kCifWidth, kCifHeight); |
| 282 | 281 |
| 283 RateProfile rate_profile; | 282 RateProfile rate_profile; |
| 284 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 283 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 285 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 284 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 286 rate_profile.num_frames = kNumFramesShort; | 285 rate_profile.num_frames = kNumFramesShort; |
| 287 | 286 |
| 288 std::vector<RateControlThresholds> rc_thresholds; | 287 std::vector<RateControlThresholds> rc_thresholds; |
| 289 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); | 288 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); |
| 290 | 289 |
| 291 QualityThresholds quality_thresholds(19.0, 16.0, 0.50, 0.35); | 290 QualityThresholds quality_thresholds(19.0, 16.0, 0.50, 0.35); |
| 292 | 291 |
| 293 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 292 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 294 kNoVisualizationParams); | 293 kNoVisualizationParams); |
| 295 } | 294 } |
| 296 | 295 |
| 297 // This test is identical to VideoProcessorIntegrationTest.ProcessZeroPacketLoss | |
| 298 // except that |batch_mode| is turned on. The main point of this test is to see | |
| 299 // that the reported stats are not wildly varying between batch mode and the | |
| 300 // regular online mode. | |
| 301 TEST_F(VideoProcessorIntegrationTest, ProcessInBatchMode) { | |
| 302 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
| 303 kVerboseLogging, true /* batch_mode */); | |
| 304 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | |
| 305 kResilienceOn, kCifWidth, kCifHeight); | |
| 306 | |
| 307 RateProfile rate_profile; | |
| 308 SetRateProfile(&rate_profile, 0, 500, 30, 0); | |
| 309 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | |
| 310 rate_profile.num_frames = kNumFramesShort; | |
| 311 | |
| 312 std::vector<RateControlThresholds> rc_thresholds; | |
| 313 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); | |
| 314 | |
| 315 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89); | |
| 316 | |
| 317 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | |
| 318 kNoVisualizationParams); | |
| 319 } | |
| 320 | |
| 321 #endif // !defined(WEBRTC_IOS) | 296 #endif // !defined(WEBRTC_IOS) |
| 322 | 297 |
| 323 // The tests below are currently disabled for Android. For ARM, the encoder | 298 // The tests below are currently disabled for Android. For ARM, the encoder |
| 324 // uses |cpu_speed| = 12, as opposed to default |cpu_speed| <= 6 for x86, | 299 // uses |cpu_speed| = 12, as opposed to default |cpu_speed| <= 6 for x86, |
| 325 // which leads to significantly different quality. The quality and rate control | 300 // which leads to significantly different quality. The quality and rate control |
| 326 // settings in the tests below are defined for encoder speed setting | 301 // settings in the tests below are defined for encoder speed setting |
| 327 // |cpu_speed| <= ~6. A number of settings would need to be significantly | 302 // |cpu_speed| <= ~6. A number of settings would need to be significantly |
| 328 // modified for the |cpu_speed| = 12 case. For now, keep the tests below | 303 // modified for the |cpu_speed| = 12 case. For now, keep the tests below |
| 329 // disabled on Android. Some quality parameter in the above test has been | 304 // disabled on Android. Some quality parameter in the above test has been |
| 330 // adjusted to also pass for |cpu_speed| <= 12. | 305 // adjusted to also pass for |cpu_speed| <= 12. |
| 331 | 306 |
| 332 // VP8: Run with no packet loss, with varying bitrate (3 rate updates): | 307 // VP8: Run with no packet loss, with varying bitrate (3 rate updates): |
| 333 // low to high to medium. Check that quality and encoder response to the new | 308 // low to high to medium. Check that quality and encoder response to the new |
| 334 // target rate/per-frame bandwidth (for each rate update) is within limits. | 309 // target rate/per-frame bandwidth (for each rate update) is within limits. |
| 335 // One key frame (first frame only) in sequence. | 310 // One key frame (first frame only) in sequence. |
| 336 // Too slow to finish before timeout on iOS. See webrtc:4755. | 311 // Too slow to finish before timeout on iOS. See webrtc:4755. |
| 337 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 312 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| 338 #define MAYBE_ProcessNoLossChangeBitRateVP8 \ | 313 #define MAYBE_ProcessNoLossChangeBitRateVP8 \ |
| 339 DISABLED_ProcessNoLossChangeBitRateVP8 | 314 DISABLED_ProcessNoLossChangeBitRateVP8 |
| 340 #else | 315 #else |
| 341 #define MAYBE_ProcessNoLossChangeBitRateVP8 ProcessNoLossChangeBitRateVP8 | 316 #define MAYBE_ProcessNoLossChangeBitRateVP8 ProcessNoLossChangeBitRateVP8 |
| 342 #endif | 317 #endif |
| 343 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) { | 318 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) { |
| 344 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 319 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, |
| 345 kVerboseLogging, kBatchMode); | 320 kVerboseLogging); |
| 346 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 321 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 347 kResilienceOn, kCifWidth, kCifHeight); | 322 kResilienceOn, kCifWidth, kCifHeight); |
| 348 | 323 |
| 349 RateProfile rate_profile; | 324 RateProfile rate_profile; |
| 350 SetRateProfile(&rate_profile, 0, 200, 30, 0); | 325 SetRateProfile(&rate_profile, 0, 200, 30, 0); |
| 351 SetRateProfile(&rate_profile, 1, 800, 30, 100); | 326 SetRateProfile(&rate_profile, 1, 800, 30, 100); |
| 352 SetRateProfile(&rate_profile, 2, 500, 30, 200); | 327 SetRateProfile(&rate_profile, 2, 500, 30, 200); |
| 353 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 328 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 354 rate_profile.num_frames = kNumFramesLong; | 329 rate_profile.num_frames = kNumFramesLong; |
| 355 | 330 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 375 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 350 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| 376 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ | 351 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ |
| 377 DISABLED_ProcessNoLossChangeFrameRateFrameDropVP8 | 352 DISABLED_ProcessNoLossChangeFrameRateFrameDropVP8 |
| 378 #else | 353 #else |
| 379 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ | 354 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ |
| 380 ProcessNoLossChangeFrameRateFrameDropVP8 | 355 ProcessNoLossChangeFrameRateFrameDropVP8 |
| 381 #endif | 356 #endif |
| 382 TEST_F(VideoProcessorIntegrationTest, | 357 TEST_F(VideoProcessorIntegrationTest, |
| 383 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) { | 358 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) { |
| 384 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 359 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, |
| 385 kVerboseLogging, kBatchMode); | 360 kVerboseLogging); |
| 386 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 361 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 387 kResilienceOn, kCifWidth, kCifHeight); | 362 kResilienceOn, kCifWidth, kCifHeight); |
| 388 | 363 |
| 389 RateProfile rate_profile; | 364 RateProfile rate_profile; |
| 390 SetRateProfile(&rate_profile, 0, 80, 24, 0); | 365 SetRateProfile(&rate_profile, 0, 80, 24, 0); |
| 391 SetRateProfile(&rate_profile, 1, 80, 15, 100); | 366 SetRateProfile(&rate_profile, 1, 80, 15, 100); |
| 392 SetRateProfile(&rate_profile, 2, 80, 10, 200); | 367 SetRateProfile(&rate_profile, 2, 80, 10, 200); |
| 393 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 368 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 394 rate_profile.num_frames = kNumFramesLong; | 369 rate_profile.num_frames = kNumFramesLong; |
| 395 | 370 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 411 // One key frame (first frame only) in sequence, so no spatial resizing. | 386 // One key frame (first frame only) in sequence, so no spatial resizing. |
| 412 // Too slow to finish before timeout on iOS. See webrtc:4755. | 387 // Too slow to finish before timeout on iOS. See webrtc:4755. |
| 413 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 388 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| 414 #define MAYBE_ProcessNoLossTemporalLayersVP8 \ | 389 #define MAYBE_ProcessNoLossTemporalLayersVP8 \ |
| 415 DISABLED_ProcessNoLossTemporalLayersVP8 | 390 DISABLED_ProcessNoLossTemporalLayersVP8 |
| 416 #else | 391 #else |
| 417 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8 | 392 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8 |
| 418 #endif | 393 #endif |
| 419 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { | 394 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { |
| 420 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 395 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, |
| 421 kVerboseLogging, kBatchMode); | 396 kVerboseLogging); |
| 422 SetCodecSettings(&config_, kVideoCodecVP8, 3, false, true, true, false, | 397 SetCodecSettings(&config_, kVideoCodecVP8, 3, false, true, true, false, |
| 423 kResilienceOn, kCifWidth, kCifHeight); | 398 kResilienceOn, kCifWidth, kCifHeight); |
| 424 | 399 |
| 425 RateProfile rate_profile; | 400 RateProfile rate_profile; |
| 426 SetRateProfile(&rate_profile, 0, 200, 30, 0); | 401 SetRateProfile(&rate_profile, 0, 200, 30, 0); |
| 427 SetRateProfile(&rate_profile, 1, 400, 30, 150); | 402 SetRateProfile(&rate_profile, 1, 400, 30, 150); |
| 428 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; | 403 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; |
| 429 rate_profile.num_frames = kNumFramesLong; | 404 rate_profile.num_frames = kNumFramesLong; |
| 430 | 405 |
| 431 std::vector<RateControlThresholds> rc_thresholds; | 406 std::vector<RateControlThresholds> rc_thresholds; |
| 432 AddRateControlThresholds(0, 20, 30, 10, 10, 0, 1, &rc_thresholds); | 407 AddRateControlThresholds(0, 20, 30, 10, 10, 0, 1, &rc_thresholds); |
| 433 AddRateControlThresholds(0, 0, 30, 15, 10, 0, 0, &rc_thresholds); | 408 AddRateControlThresholds(0, 0, 30, 15, 10, 0, 0, &rc_thresholds); |
| 434 | 409 |
| 435 QualityThresholds quality_thresholds(32.5, 30.0, 0.85, 0.80); | 410 QualityThresholds quality_thresholds(32.5, 30.0, 0.85, 0.80); |
| 436 | 411 |
| 437 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 412 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 438 kNoVisualizationParams); | 413 kNoVisualizationParams); |
| 439 } | 414 } |
| 440 } // namespace test | 415 } // namespace test |
| 441 } // namespace webrtc | 416 } // namespace webrtc |
| OLD | NEW |