| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 #ifndef WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | 10 #ifndef WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ |
| 11 #define WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | 11 #define WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ |
| 12 | 12 |
| 13 #include <memory> | 13 #include <memory> |
| 14 #include <string> | 14 #include <string> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "webrtc/test/call_test.h" | 17 #include "webrtc/test/call_test.h" |
| 18 #include "webrtc/test/frame_generator.h" | 18 #include "webrtc/test/frame_generator.h" |
| 19 #include "webrtc/test/testsupport/trace_to_stderr.h" | 19 #include "webrtc/test/testsupport/trace_to_stderr.h" |
| 20 | 20 |
| 21 namespace webrtc { | 21 namespace webrtc { |
| 22 | 22 |
| 23 class VideoQualityTest : public test::CallTest { | 23 class VideoQualityTest : public test::CallTest { |
| 24 public: | 24 public: |
| 25 // Parameters are grouped into smaller structs to make it easier to set | 25 // Parameters are grouped into smaller structs to make it easier to set |
| 26 // the desired elements and skip unused, using aggregate initialization. | 26 // the desired elements and skip unused, using aggregate initialization. |
| 27 // Unfortunately, C++11 (as opposed to C11) doesn't support unnamed structs, | 27 // Unfortunately, C++11 (as opposed to C11) doesn't support unnamed structs, |
| 28 // which makes the implementation of VideoQualityTest a bit uglier. | 28 // which makes the implementation of VideoQualityTest a bit uglier. |
| 29 struct Params { | 29 struct Params { |
| 30 Params(); |
| 31 ~Params(); |
| 30 struct { | 32 struct { |
| 33 bool send_side_bwe; |
| 34 Call::Config::BitrateConfig call_bitrate_config; |
| 35 } call; |
| 36 struct { |
| 37 bool enabled; |
| 31 size_t width; | 38 size_t width; |
| 32 size_t height; | 39 size_t height; |
| 33 int32_t fps; | 40 int32_t fps; |
| 34 int min_bitrate_bps; | 41 int min_bitrate_bps; |
| 35 int target_bitrate_bps; | 42 int target_bitrate_bps; |
| 36 int max_bitrate_bps; | 43 int max_bitrate_bps; |
| 37 bool suspend_below_min_bitrate; | 44 bool suspend_below_min_bitrate; |
| 38 std::string codec; | 45 std::string codec; |
| 39 int num_temporal_layers; | 46 int num_temporal_layers; |
| 40 int selected_tl; | 47 int selected_tl; |
| 41 int min_transmit_bps; | 48 int min_transmit_bps; |
| 42 bool send_side_bwe; | |
| 43 bool fec; | 49 bool fec; |
| 44 | |
| 45 Call::Config::BitrateConfig call_bitrate_config; | |
| 46 } common; | |
| 47 struct { // Video-specific settings. | |
| 48 std::string clip_name; | 50 std::string clip_name; |
| 49 } video; | 51 } video; |
| 50 struct { // Screenshare-specific settings. | 52 struct { |
| 53 bool enabled; |
| 54 bool sync_video; |
| 55 } audio; |
| 56 struct { |
| 51 bool enabled; | 57 bool enabled; |
| 52 int32_t slide_change_interval; | 58 int32_t slide_change_interval; |
| 53 int32_t scroll_duration; | 59 int32_t scroll_duration; |
| 54 } screenshare; | 60 } screenshare; |
| 55 struct { // Analyzer settings. | 61 struct { |
| 56 std::string test_label; | 62 std::string test_label; |
| 57 double avg_psnr_threshold; // (*) | 63 double avg_psnr_threshold; // (*) |
| 58 double avg_ssim_threshold; // (*) | 64 double avg_ssim_threshold; // (*) |
| 59 int test_durations_secs; | 65 int test_durations_secs; |
| 60 std::string graph_data_output_filename; | 66 std::string graph_data_output_filename; |
| 61 std::string graph_title; | 67 std::string graph_title; |
| 62 } analyzer; | 68 } analyzer; |
| 63 FakeNetworkPipe::Config pipe; | 69 FakeNetworkPipe::Config pipe; |
| 64 bool logs; | 70 bool logs; |
| 65 struct { // Spatial scalability. | 71 struct { // Spatial scalability. |
| 66 std::vector<VideoStream> streams; // If empty, one stream is assumed. | 72 std::vector<VideoStream> streams; // If empty, one stream is assumed. |
| 67 size_t selected_stream; | 73 size_t selected_stream; |
| 68 int num_spatial_layers; | 74 int num_spatial_layers; |
| 69 int selected_sl; | 75 int selected_sl; |
| 70 // If empty, bitrates are generated in VP9Impl automatically. | 76 // If empty, bitrates are generated in VP9Impl automatically. |
| 71 std::vector<SpatialLayer> spatial_layers; | 77 std::vector<SpatialLayer> spatial_layers; |
| 72 } ss; | 78 } ss; |
| 73 bool audio; | |
| 74 bool audio_video_sync; | |
| 75 }; | 79 }; |
| 76 // (*) Set to -1.1 if generating graph data for simulcast or SVC and the | 80 // (*) Set to -1.1 if generating graph data for simulcast or SVC and the |
| 77 // selected stream/layer doesn't have the same resolution as the largest | 81 // selected stream/layer doesn't have the same resolution as the largest |
| 78 // stream/layer (to ignore the PSNR and SSIM calculation errors). | 82 // stream/layer (to ignore the PSNR and SSIM calculation errors). |
| 79 | 83 |
| 80 VideoQualityTest(); | 84 VideoQualityTest(); |
| 81 void RunWithAnalyzer(const Params& params); | 85 void RunWithAnalyzer(const Params& params); |
| 82 void RunWithRenderers(const Params& params); | 86 void RunWithRenderers(const Params& params); |
| 83 | 87 |
| 84 static void FillScalabilitySettings( | 88 static void FillScalabilitySettings( |
| (...skipping 29 matching lines...) Expand all Loading... |
| 114 std::unique_ptr<VideoEncoder> encoder_; | 118 std::unique_ptr<VideoEncoder> encoder_; |
| 115 VideoCodecUnion codec_settings_; | 119 VideoCodecUnion codec_settings_; |
| 116 Clock* const clock_; | 120 Clock* const clock_; |
| 117 | 121 |
| 118 Params params_; | 122 Params params_; |
| 119 }; | 123 }; |
| 120 | 124 |
| 121 } // namespace webrtc | 125 } // namespace webrtc |
| 122 | 126 |
| 123 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | 127 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ |
| OLD | NEW |