Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: webrtc/modules/video_coding/codecs/test/videoprocessor.h

Issue 2995603002: Move ownership of webrtc::VideoCodec into TestConfig. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 bool use_single_core = false; 94 bool use_single_core = false;
95 95
96 // If > 0: forces the encoder to create a keyframe every Nth frame. 96 // If > 0: forces the encoder to create a keyframe every Nth frame.
97 // Note that the encoder may create a keyframe in other locations in addition 97 // Note that the encoder may create a keyframe in other locations in addition
98 // to this setting. Forcing key frames may also affect encoder planning 98 // to this setting. Forcing key frames may also affect encoder planning
99 // optimizations in a negative way, since it will suddenly be forced to 99 // optimizations in a negative way, since it will suddenly be forced to
100 // produce an expensive key frame. 100 // produce an expensive key frame.
101 int keyframe_interval = 0; 101 int keyframe_interval = 0;
102 102
103 // 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,
104 // framerate and so on). This struct must be created and filled in using 104 // framerate and so on). This struct should be filled in using the
105 // the VideoCodingModule::Codec() method. 105 // VideoCodingModule::Codec() method.
106 webrtc::VideoCodec* codec_settings = nullptr; 106 webrtc::VideoCodec codec_settings;
107 107
108 // If printing of information to stdout shall be performed during processing. 108 // If printing of information to stdout shall be performed during processing.
109 bool verbose = true; 109 bool verbose = true;
110 110
111 // If HW or SW codec should be used. 111 // If HW or SW codec should be used.
112 bool hw_codec = false; 112 bool hw_codec = false;
113 113
114 // In batch mode, the VideoProcessor is fed all the frames for processing 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, 115 // before any metrics are calculated. This is useful for pipelining HW codecs,
116 // for which some calculated metrics otherwise would be incorrect. The 116 // for which some calculated metrics otherwise would be incorrect. The
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 263
264 // Invoked by the callback when a frame has completed decoding. 264 // Invoked by the callback when a frame has completed decoding.
265 void FrameDecoded(const webrtc::VideoFrame& image); 265 void FrameDecoded(const webrtc::VideoFrame& image);
266 266
267 // Use the frame number as the basis for timestamp to identify frames. Let the 267 // Use the frame number as the basis for timestamp to identify frames. Let the
268 // first timestamp be non-zero, to not make the IvfFileWriter believe that we 268 // first timestamp be non-zero, to not make the IvfFileWriter believe that we
269 // want to use capture timestamps in the IVF files. 269 // want to use capture timestamps in the IVF files.
270 uint32_t FrameNumberToTimestamp(int frame_number); 270 uint32_t FrameNumberToTimestamp(int frame_number);
271 int TimestampToFrameNumber(uint32_t timestamp); 271 int TimestampToFrameNumber(uint32_t timestamp);
272 272
273 TestConfig config_;
274
273 webrtc::VideoEncoder* const encoder_; 275 webrtc::VideoEncoder* const encoder_;
274 webrtc::VideoDecoder* const decoder_; 276 webrtc::VideoDecoder* const decoder_;
275 const std::unique_ptr<VideoBitrateAllocator> bitrate_allocator_; 277 const std::unique_ptr<VideoBitrateAllocator> bitrate_allocator_;
276 278
277 // Adapters for the codec callbacks. 279 // Adapters for the codec callbacks.
278 const std::unique_ptr<EncodedImageCallback> encode_callback_; 280 const std::unique_ptr<EncodedImageCallback> encode_callback_;
279 const std::unique_ptr<DecodedImageCallback> decode_callback_; 281 const std::unique_ptr<DecodedImageCallback> decode_callback_;
280 282
283 // Fake network.
281 PacketManipulator* const packet_manipulator_; 284 PacketManipulator* const packet_manipulator_;
282 const TestConfig& config_;
283 285
284 // These (mandatory) file manipulators are used for, e.g., objective PSNR and 286 // These (mandatory) file manipulators are used for, e.g., objective PSNR and
285 // SSIM calculations at the end of a test run. 287 // SSIM calculations at the end of a test run.
286 FrameReader* const analysis_frame_reader_; 288 FrameReader* const analysis_frame_reader_;
287 FrameWriter* const analysis_frame_writer_; 289 FrameWriter* const analysis_frame_writer_;
288 290
289 // These (optional) file writers are used to persistently store the encoded 291 // These (optional) file writers are used to persistently store the encoded
290 // and decoded bitstreams. The purpose is to give the experimenter an option 292 // and decoded bitstreams. The purpose is to give the experimenter an option
291 // to subjectively evaluate the quality of the processing. Each frame writer 293 // to subjectively evaluate the quality of the processing. Each frame writer
292 // is enabled by being non-null. 294 // is enabled by being non-null.
(...skipping 19 matching lines...) Expand all
312 // Statistics. 314 // Statistics.
313 Stats* stats_; 315 Stats* stats_;
314 int num_dropped_frames_; 316 int num_dropped_frames_;
315 int num_spatial_resizes_; 317 int num_spatial_resizes_;
316 }; 318 };
317 319
318 } // namespace test 320 } // namespace test
319 } // namespace webrtc 321 } // namespace webrtc
320 322
321 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_H_ 323 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698