| 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 // Test settings. |
| 19 // Only allow encoder/decoder to use single core, for predictability. |
| 20 const bool kUseSingleCore = true; |
| 21 const bool kVerboseLogging = false; |
| 19 const bool kHwCodec = false; | 22 const bool kHwCodec = false; |
| 20 const bool kBatchMode = false; | 23 const bool kBatchMode = false; |
| 21 const bool kVerboseLogging = false; | |
| 22 | 24 |
| 23 // Only allow encoder/decoder to use single core, for predictability. | 25 // Codec settings. |
| 24 const bool kUseSingleCore = true; | |
| 25 | |
| 26 // Default codec setting is on. | |
| 27 const bool kResilienceOn = true; | 26 const bool kResilienceOn = true; |
| 28 | 27 |
| 29 // Default sequence is foreman (CIF): may be better to use VGA for resize test. | 28 // Default sequence is foreman (CIF): may be better to use VGA for resize test. |
| 30 const int kCifWidth = 352; | 29 const int kCifWidth = 352; |
| 31 const int kCifHeight = 288; | 30 const int kCifHeight = 288; |
| 32 const char kForemanCif[] = "foreman_cif"; | 31 const char kForemanCif[] = "foreman_cif"; |
| 32 #if !defined(WEBRTC_IOS) |
| 33 const int kNumFramesShort = 100; |
| 34 #endif |
| 35 const int kNumFramesLong = 299; |
| 33 | 36 |
| 34 } // namespace | 37 } // namespace |
| 35 | 38 |
| 36 #if defined(WEBRTC_USE_H264) | 39 #if defined(WEBRTC_USE_H264) |
| 37 | 40 |
| 38 // H264: Run with no packet loss and fixed bitrate. Quality should be very high. | 41 // H264: Run with no packet loss and fixed bitrate. Quality should be very high. |
| 39 // Note(hbos): The PacketManipulatorImpl code used to simulate packet loss in | 42 // Note(hbos): The PacketManipulatorImpl code used to simulate packet loss in |
| 40 // these unittests appears to drop "packets" in a way that is not compatible | 43 // these unittests appears to drop "packets" in a way that is not compatible |
| 41 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have | 44 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have |
| 42 // not been added. | 45 // not been added. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 144 |
| 142 // VP9: Run with no packet loss, with an update (decrease) in frame rate. | 145 // VP9: Run with no packet loss, with an update (decrease) in frame rate. |
| 143 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. | 146 // Lower frame rate means higher per-frame-bandwidth, so easier to encode. |
| 144 // At the low bitrate in this test, this means better rate control after the | 147 // At the low bitrate in this test, this means better rate control after the |
| 145 // update(s) to lower frame rate. So expect less frame drops, and max values | 148 // update(s) to lower frame rate. So expect less frame drops, and max values |
| 146 // for the rate control metrics can be lower. One key frame (first frame only). | 149 // for the rate control metrics can be lower. One key frame (first frame only). |
| 147 // Note: quality after update should be higher but we currently compute quality | 150 // Note: quality after update should be higher but we currently compute quality |
| 148 // metrics averaged over whole sequence run. | 151 // metrics averaged over whole sequence run. |
| 149 TEST_F(VideoProcessorIntegrationTest, | 152 TEST_F(VideoProcessorIntegrationTest, |
| 150 ProcessNoLossChangeFrameRateFrameDropVP9) { | 153 ProcessNoLossChangeFrameRateFrameDropVP9) { |
| 151 config_.networking_config.packet_loss_probability = 0; | |
| 152 // Bit rate and frame rate profile. | 154 // Bit rate and frame rate profile. |
| 153 RateProfile rate_profile; | 155 RateProfile rate_profile; |
| 154 SetRateProfile(&rate_profile, 0, 100, 24, 0); | 156 SetRateProfile(&rate_profile, 0, 100, 24, 0); |
| 155 SetRateProfile(&rate_profile, 1, 100, 15, 100); | 157 SetRateProfile(&rate_profile, 1, 100, 15, 100); |
| 156 SetRateProfile(&rate_profile, 2, 100, 10, 200); | 158 SetRateProfile(&rate_profile, 2, 100, 10, 200); |
| 157 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 159 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 158 rate_profile.num_frames = kNumFramesLong; | 160 rate_profile.num_frames = kNumFramesLong; |
| 159 // Codec/network settings. | 161 // Codec/network settings. |
| 160 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 162 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 161 kVerboseLogging, kBatchMode); | 163 kVerboseLogging, kBatchMode); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 191 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); | 193 SetRateControlThresholds(rc_thresholds, 0, 0, 40, 20, 10, 20, 0, 1); |
| 192 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 194 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 193 nullptr /* visualization_params */); | 195 nullptr /* visualization_params */); |
| 194 } | 196 } |
| 195 | 197 |
| 196 // Run with no packet loss, at low bitrate. | 198 // Run with no packet loss, at low bitrate. |
| 197 // spatial_resize is on, for this low bitrate expect one resize in sequence. | 199 // spatial_resize is on, for this low bitrate expect one resize in sequence. |
| 198 // Resize happens on delta frame. Expect only one key frame (first frame). | 200 // Resize happens on delta frame. Expect only one key frame (first frame). |
| 199 TEST_F(VideoProcessorIntegrationTest, | 201 TEST_F(VideoProcessorIntegrationTest, |
| 200 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { | 202 DISABLED_ProcessNoLossSpatialResizeFrameDropVP9) { |
| 201 config_.networking_config.packet_loss_probability = 0; | |
| 202 // Bit rate and frame rate profile. | 203 // Bit rate and frame rate profile. |
| 203 RateProfile rate_profile; | 204 RateProfile rate_profile; |
| 204 SetRateProfile(&rate_profile, 0, 50, 30, 0); | 205 SetRateProfile(&rate_profile, 0, 50, 30, 0); |
| 205 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; | 206 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; |
| 206 rate_profile.num_frames = kNumFramesLong; | 207 rate_profile.num_frames = kNumFramesLong; |
| 207 // Codec/network settings. | 208 // Codec/network settings. |
| 208 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 209 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 209 kVerboseLogging, kBatchMode); | 210 kVerboseLogging, kBatchMode); |
| 210 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, true, | 211 SetCodecSettings(&config_, kVideoCodecVP9, 1, false, false, true, true, |
| 211 kResilienceOn, kCifWidth, kCifHeight); | 212 kResilienceOn, kCifWidth, kCifHeight); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 // Too slow to finish before timeout on iOS. See webrtc:4755. | 371 // Too slow to finish before timeout on iOS. See webrtc:4755. |
| 371 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 372 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| 372 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ | 373 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ |
| 373 DISABLED_ProcessNoLossChangeFrameRateFrameDropVP8 | 374 DISABLED_ProcessNoLossChangeFrameRateFrameDropVP8 |
| 374 #else | 375 #else |
| 375 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ | 376 #define MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8 \ |
| 376 ProcessNoLossChangeFrameRateFrameDropVP8 | 377 ProcessNoLossChangeFrameRateFrameDropVP8 |
| 377 #endif | 378 #endif |
| 378 TEST_F(VideoProcessorIntegrationTest, | 379 TEST_F(VideoProcessorIntegrationTest, |
| 379 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) { | 380 MAYBE_ProcessNoLossChangeFrameRateFrameDropVP8) { |
| 380 config_.networking_config.packet_loss_probability = 0; | |
| 381 // Bit rate and frame rate profile. | 381 // Bit rate and frame rate profile. |
| 382 RateProfile rate_profile; | 382 RateProfile rate_profile; |
| 383 SetRateProfile(&rate_profile, 0, 80, 24, 0); | 383 SetRateProfile(&rate_profile, 0, 80, 24, 0); |
| 384 SetRateProfile(&rate_profile, 1, 80, 15, 100); | 384 SetRateProfile(&rate_profile, 1, 80, 15, 100); |
| 385 SetRateProfile(&rate_profile, 2, 80, 10, 200); | 385 SetRateProfile(&rate_profile, 2, 80, 10, 200); |
| 386 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; | 386 rate_profile.frame_index_rate_update[3] = kNumFramesLong + 1; |
| 387 rate_profile.num_frames = kNumFramesLong; | 387 rate_profile.num_frames = kNumFramesLong; |
| 388 // Codec/network settings. | 388 // Codec/network settings. |
| 389 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 389 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 390 kVerboseLogging, kBatchMode); | 390 kVerboseLogging, kBatchMode); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 407 // No dropped frames in this test, and internal spatial resizer is off. | 407 // No dropped frames in this test, and internal spatial resizer is off. |
| 408 // One key frame (first frame only) in sequence, so no spatial resizing. | 408 // One key frame (first frame only) in sequence, so no spatial resizing. |
| 409 // Too slow to finish before timeout on iOS. See webrtc:4755. | 409 // Too slow to finish before timeout on iOS. See webrtc:4755. |
| 410 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 410 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| 411 #define MAYBE_ProcessNoLossTemporalLayersVP8 \ | 411 #define MAYBE_ProcessNoLossTemporalLayersVP8 \ |
| 412 DISABLED_ProcessNoLossTemporalLayersVP8 | 412 DISABLED_ProcessNoLossTemporalLayersVP8 |
| 413 #else | 413 #else |
| 414 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8 | 414 #define MAYBE_ProcessNoLossTemporalLayersVP8 ProcessNoLossTemporalLayersVP8 |
| 415 #endif | 415 #endif |
| 416 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { | 416 TEST_F(VideoProcessorIntegrationTest, MAYBE_ProcessNoLossTemporalLayersVP8) { |
| 417 config_.networking_config.packet_loss_probability = 0; | |
| 418 // Bit rate and frame rate profile. | 417 // Bit rate and frame rate profile. |
| 419 RateProfile rate_profile; | 418 RateProfile rate_profile; |
| 420 SetRateProfile(&rate_profile, 0, 200, 30, 0); | 419 SetRateProfile(&rate_profile, 0, 200, 30, 0); |
| 421 SetRateProfile(&rate_profile, 1, 400, 30, 150); | 420 SetRateProfile(&rate_profile, 1, 400, 30, 150); |
| 422 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; | 421 rate_profile.frame_index_rate_update[2] = kNumFramesLong + 1; |
| 423 rate_profile.num_frames = kNumFramesLong; | 422 rate_profile.num_frames = kNumFramesLong; |
| 424 // Codec/network settings. | 423 // Codec/network settings. |
| 425 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, | 424 SetProcessParams(&config_, kHwCodec, kUseSingleCore, 0.0f, -1, kForemanCif, |
| 426 kVerboseLogging, kBatchMode); | 425 kVerboseLogging, kBatchMode); |
| 427 SetCodecSettings(&config_, kVideoCodecVP8, 3, false, true, true, false, | 426 SetCodecSettings(&config_, kVideoCodecVP8, 3, false, true, true, false, |
| 428 kResilienceOn, kCifWidth, kCifHeight); | 427 kResilienceOn, kCifWidth, kCifHeight); |
| 429 // Thresholds for expected quality. | 428 // Thresholds for expected quality. |
| 430 QualityThresholds quality_thresholds(32.5, 30.0, 0.85, 0.80); | 429 QualityThresholds quality_thresholds(32.5, 30.0, 0.85, 0.80); |
| 431 // Thresholds for rate control. | 430 // Thresholds for rate control. |
| 432 RateControlThresholds rc_thresholds[2]; | 431 RateControlThresholds rc_thresholds[2]; |
| 433 SetRateControlThresholds(rc_thresholds, 0, 0, 20, 30, 10, 10, 0, 1); | 432 SetRateControlThresholds(rc_thresholds, 0, 0, 20, 30, 10, 10, 0, 1); |
| 434 SetRateControlThresholds(rc_thresholds, 1, 0, 0, 30, 15, 10, 0, 0); | 433 SetRateControlThresholds(rc_thresholds, 1, 0, 0, 30, 15, 10, 0, 0); |
| 435 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 434 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
| 436 nullptr /* visualization_params */); | 435 nullptr /* visualization_params */); |
| 437 } | 436 } |
| 438 } // namespace test | 437 } // namespace test |
| 439 } // namespace webrtc | 438 } // namespace webrtc |
| OLD | NEW |