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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 // Packet loss probability [0.0, 1.0]. | 34 // Packet loss probability [0.0, 1.0]. |
35 const float kPacketLoss = 0.0f; | 35 const float kPacketLoss = 0.0f; |
36 | 36 |
37 const VisualizationParams kVisualizationParams = { | 37 const VisualizationParams kVisualizationParams = { |
38 false, // save_encoded_ivf | 38 false, // save_encoded_ivf |
39 false, // save_decoded_y4m | 39 false, // save_decoded_y4m |
40 }; | 40 }; |
41 | 41 |
42 const bool kVerboseLogging = true; | 42 const bool kVerboseLogging = true; |
| 43 |
| 44 const int kNumFrames = 299; |
43 } // namespace | 45 } // namespace |
44 | 46 |
45 // Tests for plotting statistics from logs. | 47 // Tests for plotting statistics from logs. |
46 class PlotVideoProcessorIntegrationTest | 48 class PlotVideoProcessorIntegrationTest |
47 : public VideoProcessorIntegrationTest, | 49 : public VideoProcessorIntegrationTest, |
48 public ::testing::WithParamInterface< | 50 public ::testing::WithParamInterface< |
49 ::testing::tuple<int, int, VideoCodecType>> { | 51 ::testing::tuple<int, int, VideoCodecType>> { |
50 protected: | 52 protected: |
51 PlotVideoProcessorIntegrationTest() | 53 PlotVideoProcessorIntegrationTest() |
52 : bitrate_(::testing::get<0>(GetParam())), | 54 : bitrate_(::testing::get<0>(GetParam())), |
53 framerate_(::testing::get<1>(GetParam())), | 55 framerate_(::testing::get<1>(GetParam())), |
54 codec_type_(::testing::get<2>(GetParam())) {} | 56 codec_type_(::testing::get<2>(GetParam())) {} |
55 | 57 |
56 virtual ~PlotVideoProcessorIntegrationTest() {} | 58 virtual ~PlotVideoProcessorIntegrationTest() {} |
57 | 59 |
58 void RunTest(int width, int height, const std::string& filename) { | 60 void RunTest(int width, int height, const std::string& filename) { |
59 // Bitrate and frame rate profile. | 61 // Bitrate and frame rate profile. |
60 RateProfile rate_profile; | 62 RateProfile rate_profile; |
61 SetRateProfile(&rate_profile, | 63 SetRateProfile(&rate_profile, |
62 0, // update_index | 64 0, // update_index |
63 bitrate_, framerate_, | 65 bitrate_, framerate_, |
64 0); // frame_index_rate_update | 66 0); // frame_index_rate_update |
65 rate_profile.frame_index_rate_update[1] = kNumFramesLong + 1; | 67 rate_profile.frame_index_rate_update[1] = kNumFrames + 1; |
66 rate_profile.num_frames = kNumFramesLong; | 68 rate_profile.num_frames = kNumFrames; |
67 | 69 |
68 // Codec/network settings. | 70 // Codec/network settings. |
69 SetProcessParams(&config_, kHwCodec, kUseSingleCore, kPacketLoss, | 71 SetProcessParams(&config_, kHwCodec, kUseSingleCore, kPacketLoss, |
70 kKeyFrameInterval, filename, kVerboseLogging, kBatchMode); | 72 kKeyFrameInterval, filename, kVerboseLogging, kBatchMode); |
71 SetCodecSettings(&config_, codec_type_, kNumTemporalLayers, | 73 SetCodecSettings(&config_, codec_type_, kNumTemporalLayers, |
72 kErrorConcealmentOn, kDenoisingOn, kFrameDropperOn, | 74 kErrorConcealmentOn, kDenoisingOn, kFrameDropperOn, |
73 kSpatialResizeOn, kResilienceOn, width, height); | 75 kSpatialResizeOn, kResilienceOn, width, height); |
74 | 76 |
75 // Use default thresholds for quality (PSNR and SSIM). | 77 // Use default thresholds for quality (PSNR and SSIM). |
76 QualityThresholds quality_thresholds; | 78 QualityThresholds quality_thresholds; |
77 | 79 |
78 // Use very loose thresholds for rate control, so even poor HW codecs will | 80 // Use very loose thresholds for rate control, so even poor HW codecs will |
79 // pass the requirements. | 81 // pass the requirements. |
80 RateControlThresholds rc_thresholds[1]; | 82 RateControlThresholds rc_thresholds[1]; |
81 // clang-format off | 83 // clang-format off |
82 SetRateControlThresholds( | 84 SetRateControlThresholds( |
83 rc_thresholds, | 85 rc_thresholds, |
84 0, // update_index | 86 0, // update_index |
85 kNumFramesLong + 1, // max_num_dropped_frames | 87 kNumFrames + 1, // max_num_dropped_frames |
86 10000, // max_key_frame_size_mismatch | 88 10000, // max_key_frame_size_mismatch |
87 10000, // max_delta_frame_size_mismatch | 89 10000, // max_delta_frame_size_mismatch |
88 10000, // max_encoding_rate_mismatch | 90 10000, // max_encoding_rate_mismatch |
89 kNumFramesLong + 1, // max_time_hit_target | 91 kNumFrames + 1, // max_time_hit_target |
90 0, // num_spatial_resizes | 92 0, // num_spatial_resizes |
91 1); // num_key_frames | 93 1); // num_key_frames |
92 // clang-format on | 94 // clang-format on |
93 | 95 |
94 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, | 96 ProcessFramesAndVerify(quality_thresholds, rate_profile, rc_thresholds, |
95 &kVisualizationParams); | 97 &kVisualizationParams); |
96 } | 98 } |
97 | 99 |
98 const int bitrate_; | 100 const int bitrate_; |
99 const int framerate_; | 101 const int framerate_; |
100 const VideoCodecType codec_type_; | 102 const VideoCodecType codec_type_; |
101 }; | 103 }; |
(...skipping 20 matching lines...) Expand all Loading... |
122 TEST_P(PlotVideoProcessorIntegrationTest, Process320x240) { | 124 TEST_P(PlotVideoProcessorIntegrationTest, Process320x240) { |
123 RunTest(320, 240, "foreman_320x240"); | 125 RunTest(320, 240, "foreman_320x240"); |
124 } | 126 } |
125 | 127 |
126 TEST_P(PlotVideoProcessorIntegrationTest, Process352x288) { | 128 TEST_P(PlotVideoProcessorIntegrationTest, Process352x288) { |
127 RunTest(352, 288, "foreman_cif"); | 129 RunTest(352, 288, "foreman_cif"); |
128 } | 130 } |
129 | 131 |
130 } // namespace test | 132 } // namespace test |
131 } // namespace webrtc | 133 } // namespace webrtc |
OLD | NEW |