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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 void RunTest(int width, int height, const std::string& filename) { | 56 void RunTest(int width, int height, const std::string& filename) { |
57 // Bitrate and frame rate profile. | 57 // Bitrate and frame rate profile. |
58 RateProfile rate_profile; | 58 RateProfile rate_profile; |
59 SetRateProfile(&rate_profile, | 59 SetRateProfile(&rate_profile, |
60 0, // update_index | 60 0, // update_index |
61 bitrate_, framerate_, | 61 bitrate_, framerate_, |
62 0); // frame_index_rate_update | 62 0); // frame_index_rate_update |
63 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; | 63 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; |
64 rate_profile.num_frames = kNumFramesLong; | 64 rate_profile.num_frames = kNumFramesLong; |
| 65 |
65 // Codec/network settings. | 66 // Codec/network settings. |
66 CodecParams process_settings; | 67 CodecParams process_settings; |
67 SetCodecParams( | 68 SetCodecParams( |
68 &process_settings, codec_type_, kHwCodec, kUseSingleCore, kPacketLoss, | 69 &process_settings, codec_type_, kHwCodec, kUseSingleCore, kPacketLoss, |
69 -1, // key_frame_interval | 70 -1, // key_frame_interval |
70 1, // num_temporal_layers | 71 1, // num_temporal_layers |
71 kErrorConcealmentOn, kDenoisingOn, kFrameDropperOn, kSpatialResizeOn, | 72 kErrorConcealmentOn, kDenoisingOn, kFrameDropperOn, kSpatialResizeOn, |
72 width, height, filename, kVerboseLogging, kBatchMode); | 73 width, height, filename, kVerboseLogging, kBatchMode); |
73 // Thresholds for expected quality (PSNR avg, PSNR min, SSIM avg, SSIM min). | 74 |
| 75 // Use default thresholds for quality (PSNR and SSIM). |
74 QualityThresholds quality_thresholds; | 76 QualityThresholds quality_thresholds; |
75 SetQualityThresholds(&quality_thresholds, 15.0, 10.0, 0.2, 0.1); | 77 |
76 // Thresholds for rate control. | 78 // Use very loose thresholds for rate control, so even poor HW codecs will |
| 79 // pass the requirements. |
77 RateControlThresholds rc_thresholds[1]; | 80 RateControlThresholds rc_thresholds[1]; |
78 SetRateControlThresholds(rc_thresholds, | 81 // clang-format off |
79 0, // update_index | 82 SetRateControlThresholds( |
80 300, // max_num_dropped_frames, | 83 rc_thresholds, |
81 400, // max_key_frame_size_mismatch | 84 0, // update_index |
82 200, // max_delta_frame_size_mismatch | 85 kNumFramesLong + 1, // max_num_dropped_frames |
83 100, // max_encoding_rate_mismatch | 86 10000, // max_key_frame_size_mismatch |
84 300, // max_time_hit_target | 87 10000, // max_delta_frame_size_mismatch |
85 0, // num_spatial_resizes | 88 10000, // max_encoding_rate_mismatch |
86 1); // num_key_frames | 89 kNumFramesLong + 1, // max_time_hit_target |
| 90 0, // num_spatial_resizes |
| 91 1); // num_key_frames |
| 92 // clang-format on |
| 93 |
87 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, | 94 ProcessFramesAndVerify(quality_thresholds, rate_profile, process_settings, |
88 rc_thresholds, &kVisualizationParams); | 95 rc_thresholds, &kVisualizationParams); |
89 } | 96 } |
| 97 |
90 const int bitrate_; | 98 const int bitrate_; |
91 const int framerate_; | 99 const int framerate_; |
92 const VideoCodecType codec_type_; | 100 const VideoCodecType codec_type_; |
93 }; | 101 }; |
94 | 102 |
95 INSTANTIATE_TEST_CASE_P( | 103 INSTANTIATE_TEST_CASE_P( |
96 CodecSettings, | 104 CodecSettings, |
97 PlotVideoProcessorIntegrationTest, | 105 PlotVideoProcessorIntegrationTest, |
98 ::testing::Combine(::testing::ValuesIn(kBitrates), | 106 ::testing::Combine(::testing::ValuesIn(kBitrates), |
99 ::testing::ValuesIn(kFps), | 107 ::testing::ValuesIn(kFps), |
(...skipping 14 matching lines...) Expand all Loading... |
114 TEST_P(PlotVideoProcessorIntegrationTest, Process320x240) { | 122 TEST_P(PlotVideoProcessorIntegrationTest, Process320x240) { |
115 RunTest(320, 240, "foreman_320x240"); | 123 RunTest(320, 240, "foreman_320x240"); |
116 } | 124 } |
117 | 125 |
118 TEST_P(PlotVideoProcessorIntegrationTest, Process352x288) { | 126 TEST_P(PlotVideoProcessorIntegrationTest, Process352x288) { |
119 RunTest(352, 288, "foreman_cif"); | 127 RunTest(352, 288, "foreman_cif"); |
120 } | 128 } |
121 | 129 |
122 } // namespace test | 130 } // namespace test |
123 } // namespace webrtc | 131 } // namespace webrtc |
OLD | NEW |