| 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 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 PlotVideoProcessorIntegrationTest() | 45 PlotVideoProcessorIntegrationTest() |
| 46 : bitrate_(::testing::get<0>(GetParam())), | 46 : bitrate_(::testing::get<0>(GetParam())), |
| 47 framerate_(::testing::get<1>(GetParam())), | 47 framerate_(::testing::get<1>(GetParam())), |
| 48 codec_type_(::testing::get<2>(GetParam())) {} | 48 codec_type_(::testing::get<2>(GetParam())) {} |
| 49 | 49 |
| 50 virtual ~PlotVideoProcessorIntegrationTest() {} | 50 virtual ~PlotVideoProcessorIntegrationTest() {} |
| 51 | 51 |
| 52 void RunTest(int width, int height, const std::string& filename) { | 52 void RunTest(int width, int height, const std::string& filename) { |
| 53 // Bitrate and frame rate profile. | 53 // Bitrate and frame rate profile. |
| 54 RateProfile rate_profile; | 54 RateProfile rate_profile; |
| 55 SetRateProfilePars(&rate_profile, | 55 SetRateProfile(&rate_profile, |
| 56 0, // update_index | 56 0, // update_index |
| 57 bitrate_, framerate_, | 57 bitrate_, framerate_, |
| 58 0); // frame_index_rate_update | 58 0); // frame_index_rate_update |
| 59 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; | 59 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; |
| 60 rate_profile.num_frames = kNumFramesLong; | 60 rate_profile.num_frames = kNumFramesLong; |
| 61 // Codec/network settings. | 61 // Codec/network settings. |
| 62 CodecConfigPars process_settings; | 62 CodecParams process_settings; |
| 63 SetCodecParameters(&process_settings, codec_type_, kHwCodec, kPacketLoss, | 63 SetCodecParams(&process_settings, codec_type_, kHwCodec, kPacketLoss, |
| 64 -1, // key_frame_interval | 64 -1, // key_frame_interval |
| 65 1, // num_temporal_layers | 65 1, // num_temporal_layers |
| 66 kErrorConcealmentOn, kDenoisingOn, kFrameDropperOn, | 66 kErrorConcealmentOn, kDenoisingOn, kFrameDropperOn, |
| 67 kSpatialResizeOn, width, height, filename, | 67 kSpatialResizeOn, width, height, filename, kVerboseLogging); |
| 68 kVerboseLogging); | 68 // Thresholds for expected quality (PSNR avg, PSNR min, SSIM avg, SSIM min). |
| 69 // Metrics for expected quality (PSNR avg, PSNR min, SSIM avg, SSIM min). | 69 QualityThresholds quality_thresholds; |
| 70 QualityMetrics quality_metrics; | 70 SetQualityThresholds(&quality_thresholds, 15.0, 10.0, 0.2, 0.1); |
| 71 SetQualityMetrics(&quality_metrics, 15.0, 10.0, 0.2, 0.1); | 71 // Thresholds for rate control. |
| 72 // Metrics for rate control. | 72 RateControlThresholds rc_thresholds[1]; |
| 73 RateControlMetrics rc_metrics[1]; | 73 SetRateControlThresholds(rc_thresholds, |
| 74 SetRateControlMetrics(rc_metrics, | 74 0, // update_index |
| 75 0, // update_index | 75 300, // max_num_dropped_frames, |
| 76 300, // max_num_dropped_frames, | 76 400, // max_key_frame_size_mismatch |
| 77 400, // max_key_frame_size_mismatch | 77 200, // max_delta_frame_size_mismatch |
| 78 200, // max_delta_frame_size_mismatch | 78 100, // max_encoding_rate_mismatch |
| 79 100, // max_encoding_rate_mismatch | 79 300, // max_time_hit_target |
| 80 300, // max_time_hit_target | 80 0, // num_spatial_resizes |
| 81 0, // num_spatial_resizes | 81 1); // num_key_frames |
| 82 1); // num_key_frames | 82 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
| 83 ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, | 83 rc_thresholds, &kVisualizationParams); |
| 84 rc_metrics, &kVisualizationParams); | |
| 85 } | 84 } |
| 86 const int bitrate_; | 85 const int bitrate_; |
| 87 const int framerate_; | 86 const int framerate_; |
| 88 const VideoCodecType codec_type_; | 87 const VideoCodecType codec_type_; |
| 89 }; | 88 }; |
| 90 | 89 |
| 91 INSTANTIATE_TEST_CASE_P( | 90 INSTANTIATE_TEST_CASE_P( |
| 92 CodecSettings, | 91 CodecSettings, |
| 93 PlotVideoProcessorIntegrationTest, | 92 PlotVideoProcessorIntegrationTest, |
| 94 ::testing::Combine(::testing::ValuesIn(kBitrates), | 93 ::testing::Combine(::testing::ValuesIn(kBitrates), |
| (...skipping 15 matching lines...) Expand all Loading... |
| 110 TEST_P(PlotVideoProcessorIntegrationTest, Process320x240) { | 109 TEST_P(PlotVideoProcessorIntegrationTest, Process320x240) { |
| 111 RunTest(320, 240, "foreman_320x240"); | 110 RunTest(320, 240, "foreman_320x240"); |
| 112 } | 111 } |
| 113 | 112 |
| 114 TEST_P(PlotVideoProcessorIntegrationTest, Process352x288) { | 113 TEST_P(PlotVideoProcessorIntegrationTest, Process352x288) { |
| 115 RunTest(352, 288, "foreman_cif"); | 114 RunTest(352, 288, "foreman_cif"); |
| 116 } | 115 } |
| 117 | 116 |
| 118 } // namespace test | 117 } // namespace test |
| 119 } // namespace webrtc | 118 } // namespace webrtc |
| OLD | NEW |