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 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 : min_avg_psnr(min_avg_psnr), | 64 : min_avg_psnr(min_avg_psnr), |
| 65 min_min_psnr(min_min_psnr), | 65 min_min_psnr(min_min_psnr), |
| 66 min_avg_ssim(min_avg_ssim), | 66 min_avg_ssim(min_avg_ssim), |
| 67 min_min_ssim(min_min_ssim) {} | 67 min_min_ssim(min_min_ssim) {} |
| 68 double min_avg_psnr; | 68 double min_avg_psnr; |
| 69 double min_min_psnr; | 69 double min_min_psnr; |
| 70 double min_avg_ssim; | 70 double min_avg_ssim; |
| 71 double min_min_ssim; | 71 double min_min_ssim; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 struct BitstreamThresholds { | |
| 75 explicit BitstreamThresholds(size_t max_nalu_length) | |
|
brandtr
2017/09/26 09:19:13
Not sure if the ctor serves a purpose together wit
ssilkin
2017/09/26 11:07:05
Agree. No need in rtc::Otional here. Changed to si
| |
| 76 : max_nalu_length(max_nalu_length) {} | |
| 77 rtc::Optional<size_t> max_nalu_length; | |
| 78 }; | |
| 79 | |
| 74 // Should video files be saved persistently to disk for post-run visualization? | 80 // Should video files be saved persistently to disk for post-run visualization? |
| 75 struct VisualizationParams { | 81 struct VisualizationParams { |
| 76 bool save_encoded_ivf; | 82 bool save_encoded_ivf; |
| 77 bool save_decoded_y4m; | 83 bool save_decoded_y4m; |
| 78 }; | 84 }; |
| 79 | 85 |
| 80 // Integration test for video processor. Encodes+decodes a clip and | 86 // Integration test for video processor. Encodes+decodes a clip and |
| 81 // writes it to the output directory. After completion, quality metrics | 87 // writes it to the output directory. After completion, quality metrics |
| 82 // (PSNR and SSIM) and rate control metrics are computed and compared to given | 88 // (PSNR and SSIM) and rate control metrics are computed and compared to given |
| 83 // thresholds, to verify that the quality and encoder response is acceptable. | 89 // thresholds, to verify that the quality and encoder response is acceptable. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 int max_bitrate_mismatch_percent, | 121 int max_bitrate_mismatch_percent, |
| 116 int max_num_frames_to_hit_target, | 122 int max_num_frames_to_hit_target, |
| 117 int num_spatial_resizes, | 123 int num_spatial_resizes, |
| 118 int num_key_frames, | 124 int num_key_frames, |
| 119 std::vector<RateControlThresholds>* rc_thresholds); | 125 std::vector<RateControlThresholds>* rc_thresholds); |
| 120 | 126 |
| 121 void ProcessFramesAndMaybeVerify( | 127 void ProcessFramesAndMaybeVerify( |
| 122 const RateProfile& rate_profile, | 128 const RateProfile& rate_profile, |
| 123 const std::vector<RateControlThresholds>* rc_thresholds, | 129 const std::vector<RateControlThresholds>* rc_thresholds, |
| 124 const QualityThresholds* quality_thresholds, | 130 const QualityThresholds* quality_thresholds, |
| 131 const BitstreamThresholds* bs_thresholds, | |
| 125 const VisualizationParams* visualization_params); | 132 const VisualizationParams* visualization_params); |
| 126 | 133 |
| 127 // Config. | 134 // Config. |
| 128 TestConfig config_; | 135 TestConfig config_; |
| 129 | 136 |
| 130 private: | 137 private: |
| 131 static const int kMaxNumTemporalLayers = 3; | 138 static const int kMaxNumTemporalLayers = 3; |
| 132 | 139 |
| 133 struct TestResults { | 140 struct TestResults { |
| 134 int KeyFrameSizeMismatchPercent() const { | 141 int KeyFrameSizeMismatchPercent() const { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 void PrintRateControlMetrics( | 192 void PrintRateControlMetrics( |
| 186 int rate_update_index, | 193 int rate_update_index, |
| 187 const std::vector<int>& num_dropped_frames, | 194 const std::vector<int>& num_dropped_frames, |
| 188 const std::vector<int>& num_spatial_resizes) const; | 195 const std::vector<int>& num_spatial_resizes) const; |
| 189 void VerifyRateControlMetrics( | 196 void VerifyRateControlMetrics( |
| 190 int rate_update_index, | 197 int rate_update_index, |
| 191 const std::vector<RateControlThresholds>* rc_thresholds, | 198 const std::vector<RateControlThresholds>* rc_thresholds, |
| 192 const std::vector<int>& num_dropped_frames, | 199 const std::vector<int>& num_dropped_frames, |
| 193 const std::vector<int>& num_spatial_resizes) const; | 200 const std::vector<int>& num_spatial_resizes) const; |
| 194 | 201 |
| 202 void VerifyBitstream(int frame_number, | |
|
hbos
2017/09/25 16:13:41
Does it make more sense for frame_number to be siz
ssilkin
2017/09/26 09:17:52
Agree. There are tons of ints in videoprocessor wh
brandtr
2017/09/26 09:19:13
You are right, but the frame numbers are ints in t
| |
| 203 const BitstreamThresholds *bs_thresholds); | |
|
hbos
2017/09/25 16:13:41
nit: const BitstreamThresholds* bs_thresholds (* i
ssilkin
2017/09/26 09:17:52
Done.
| |
| 204 | |
| 195 // Codecs. | 205 // Codecs. |
| 196 std::unique_ptr<VideoEncoder> encoder_; | 206 std::unique_ptr<VideoEncoder> encoder_; |
| 197 std::unique_ptr<cricket::WebRtcVideoDecoderFactory> decoder_factory_; | 207 std::unique_ptr<cricket::WebRtcVideoDecoderFactory> decoder_factory_; |
| 198 VideoDecoder* decoder_; | 208 VideoDecoder* decoder_; |
| 199 | 209 |
| 200 // Helper objects. | 210 // Helper objects. |
| 201 std::unique_ptr<FrameReader> analysis_frame_reader_; | 211 std::unique_ptr<FrameReader> analysis_frame_reader_; |
| 202 std::unique_ptr<FrameWriter> analysis_frame_writer_; | 212 std::unique_ptr<FrameWriter> analysis_frame_writer_; |
| 203 std::unique_ptr<IvfFileWriter> encoded_frame_writer_; | 213 std::unique_ptr<IvfFileWriter> encoded_frame_writer_; |
| 204 std::unique_ptr<FrameWriter> decoded_frame_writer_; | 214 std::unique_ptr<FrameWriter> decoded_frame_writer_; |
| 205 PacketReader packet_reader_; | 215 PacketReader packet_reader_; |
| 206 std::unique_ptr<PacketManipulator> packet_manipulator_; | 216 std::unique_ptr<PacketManipulator> packet_manipulator_; |
| 207 Stats stats_; | 217 Stats stats_; |
| 208 std::unique_ptr<VideoProcessor> processor_; | 218 std::unique_ptr<VideoProcessor> processor_; |
| 209 | 219 |
| 210 // Quantities updated for every encoded frame. | 220 // Quantities updated for every encoded frame. |
| 211 TestResults actual_; | 221 TestResults actual_; |
| 212 | 222 |
| 213 // Rates set for every encoder rate update. | 223 // Rates set for every encoder rate update. |
| 214 TargetRates target_; | 224 TargetRates target_; |
| 215 }; | 225 }; |
| 216 | 226 |
| 217 } // namespace test | 227 } // namespace test |
| 218 } // namespace webrtc | 228 } // namespace webrtc |
| 219 | 229 |
| 220 #endif // MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_INTEGRATIONTEST_H_ | 230 #endif // MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_INTEGRATIONTEST_H_ |
| OLD | NEW |