| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 std::string name; | 53 std::string name; |
| 54 | 54 |
| 55 // More detailed description of the test. This is purely metadata and does | 55 // More detailed description of the test. This is purely metadata and does |
| 56 // not affect the test. | 56 // not affect the test. |
| 57 std::string description; | 57 std::string description; |
| 58 | 58 |
| 59 // Number of this test. Useful if multiple runs of the same test with | 59 // Number of this test. Useful if multiple runs of the same test with |
| 60 // different configurations shall be managed. | 60 // different configurations shall be managed. |
| 61 int test_number = 0; | 61 int test_number = 0; |
| 62 | 62 |
| 63 // Plain name of YUV file to process without file extension. |
| 64 std::string filename; |
| 65 |
| 63 // File to process. This must be a video file in the YUV format. | 66 // File to process. This must be a video file in the YUV format. |
| 64 std::string input_filename; | 67 std::string input_filename; |
| 65 | 68 |
| 66 // File to write to during processing for the test. Will be a video file | 69 // File to write to during processing for the test. Will be a video file |
| 67 // in the YUV format. | 70 // in the YUV format. |
| 68 std::string output_filename; | 71 std::string output_filename; |
| 69 | 72 |
| 70 // Path to the directory where encoded files will be put | 73 // Path to the directory where encoded files will be put |
| 71 // (absolute or relative to the executable). | 74 // (absolute or relative to the executable). |
| 72 std::string output_dir = "out"; | 75 std::string output_dir = "out"; |
| 73 | 76 |
| 74 // Configurations related to networking. | 77 // Configurations related to networking. |
| 75 NetworkingConfig networking_config; | 78 NetworkingConfig networking_config; |
| 76 | 79 |
| 77 // Decides how the packet loss simulations shall exclude certain frames | 80 // Decides how the packet loss simulations shall exclude certain frames |
| 78 // from packet loss. | 81 // from packet loss. |
| 79 ExcludeFrameTypes exclude_frame_types = kExcludeOnlyFirstKeyFrame; | 82 ExcludeFrameTypes exclude_frame_types = kExcludeOnlyFirstKeyFrame; |
| 80 | 83 |
| 81 // The length of a single frame of the input video file. This value is | 84 // The length of a single frame of the input video file. Calculated out of the |
| 82 // calculated out of the width and height according to the video format | 85 // width and height according to the video format specification (i.e. YUV). |
| 83 // specification. Must be set before processing. | |
| 84 size_t frame_length_in_bytes = 0; | 86 size_t frame_length_in_bytes = 0; |
| 85 | 87 |
| 86 // Force the encoder and decoder to use a single core for processing. | 88 // Force the encoder and decoder to use a single core for processing. |
| 87 // Using a single core is necessary to get a deterministic behavior for the | 89 // Using a single core is necessary to get a deterministic behavior for the |
| 88 // encoded frames - using multiple cores will produce different encoded frames | 90 // encoded frames - using multiple cores will produce different encoded frames |
| 89 // since multiple cores are competing to consume the byte budget for each | 91 // since multiple cores are competing to consume the byte budget for each |
| 90 // frame in parallel. | 92 // frame in parallel. |
| 91 // If set to false, the maximum number of available cores will be used. | 93 // If set to false, the maximum number of available cores will be used. |
| 92 bool use_single_core = false; | 94 bool use_single_core = false; |
| 93 | 95 |
| 94 // If set to a value >0 this setting forces the encoder to create a keyframe | 96 // If > 0: forces the encoder to create a keyframe every Nth frame. |
| 95 // every Nth frame. Note that the encoder may create a keyframe in other | 97 // Note that the encoder may create a keyframe in other locations in addition |
| 96 // locations in addition to the interval that is set using this parameter. | 98 // to this setting. Forcing key frames may also affect encoder planning |
| 97 // Forcing key frames may also affect encoder planning optimizations in | 99 // optimizations in a negative way, since it will suddenly be forced to |
| 98 // a negative way, since it will suddenly be forced to produce an expensive | 100 // produce an expensive key frame. |
| 99 // key frame. | |
| 100 int keyframe_interval = 0; | 101 int keyframe_interval = 0; |
| 101 | 102 |
| 102 // The codec settings to use for the test (target bitrate, video size, | 103 // The codec settings to use for the test (target bitrate, video size, |
| 103 // framerate and so on). This struct must be created and filled in using | 104 // framerate and so on). This struct must be created and filled in using |
| 104 // the VideoCodingModule::Codec() method. | 105 // the VideoCodingModule::Codec() method. |
| 105 webrtc::VideoCodec* codec_settings = nullptr; | 106 webrtc::VideoCodec* codec_settings = nullptr; |
| 106 | 107 |
| 107 // If printing of information to stdout shall be performed during processing. | 108 // If printing of information to stdout shall be performed during processing. |
| 108 bool verbose = true; | 109 bool verbose = true; |
| 110 |
| 111 // If HW or SW codec should be used. |
| 112 bool hw_codec = false; |
| 113 |
| 114 // In batch mode, the VideoProcessor is fed all the frames for processing |
| 115 // before any metrics are calculated. This is useful for pipelining HW codecs, |
| 116 // for which some calculated metrics otherwise would be incorrect. The |
| 117 // downside with batch mode is that mid-test rate allocation is not supported. |
| 118 bool batch_mode = false; |
| 109 }; | 119 }; |
| 110 | 120 |
| 111 // Handles encoding/decoding of video using the VideoEncoder/VideoDecoder | 121 // Handles encoding/decoding of video using the VideoEncoder/VideoDecoder |
| 112 // interfaces. This is done in a sequential manner in order to be able to | 122 // interfaces. This is done in a sequential manner in order to be able to |
| 113 // measure times properly. | 123 // measure times properly. |
| 114 // The class processes a frame at the time for the configured input file. | 124 // The class processes a frame at the time for the configured input file. |
| 115 // It maintains state of where in the source input file the processing is at. | 125 // It maintains state of where in the source input file the processing is at. |
| 116 // | 126 // |
| 117 // Regarding packet loss: Note that keyframes are excluded (first or all | 127 // Regarding packet loss: Note that keyframes are excluded (first or all |
| 118 // depending on the ExcludeFrameTypes setting). This is because if key frames | 128 // depending on the ExcludeFrameTypes setting). This is because if key frames |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 // Statistics. | 337 // Statistics. |
| 328 Stats* stats_; | 338 Stats* stats_; |
| 329 int num_dropped_frames_; | 339 int num_dropped_frames_; |
| 330 int num_spatial_resizes_; | 340 int num_spatial_resizes_; |
| 331 }; | 341 }; |
| 332 | 342 |
| 333 } // namespace test | 343 } // namespace test |
| 334 } // namespace webrtc | 344 } // namespace webrtc |
| 335 | 345 |
| 336 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_H_ | 346 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_H_ |
| OLD | NEW |