| 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 std::string encoded_frame_base_path; | 50 std::string encoded_frame_base_path; |
| 45 | |
| 46 Call::Config::BitrateConfig call_bitrate_config; | |
| 47 } common; | |
| 48 struct { // Video-specific settings. | |
| 49 std::string clip_name; | 51 std::string clip_name; |
| 50 } video; | 52 } video; |
| 51 struct { // Screenshare-specific settings. | 53 struct { |
| 54 bool enabled; |
| 55 bool sync_video; |
| 56 } audio; |
| 57 struct { |
| 52 bool enabled; | 58 bool enabled; |
| 53 int32_t slide_change_interval; | 59 int32_t slide_change_interval; |
| 54 int32_t scroll_duration; | 60 int32_t scroll_duration; |
| 55 } screenshare; | 61 } screenshare; |
| 56 struct { // Analyzer settings. | 62 struct { |
| 57 std::string test_label; | 63 std::string test_label; |
| 58 double avg_psnr_threshold; // (*) | 64 double avg_psnr_threshold; // (*) |
| 59 double avg_ssim_threshold; // (*) | 65 double avg_ssim_threshold; // (*) |
| 60 int test_durations_secs; | 66 int test_durations_secs; |
| 61 std::string graph_data_output_filename; | 67 std::string graph_data_output_filename; |
| 62 std::string graph_title; | 68 std::string graph_title; |
| 63 } analyzer; | 69 } analyzer; |
| 64 FakeNetworkPipe::Config pipe; | 70 FakeNetworkPipe::Config pipe; |
| 65 bool logs; | 71 bool logs; |
| 66 struct { // Spatial scalability. | 72 struct { // Spatial scalability. |
| 67 std::vector<VideoStream> streams; // If empty, one stream is assumed. | 73 std::vector<VideoStream> streams; // If empty, one stream is assumed. |
| 68 size_t selected_stream; | 74 size_t selected_stream; |
| 69 int num_spatial_layers; | 75 int num_spatial_layers; |
| 70 int selected_sl; | 76 int selected_sl; |
| 71 // If empty, bitrates are generated in VP9Impl automatically. | 77 // If empty, bitrates are generated in VP9Impl automatically. |
| 72 std::vector<SpatialLayer> spatial_layers; | 78 std::vector<SpatialLayer> spatial_layers; |
| 73 } ss; | 79 } ss; |
| 74 bool audio; | |
| 75 bool audio_video_sync; | |
| 76 }; | 80 }; |
| 77 // (*) Set to -1.1 if generating graph data for simulcast or SVC and the | 81 // (*) Set to -1.1 if generating graph data for simulcast or SVC and the |
| 78 // selected stream/layer doesn't have the same resolution as the largest | 82 // selected stream/layer doesn't have the same resolution as the largest |
| 79 // stream/layer (to ignore the PSNR and SSIM calculation errors). | 83 // stream/layer (to ignore the PSNR and SSIM calculation errors). |
| 80 | 84 |
| 81 VideoQualityTest(); | 85 VideoQualityTest(); |
| 82 void RunWithAnalyzer(const Params& params); | 86 void RunWithAnalyzer(const Params& params); |
| 83 void RunWithRenderers(const Params& params); | 87 void RunWithRenderers(const Params& params); |
| 84 | 88 |
| 85 static void FillScalabilitySettings( | 89 static void FillScalabilitySettings( |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 124 |
| 121 int receive_logs_; | 125 int receive_logs_; |
| 122 int send_logs_; | 126 int send_logs_; |
| 123 | 127 |
| 124 Params params_; | 128 Params params_; |
| 125 }; | 129 }; |
| 126 | 130 |
| 127 } // namespace webrtc | 131 } // namespace webrtc |
| 128 | 132 |
| 129 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | 133 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ |
| OLD | NEW |