Chromium Code Reviews| Index: webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h |
| diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h |
| index 672b1d2588f0b06723ac2720ed79c0e70fc02c79..088865c10c61740e6a67ce2ef22e65f7911ae0a3 100644 |
| --- a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h |
| +++ b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h |
| @@ -13,6 +13,7 @@ |
| #include <math.h> |
| +#include <limits> |
| #include <memory> |
| #include <string> |
| #include <utility> |
| @@ -93,12 +94,12 @@ struct CodecParams { |
| bool batch_mode; |
| }; |
| -// Thresholds for the quality metrics. |
| +// Thresholds for the quality metrics. Defaults are maximally loose. |
|
sprang_webrtc
2017/03/10 09:25:10
Maximally minimal!
brandtr
2017/03/10 09:37:45
:)
|
| struct QualityThresholds { |
| - double min_avg_psnr; |
| - double min_min_psnr; |
| - double min_avg_ssim; |
| - double min_min_ssim; |
| + double min_avg_psnr = std::numeric_limits<double>::min(); |
| + double min_min_psnr = std::numeric_limits<double>::min(); |
| + double min_avg_ssim = 0; |
| + double min_min_ssim = 0; |
| }; |
| // The sequence of bit rate and frame rate changes for the encoder, the frame |
| @@ -122,8 +123,8 @@ struct RateControlThresholds { |
| int max_delta_frame_size_mismatch; |
| int max_encoding_rate_mismatch; |
| int max_time_hit_target; |
| - int num_spatial_resizes; |
| - int num_key_frames; |
| + int num_spatial_resizes; // Set to -1 to disable check. |
| + int num_key_frames; // Set to -1 to disable check. |
| }; |
| // Should video files be saved persistently to disk for post-run visualization? |
| @@ -474,8 +475,12 @@ class VideoProcessorIntegrationTest : public testing::Test { |
| printf("\n"); |
| EXPECT_LE(num_frames_to_hit_target_, rc_expected.max_time_hit_target); |
| EXPECT_LE(num_dropped_frames, rc_expected.max_num_dropped_frames); |
| - EXPECT_EQ(rc_expected.num_spatial_resizes, num_resize_actions); |
| - EXPECT_EQ(rc_expected.num_key_frames, num_key_frames_); |
| + if (rc_expected.num_spatial_resizes > 0) { |
| + EXPECT_EQ(rc_expected.num_spatial_resizes, num_resize_actions); |
| + } |
| + if (rc_expected.num_key_frames > 0) { |
| + EXPECT_EQ(rc_expected.num_key_frames, num_key_frames_); |
| + } |
| } |
| void VerifyQuality(const test::QualityMetricsResult& psnr_result, |