| 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 #include "webrtc/test/testsupport/fileutils.h" |
| 16 |
| 15 namespace webrtc { | 17 namespace webrtc { |
| 16 namespace test { | 18 namespace test { |
| 17 | 19 |
| 18 namespace { | 20 namespace { |
| 19 | 21 |
| 20 // Test settings. | |
| 21 // Only allow encoder/decoder to use single core, for predictability. | |
| 22 const bool kUseSingleCore = true; | |
| 23 const bool kVerboseLogging = false; | |
| 24 const bool kHwCodec = false; | |
| 25 | |
| 26 // Codec settings. | 22 // Codec settings. |
| 27 const bool kResilienceOn = true; | 23 const bool kResilienceOn = true; |
| 28 | |
| 29 // Default sequence is foreman (CIF): may be better to use VGA for resize test. | |
| 30 const int kCifWidth = 352; | 24 const int kCifWidth = 352; |
| 31 const int kCifHeight = 288; | 25 const int kCifHeight = 288; |
| 32 const char kForemanCif[] = "foreman_cif"; | |
| 33 #if !defined(WEBRTC_IOS) | 26 #if !defined(WEBRTC_IOS) |
| 34 const int kNumFramesShort = 100; | 27 const int kNumFramesShort = 100; |
| 35 #endif | 28 #endif |
| 36 const int kNumFramesLong = 300; | 29 const int kNumFramesLong = 300; |
| 37 | 30 |
| 38 const std::nullptr_t kNoVisualizationParams = nullptr; | 31 const std::nullptr_t kNoVisualizationParams = nullptr; |
| 39 | 32 |
| 40 } // namespace | 33 } // namespace |
| 41 | 34 |
| 35 class VideoProcessorIntegrationTestLibvpx |
| 36 : public VideoProcessorIntegrationTest { |
| 37 protected: |
| 38 VideoProcessorIntegrationTestLibvpx() { |
| 39 config_.filename = "foreman_cif"; |
| 40 config_.input_filename = ResourcePath(config_.filename, "yuv"); |
| 41 config_.output_filename = |
| 42 TempFilename(OutputPath(), "videoprocessor_integrationtest_libvpx"); |
| 43 config_.networking_config.packet_loss_probability = 0.0; |
| 44 // Only allow encoder/decoder to use single core, for predictability. |
| 45 config_.use_single_core = true; |
| 46 config_.verbose = false; |
| 47 config_.hw_codec = false; |
| 48 } |
| 49 }; |
| 50 |
| 42 // Fails on iOS. See webrtc:4755. | 51 // Fails on iOS. See webrtc:4755. |
| 43 #if !defined(WEBRTC_IOS) | 52 #if !defined(WEBRTC_IOS) |
| 44 | 53 |
| 45 #if !defined(RTC_DISABLE_VP9) | 54 #if !defined(RTC_DISABLE_VP9) |
| 46 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. | 55 // VP9: Run with no packet loss and fixed bitrate. Quality should be very high. |
| 47 // One key frame (first frame only) in sequence. | 56 // One key frame (first frame only) in sequence. |
| 48 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossVP9) { | 57 TEST_F(VideoProcessorIntegrationTestLibvpx, Process0PercentPacketLossVP9) { |
| 49 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
| 50 kVerboseLogging); | |
| 51 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, | 58 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
| 52 kResilienceOn, kCifWidth, kCifHeight); | 59 kResilienceOn, kCifWidth, kCifHeight); |
| 53 | 60 |
| 54 RateProfile rate_profile; | 61 RateProfile rate_profile; |
| 55 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 62 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 56 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 63 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 57 rate_profile.num_frames = kNumFramesShort; | 64 rate_profile.num_frames = kNumFramesShort; |
| 58 | 65 |
| 59 std::vector<RateControlThresholds> rc_thresholds; | 66 std::vector<RateControlThresholds> rc_thresholds; |
| 60 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); | 67 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); |
| 61 | 68 |
| 62 QualityThresholds quality_thresholds(37.0, 36.0, 0.93, 0.92); | 69 QualityThresholds quality_thresholds(37.0, 36.0, 0.93, 0.92); |
| 63 | 70 |
| 64 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 71 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 65 kNoVisualizationParams); | 72 kNoVisualizationParams); |
| 66 } | 73 } |
| 67 | 74 |
| 68 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit | 75 // VP9: Run with 5% packet loss and fixed bitrate. Quality should be a bit |
| 69 // lower. One key frame (first frame only) in sequence. | 76 // lower. One key frame (first frame only) in sequence. |
| 70 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLossVP9) { | 77 TEST_F(VideoProcessorIntegrationTestLibvpx, Process5PercentPacketLossVP9) { |
| 71 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.05f, kForemanCif, | 78 config_.networking_config.packet_loss_probability = 0.05f; |
| 72 kVerboseLogging); | |
| 73 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, | 79 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
| 74 kResilienceOn, kCifWidth, kCifHeight); | 80 kResilienceOn, kCifWidth, kCifHeight); |
| 75 | 81 |
| 76 RateProfile rate_profile; | 82 RateProfile rate_profile; |
| 77 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 83 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 78 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 84 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 79 rate_profile.num_frames = kNumFramesShort; | 85 rate_profile.num_frames = kNumFramesShort; |
| 80 | 86 |
| 81 std::vector<RateControlThresholds> rc_thresholds; | 87 std::vector<RateControlThresholds> rc_thresholds; |
| 82 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); | 88 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); |
| 83 | 89 |
| 84 QualityThresholds quality_thresholds(17.0, 14.0, 0.45, 0.36); | 90 QualityThresholds quality_thresholds(17.0, 14.0, 0.45, 0.36); |
| 85 | 91 |
| 86 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 92 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 87 kNoVisualizationParams); | 93 kNoVisualizationParams); |
| 88 } | 94 } |
| 89 | 95 |
| 90 // 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): |
| 91 // 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 |
| 92 // 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. |
| 93 // One key frame (first frame only) in sequence. | 99 // One key frame (first frame only) in sequence. |
| 94 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { | 100 TEST_F(VideoProcessorIntegrationTestLibvpx, ProcessNoLossChangeBitRateVP9) { |
| 95 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
| 96 kVerboseLogging); | |
| 97 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, | 101 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
| 98 kResilienceOn, kCifWidth, kCifHeight); | 102 kResilienceOn, kCifWidth, kCifHeight); |
| 99 | 103 |
| 100 RateProfile rate_profile; | 104 RateProfile rate_profile; |
| 101 SetRateProfile(&rate_profile, 0, 200, 30, 0); | 105 SetRateProfile(&rate_profile, 0, 200, 30, 0); |
| 102 SetRateProfile(&rate_profile, 1, 700, 30, 100); | 106 SetRateProfile(&rate_profile, 1, 700, 30, 100); |
| 103 SetRateProfile(&rate_profile, 2, 500, 30, 200); | 107 SetRateProfile(&rate_profile, 2, 500, 30, 200); |
| 104 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 108 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 105 rate_profile.num_frames = kNumFramesLong; | 109 rate_profile.num_frames = kNumFramesLong; |
| 106 | 110 |
| 107 std::vector<RateControlThresholds> rc_thresholds; | 111 std::vector<RateControlThresholds> rc_thresholds; |
| 108 AddRateControlThresholds(0, 30, 20, 20, 35, 0, 1, &rc_thresholds); | 112 AddRateControlThresholds(0, 30, 20, 20, 35, 0, 1, &rc_thresholds); |
| 109 AddRateControlThresholds(2, 0, 20, 20, 60, 0, 0, &rc_thresholds); | 113 AddRateControlThresholds(2, 0, 20, 20, 60, 0, 0, &rc_thresholds); |
| 110 AddRateControlThresholds(0, 0, 25, 20, 40, 0, 0, &rc_thresholds); | 114 AddRateControlThresholds(0, 0, 25, 20, 40, 0, 0, &rc_thresholds); |
| 111 | 115 |
| 112 QualityThresholds quality_thresholds(35.5, 30.0, 0.90, 0.85); | 116 QualityThresholds quality_thresholds(35.5, 30.0, 0.90, 0.85); |
| 113 | 117 |
| 114 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 118 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 115 kNoVisualizationParams); | 119 kNoVisualizationParams); |
| 116 } | 120 } |
| 117 | 121 |
| 118 // VP9: Run with no packet loss, with an update (decrease) in frame rate. | 122 // VP9: Run with no packet loss, with an update (decrease) in frame rate. |
| 119 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. | 123 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. |
| 120 // At the low bitrate in this test, this means better rate control after the | 124 // At the low bitrate in this test, this means better rate control after the |
| 121 // update(s) to lower frame rate. So expect less frame drops, and max values | 125 // update(s) to lower frame rate. So expect less frame drops, and max values |
| 122 // for the rate control metrics can be lower. One key frame (first frame only). | 126 // for the rate control metrics can be lower. One key frame (first frame only). |
| 123 // Note: quality after update should be higher but we currently compute quality | 127 // Note: quality after update should be higher but we currently compute quality |
| 124 // metrics averaged over whole sequence run. | 128 // metrics averaged over whole sequence run. |
| 125 TEST_F(VideoProcessorIntegrationTest, | 129 TEST_F(VideoProcessorIntegrationTestLibvpx, |
| 126 ProcessNoLossChangeFrameRateFrameDropVP9) { | 130 ProcessNoLossChangeFrameRateFrameDropVP9) { |
| 127 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
| 128 kVerboseLogging); | |
| 129 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, | 131 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, false, |
| 130 kResilienceOn, kCifWidth, kCifHeight); | 132 kResilienceOn, kCifWidth, kCifHeight); |
| 131 | 133 |
| 132 RateProfile rate_profile; | 134 RateProfile rate_profile; |
| 133 SetRateProfile(&rate_profile, 0, 100, 24, 0); | 135 SetRateProfile(&rate_profile, 0, 100, 24, 0); |
| 134 SetRateProfile(&rate_profile, 1, 100, 15, 100); | 136 SetRateProfile(&rate_profile, 1, 100, 15, 100); |
| 135 SetRateProfile(&rate_profile, 2, 100, 10, 200); | 137 SetRateProfile(&rate_profile, 2, 100, 10, 200); |
| 136 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 138 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 137 rate_profile.num_frames = kNumFramesLong; | 139 rate_profile.num_frames = kNumFramesLong; |
| 138 | 140 |
| 139 std::vector<RateControlThresholds> rc_thresholds; | 141 std::vector<RateControlThresholds> rc_thresholds; |
| 140 AddRateControlThresholds(45, 50, 95, 15, 45, 0, 1, &rc_thresholds); | 142 AddRateControlThresholds(45, 50, 95, 15, 45, 0, 1, &rc_thresholds); |
| 141 AddRateControlThresholds(20, 0, 50, 10, 30, 0, 0, &rc_thresholds); | 143 AddRateControlThresholds(20, 0, 50, 10, 30, 0, 0, &rc_thresholds); |
| 142 AddRateControlThresholds(5, 0, 30, 5, 25, 0, 0, &rc_thresholds); | 144 AddRateControlThresholds(5, 0, 30, 5, 25, 0, 0, &rc_thresholds); |
| 143 | 145 |
| 144 QualityThresholds quality_thresholds(31.5, 18.0, 0.80, 0.43); | 146 QualityThresholds quality_thresholds(31.5, 18.0, 0.80, 0.43); |
| 145 | 147 |
| 146 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 148 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 147 kNoVisualizationParams); | 149 kNoVisualizationParams); |
| 148 } | 150 } |
| 149 | 151 |
| 150 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). | 152 // VP9: Run with no packet loss and denoiser on. One key frame (first frame). |
| 151 TEST_F(VideoProcessorIntegrationTest, ProcessNoLossDenoiserOnVP9) { | 153 TEST_F(VideoProcessorIntegrationTestLibvpx, ProcessNoLossDenoiserOnVP9) { |
| 152 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
| 153 kVerboseLogging); | |
| 154 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, true, true, false, | 154 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, true, true, false, |
| 155 kResilienceOn, kCifWidth, kCifHeight); | 155 kResilienceOn, kCifWidth, kCifHeight); |
| 156 | 156 |
| 157 RateProfile rate_profile; | 157 RateProfile rate_profile; |
| 158 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 158 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 159 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 159 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 160 rate_profile.num_frames = kNumFramesShort; | 160 rate_profile.num_frames = kNumFramesShort; |
| 161 | 161 |
| 162 std::vector<RateControlThresholds> rc_thresholds; | 162 std::vector<RateControlThresholds> rc_thresholds; |
| 163 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); | 163 AddRateControlThresholds(0, 40, 20, 10, 20, 0, 1, &rc_thresholds); |
| 164 | 164 |
| 165 QualityThresholds quality_thresholds(36.8, 35.8, 0.92, 0.91); | 165 QualityThresholds quality_thresholds(36.8, 35.8, 0.92, 0.91); |
| 166 | 166 |
| 167 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 167 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 168 kNoVisualizationParams); | 168 kNoVisualizationParams); |
| 169 } | 169 } |
| 170 | 170 |
| 171 // Run with no packet loss, at low bitrate. | 171 // Run with no packet loss, at low bitrate. |
| 172 // spatial_resize is on, for this low bitrate expect one resize in sequence. | 172 // spatial_resize is on, for this low bitrate expect one resize in sequence. |
| 173 // Resize happens on delta frame. Expect only one key frame (first frame). | 173 // Resize happens on delta frame. Expect only one key frame (first frame). |
| 174 TEST_F(VideoProcessorIntegrationTest, | 174 TEST_F(VideoProcessorIntegrationTestLibvpx, |
| 175 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { | 175 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { |
| 176 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
| 177 kVerboseLogging); | |
| 178 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, true, | 176 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, true, |
| 179 kResilienceOn, kCifWidth, kCifHeight); | 177 kResilienceOn, kCifWidth, kCifHeight); |
| 180 | 178 |
| 181 RateProfile rate_profile; | 179 RateProfile rate_profile; |
| 182 SetRateProfile(&rate_profile, 0, 50, 30, 0); | 180 SetRateProfile(&rate_profile, 0, 50, 30, 0); |
| 183 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; | 181 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; |
| 184 rate_profile.num_frames = kNumFramesLong; | 182 rate_profile.num_frames = kNumFramesLong; |
| 185 | 183 |
| 186 std::vector<RateControlThresholds> rc_thresholds; | 184 std::vector<RateControlThresholds> rc_thresholds; |
| 187 AddRateControlThresholds(228, 70, 160, 15, 80, 1, 1, &rc_thresholds); | 185 AddRateControlThresholds(228, 70, 160, 15, 80, 1, 1, &rc_thresholds); |
| 188 | 186 |
| 189 QualityThresholds quality_thresholds(24.0, 13.0, 0.65, 0.37); | 187 QualityThresholds quality_thresholds(24.0, 13.0, 0.65, 0.37); |
| 190 | 188 |
| 191 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 189 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 192 kNoVisualizationParams); | 190 kNoVisualizationParams); |
| 193 } | 191 } |
| 194 | 192 |
| 195 // TODO(marpan): Add temporal layer test for VP9, once changes are in | 193 // TODO(marpan): Add temporal layer test for VP9, once changes are in |
| 196 // vp9 wrapper for this. | 194 // vp9 wrapper for this. |
| 197 | 195 |
| 198 #endif // !defined(RTC_DISABLE_VP9) | 196 #endif // !defined(RTC_DISABLE_VP9) |
| 199 | 197 |
| 200 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. | 198 // VP8: Run with no packet loss and fixed bitrate. Quality should be very high. |
| 201 // One key frame (first frame only) in sequence. Setting |key_frame_interval| | 199 // One key frame (first frame only) in sequence. Setting |key_frame_interval| |
| 202 // to -1 below means no periodic key frames in test. | 200 // to -1 below means no periodic key frames in test. |
| 203 TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) { | 201 TEST_F(VideoProcessorIntegrationTestLibvpx, ProcessZeroPacketLoss) { |
| 204 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
| 205 kVerboseLogging); | |
| 206 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 202 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 207 kResilienceOn, kCifWidth, kCifHeight); | 203 kResilienceOn, kCifWidth, kCifHeight); |
| 208 | 204 |
| 209 RateProfile rate_profile; | 205 RateProfile rate_profile; |
| 210 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 206 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 211 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 207 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 212 rate_profile.num_frames = kNumFramesShort; | 208 rate_profile.num_frames = kNumFramesShort; |
| 213 | 209 |
| 214 std::vector<RateControlThresholds> rc_thresholds; | 210 std::vector<RateControlThresholds> rc_thresholds; |
| 215 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); | 211 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); |
| 216 | 212 |
| 217 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89); | 213 QualityThresholds quality_thresholds(34.95, 33.0, 0.90, 0.89); |
| 218 | 214 |
| 219 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 215 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 220 kNoVisualizationParams); | 216 kNoVisualizationParams); |
| 221 } | 217 } |
| 222 | 218 |
| 223 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit | 219 // VP8: Run with 5% packet loss and fixed bitrate. Quality should be a bit |
| 224 // lower. One key frame (first frame only) in sequence. | 220 // lower. One key frame (first frame only) in sequence. |
| 225 TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) { | 221 TEST_F(VideoProcessorIntegrationTestLibvpx, Process5PercentPacketLoss) { |
| 226 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.05f, kForemanCif, | 222 config_.networking_config.packet_loss_probability = 0.05f; |
| 227 kVerboseLogging); | |
| 228 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 223 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 229 kResilienceOn, kCifWidth, kCifHeight); | 224 kResilienceOn, kCifWidth, kCifHeight); |
| 230 | 225 |
| 231 RateProfile rate_profile; | 226 RateProfile rate_profile; |
| 232 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 227 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 233 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 228 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 234 rate_profile.num_frames = kNumFramesShort; | 229 rate_profile.num_frames = kNumFramesShort; |
| 235 | 230 |
| 236 std::vector<RateControlThresholds> rc_thresholds; | 231 std::vector<RateControlThresholds> rc_thresholds; |
| 237 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); | 232 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); |
| 238 | 233 |
| 239 QualityThresholds quality_thresholds(20.0, 16.0, 0.60, 0.40); | 234 QualityThresholds quality_thresholds(20.0, 16.0, 0.60, 0.40); |
| 240 | 235 |
| 241 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 236 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 242 kNoVisualizationParams); | 237 kNoVisualizationParams); |
| 243 } | 238 } |
| 244 | 239 |
| 245 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. | 240 // VP8: Run with 10% packet loss and fixed bitrate. Quality should be lower. |
| 246 // One key frame (first frame only) in sequence. | 241 // One key frame (first frame only) in sequence. |
| 247 TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) { | 242 TEST_F(VideoProcessorIntegrationTestLibvpx, Process10PercentPacketLoss) { |
| 248 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.1f, kForemanCif, | 243 config_.networking_config.packet_loss_probability = 0.1f; |
| 249 kVerboseLogging); | |
| 250 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 244 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 251 kResilienceOn, kCifWidth, kCifHeight); | 245 kResilienceOn, kCifWidth, kCifHeight); |
| 252 | 246 |
| 253 RateProfile rate_profile; | 247 RateProfile rate_profile; |
| 254 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 248 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 255 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; | 249 rate_profile.frame_index_rate_update[1] = kNumFramesShort + 1; |
| 256 rate_profile.num_frames = kNumFramesShort; | 250 rate_profile.num_frames = kNumFramesShort; |
| 257 | 251 |
| 258 std::vector<RateControlThresholds> rc_thresholds; | 252 std::vector<RateControlThresholds> rc_thresholds; |
| 259 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); | 253 AddRateControlThresholds(0, 40, 20, 10, 15, 0, 1, &rc_thresholds); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 279 // low to high to medium. Check that quality and encoder response to the new | 273 // low to high to medium. Check that quality and encoder response to the new |
| 280 // target rate/per-frame bandwidth (for each rate update) is within limits. | 274 // target rate/per-frame bandwidth (for each rate update) is within limits. |
| 281 // One key frame (first frame only) in sequence. | 275 // One key frame (first frame only) in sequence. |
| 282 // Too slow to finish before timeout on iOS. See webrtc:4755. | 276 // Too slow to finish before timeout on iOS. See webrtc:4755. |
| 283 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 277 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| 284 #define MAYBE_ProcessNoLossChangeBitRateVP8 \ | 278 #define MAYBE_ProcessNoLossChangeBitRateVP8 \ |
| 285 DISABLED_ProcessNoLossChangeBitRateVP8 | 279 DISABLED_ProcessNoLossChangeBitRateVP8 |
| 286 #else | 280 #else |
| 287 #define MAYBE_ProcessNoLossChangeBitRateVP8 ProcessNoLossChangeBitRateVP8 | 281 #define MAYBE_ProcessNoLossChangeBitRateVP8 ProcessNoLossChangeBitRateVP8 |
| 288 #endif | 282 #endif |
| 289 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossChangeBitRateVP8) { | 283 TEST_F(VideoProcessorIntegrationTestLibvpx, |
| 290 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 284 MAYBE_ProcessNoLossChangeBitRateVP8) { |
| 291 kVerboseLogging); | |
| 292 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 285 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 293 kResilienceOn, kCifWidth, kCifHeight); | 286 kResilienceOn, kCifWidth, kCifHeight); |
| 294 | 287 |
| 295 RateProfile rate_profile; | 288 RateProfile rate_profile; |
| 296 SetRateProfile(&rate_profile, 0, 200, 30, 0); | 289 SetRateProfile(&rate_profile, 0, 200, 30, 0); |
| 297 SetRateProfile(&rate_profile, 1, 800, 30, 100); | 290 SetRateProfile(&rate_profile, 1, 800, 30, 100); |
| 298 SetRateProfile(&rate_profile, 2, 500, 30, 200); | 291 SetRateProfile(&rate_profile, 2, 500, 30, 200); |
| 299 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 292 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 300 rate_profile.num_frames = kNumFramesLong; | 293 rate_profile.num_frames = kNumFramesLong; |
| 301 | 294 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 318 // Note: quality after update should be higher but we currently compute quality | 311 // Note: quality after update should be higher but we currently compute quality |
| 319 // metrics averaged over whole sequence run. | 312 // metrics averaged over whole sequence run. |
| 320 // Too slow to finish before timeout on iOS. See webrtc:4755. | 313 // Too slow to finish before timeout on iOS. See webrtc:4755. |
| 321 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 314 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| 322 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ | 315 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ |
| 323 DISABLED_ProcessNoLossChangeFrameRateFrameDropVP8 | 316 DISABLED_ProcessNoLossChangeFrameRateFrameDropVP8 |
| 324 #else | 317 #else |
| 325 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ | 318 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ |
| 326 ProcessNoLossChangeFrameRateFrameDropVP8 | 319 ProcessNoLossChangeFrameRateFrameDropVP8 |
| 327 #endif | 320 #endif |
| 328 TEST_F(VideoProcessorIntegrationTest, | 321 TEST_F(VideoProcessorIntegrationTestLibvpx, |
| 329 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) { | 322 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) { |
| 330 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
| 331 kVerboseLogging); | |
| 332 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, | 323 SetCodecSettings(&config_, kVideoCodecVP8, 1, false, true, true, false, |
| 333 kResilienceOn, kCifWidth, kCifHeight); | 324 kResilienceOn, kCifWidth, kCifHeight); |
| 334 | 325 |
| 335 RateProfile rate_profile; | 326 RateProfile rate_profile; |
| 336 SetRateProfile(&rate_profile, 0, 80, 24, 0); | 327 SetRateProfile(&rate_profile, 0, 80, 24, 0); |
| 337 SetRateProfile(&rate_profile, 1, 80, 15, 100); | 328 SetRateProfile(&rate_profile, 1, 80, 15, 100); |
| 338 SetRateProfile(&rate_profile, 2, 80, 10, 200); | 329 SetRateProfile(&rate_profile, 2, 80, 10, 200); |
| 339 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 330 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 340 rate_profile.num_frames = kNumFramesLong; | 331 rate_profile.num_frames = kNumFramesLong; |
| 341 | 332 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 355 // encoding rate mismatch are applied to each layer. | 346 // encoding rate mismatch are applied to each layer. |
| 356 // No dropped frames in this test, and internal spatial resizer is off. | 347 // No dropped frames in this test, and internal spatial resizer is off. |
| 357 // One key frame (first frame only) in sequence, so no spatial resizing. | 348 // One key frame (first frame only) in sequence, so no spatial resizing. |
| 358 // Too slow to finish before timeout on iOS. See webrtc:4755. | 349 // Too slow to finish before timeout on iOS. See webrtc:4755. |
| 359 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 350 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| 360 #define MAYBE_ProcessNoLossTemporalLayersVP8 \ | 351 #define MAYBE_ProcessNoLossTemporalLayersVP8 \ |
| 361 DISABLED_ProcessNoLossTemporalLayersVP8 | 352 DISABLED_ProcessNoLossTemporalLayersVP8 |
| 362 #else | 353 #else |
| 363 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8 | 354 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8 |
| 364 #endif | 355 #endif |
| 365 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { | 356 TEST_F(VideoProcessorIntegrationTestLibvpx, |
| 366 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | 357 MAYBE_ProcessNoLossTemporalLayersVP8) { |
| 367 kVerboseLogging); | |
| 368 SetCodecSettings(&config_, kVideoCodecVP8, 3, false, true, true, false, | 358 SetCodecSettings(&config_, kVideoCodecVP8, 3, false, true, true, false, |
| 369 kResilienceOn, kCifWidth, kCifHeight); | 359 kResilienceOn, kCifWidth, kCifHeight); |
| 370 | 360 |
| 371 RateProfile rate_profile; | 361 RateProfile rate_profile; |
| 372 SetRateProfile(&rate_profile, 0, 200, 30, 0); | 362 SetRateProfile(&rate_profile, 0, 200, 30, 0); |
| 373 SetRateProfile(&rate_profile, 1, 400, 30, 150); | 363 SetRateProfile(&rate_profile, 1, 400, 30, 150); |
| 374 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; | 364 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; |
| 375 rate_profile.num_frames = kNumFramesLong; | 365 rate_profile.num_frames = kNumFramesLong; |
| 376 | 366 |
| 377 std::vector<RateControlThresholds> rc_thresholds; | 367 std::vector<RateControlThresholds> rc_thresholds; |
| 378 AddRateControlThresholds(0, 20, 30, 10, 10, 0, 1, &rc_thresholds); | 368 AddRateControlThresholds(0, 20, 30, 10, 10, 0, 1, &rc_thresholds); |
| 379 AddRateControlThresholds(0, 0, 30, 15, 10, 0, 0, &rc_thresholds); | 369 AddRateControlThresholds(0, 0, 30, 15, 10, 0, 0, &rc_thresholds); |
| 380 | 370 |
| 381 QualityThresholds quality_thresholds(32.5, 30.0, 0.85, 0.80); | 371 QualityThresholds quality_thresholds(32.5, 30.0, 0.85, 0.80); |
| 382 | 372 |
| 383 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 373 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 384 kNoVisualizationParams); | 374 kNoVisualizationParams); |
| 385 } | 375 } |
| 386 | 376 |
| 387 } // namespace test | 377 } // namespace test |
| 388 } // namespace webrtc | 378 } // namespace webrtc |
| OLD | NEW |