Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 #if defined(WEBRTC_USE_H264) | 20 #if defined(WEBRTC_USE_H264) |
| 19 | 21 |
| 20 namespace { | 22 namespace { |
| 21 | 23 |
| 22 // Test settings. | |
| 23 // Only allow encoder/decoder to use single core, for predictability. | |
| 24 const bool kUseSingleCore = true; | |
| 25 const bool kVerboseLogging = false; | |
| 26 const bool kHwCodec = false; | |
| 27 | |
| 28 // Codec settings. | 24 // Codec settings. |
| 29 const bool kResilienceOn = true; | 25 const bool kResilienceOn = true; |
| 30 | |
| 31 // Default sequence is foreman (CIF): may be better to use VGA for resize test. | |
| 32 const int kCifWidth = 352; | 26 const int kCifWidth = 352; |
| 33 const int kCifHeight = 288; | 27 const int kCifHeight = 288; |
| 34 const char kForemanCif[] = "foreman_cif"; | |
| 35 const int kNumFrames = 100; | 28 const int kNumFrames = 100; |
| 36 | 29 |
| 37 const std::nullptr_t kNoVisualizationParams = nullptr; | 30 const std::nullptr_t kNoVisualizationParams = nullptr; |
| 38 | 31 |
| 39 } // namespace | 32 } // namespace |
| 40 | 33 |
| 34 class VideoProcessorIntegrationTestOpenH264 | |
| 35 : public VideoProcessorIntegrationTest { | |
| 36 protected: | |
| 37 VideoProcessorIntegrationTestOpenH264() { | |
| 38 config_.input_filename = ResourcePath("foreman_cif", "yuv"); | |
| 39 config_.output_filename = | |
| 40 TempFilename(OutputPath(), "videoprocessor_integrationtest_libvpx"); | |
| 41 config_.networking_config.packet_loss_probability = 0.0; | |
| 42 // Only allow encoder/decoder to use single core, for predictability. | |
| 43 config_.use_single_core = false; | |
|
åsapersson
2017/09/01 11:49:31
true?
brandtr
2017/09/01 13:26:27
Done.
| |
| 44 config_.verbose = false; | |
| 45 config_.hw_codec = false; | |
| 46 } | |
| 47 }; | |
| 48 | |
| 41 // H264: Run with no packet loss and fixed bitrate. Quality should be very high. | 49 // H264: Run with no packet loss and fixed bitrate. Quality should be very high. |
| 42 // Note(hbos): The PacketManipulatorImpl code used to simulate packet loss in | 50 // Note(hbos): The PacketManipulatorImpl code used to simulate packet loss in |
| 43 // these unittests appears to drop "packets" in a way that is not compatible | 51 // these unittests appears to drop "packets" in a way that is not compatible |
| 44 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have | 52 // with H264. Therefore ProcessXPercentPacketLossH264, X != 0, unittests have |
| 45 // not been added. | 53 // not been added. |
| 46 TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) { | 54 TEST_F(VideoProcessorIntegrationTestOpenH264, Process0PercentPacketLossH264) { |
| 47 SetTestConfig(&config_, kHwCodec, kUseSingleCore, 0.0f, kForemanCif, | |
| 48 kVerboseLogging); | |
| 49 SetCodecSettings(&config_, kVideoCodecH264, 1, false, false, true, false, | 55 SetCodecSettings(&config_, kVideoCodecH264, 1, false, false, true, false, |
| 50 kResilienceOn, kCifWidth, kCifHeight); | 56 kResilienceOn, kCifWidth, kCifHeight); |
| 51 | 57 |
| 52 RateProfile rate_profile; | 58 RateProfile rate_profile; |
| 53 SetRateProfile(&rate_profile, 0, 500, 30, 0); | 59 SetRateProfile(&rate_profile, 0, 500, 30, 0); |
| 54 rate_profile.frame_index_rate_update[1] = kNumFrames + 1; | 60 rate_profile.frame_index_rate_update[1] = kNumFrames + 1; |
| 55 rate_profile.num_frames = kNumFrames; | 61 rate_profile.num_frames = kNumFrames; |
| 56 | 62 |
| 57 std::vector<RateControlThresholds> rc_thresholds; | 63 std::vector<RateControlThresholds> rc_thresholds; |
| 58 AddRateControlThresholds(2, 60, 20, 10, 20, 0, 1, &rc_thresholds); | 64 AddRateControlThresholds(2, 60, 20, 10, 20, 0, 1, &rc_thresholds); |
| 59 | 65 |
| 60 QualityThresholds quality_thresholds(35.0, 25.0, 0.93, 0.70); | 66 QualityThresholds quality_thresholds(35.0, 25.0, 0.93, 0.70); |
| 61 | 67 |
| 62 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, | 68 ProcessFramesAndMaybeVerify(rate_profile, &rc_thresholds, &quality_thresholds, |
| 63 kNoVisualizationParams); | 69 kNoVisualizationParams); |
| 64 } | 70 } |
| 65 | 71 |
| 66 #endif // defined(WEBRTC_USE_H264) | 72 #endif // defined(WEBRTC_USE_H264) |
| 67 | 73 |
| 68 } // namespace test | 74 } // namespace test |
| 69 } // namespace webrtc | 75 } // namespace webrtc |
| OLD | NEW |