| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 FrameType EncodedFrameType() override; | 244 FrameType EncodedFrameType() override; |
| 245 | 245 |
| 246 // Return the number of dropped frames. | 246 // Return the number of dropped frames. |
| 247 int NumberDroppedFrames() override; | 247 int NumberDroppedFrames() override; |
| 248 | 248 |
| 249 // Return the number of spatial resizes. | 249 // Return the number of spatial resizes. |
| 250 int NumberSpatialResizes() override; | 250 int NumberSpatialResizes() override; |
| 251 | 251 |
| 252 webrtc::VideoEncoder* const encoder_; | 252 webrtc::VideoEncoder* const encoder_; |
| 253 webrtc::VideoDecoder* const decoder_; | 253 webrtc::VideoDecoder* const decoder_; |
| 254 std::unique_ptr<VideoBitrateAllocator> bitrate_allocator_; | 254 const std::unique_ptr<VideoBitrateAllocator> bitrate_allocator_; |
| 255 |
| 256 // Adapters for the codec callbacks. |
| 257 const std::unique_ptr<EncodedImageCallback> encode_callback_; |
| 258 const std::unique_ptr<DecodedImageCallback> decode_callback_; |
| 259 |
| 260 PacketManipulator* const packet_manipulator_; |
| 261 const TestConfig& config_; |
| 262 |
| 255 // These (mandatory) file manipulators are used for, e.g., objective PSNR and | 263 // These (mandatory) file manipulators are used for, e.g., objective PSNR and |
| 256 // SSIM calculations at the end of a test run. | 264 // SSIM calculations at the end of a test run. |
| 257 FrameReader* const analysis_frame_reader_; | 265 FrameReader* const analysis_frame_reader_; |
| 258 FrameWriter* const analysis_frame_writer_; | 266 FrameWriter* const analysis_frame_writer_; |
| 259 PacketManipulator* const packet_manipulator_; | 267 |
| 260 const TestConfig& config_; | |
| 261 Stats* stats_; | |
| 262 // These (optional) file writers are used for persistently storing the output | 268 // These (optional) file writers are used for persistently storing the output |
| 263 // of the coding pipeline at different stages: pre encode (source), post | 269 // of the coding pipeline at different stages: pre encode (source), post |
| 264 // encode (encoded), and post decode (decoded). The purpose is to give the | 270 // encode (encoded), and post decode (decoded). The purpose is to give the |
| 265 // experimenter an option to subjectively evaluate the quality of the | 271 // experimenter an option to subjectively evaluate the quality of the |
| 266 // encoding, given the test settings. Each frame writer is enabled by being | 272 // encoding, given the test settings. Each frame writer is enabled by being |
| 267 // non-null. | 273 // non-null. |
| 268 FrameWriter* const source_frame_writer_; | 274 FrameWriter* const source_frame_writer_; |
| 269 IvfFileWriter* const encoded_frame_writer_; | 275 IvfFileWriter* const encoded_frame_writer_; |
| 270 FrameWriter* const decoded_frame_writer_; | 276 FrameWriter* const decoded_frame_writer_; |
| 271 | 277 |
| 272 // Adapters for the codec callbacks. | |
| 273 std::unique_ptr<EncodedImageCallback> encode_callback_; | |
| 274 std::unique_ptr<DecodedImageCallback> decode_callback_; | |
| 275 | |
| 276 // Keep track of the last successful frame, since we need to write that | 278 // Keep track of the last successful frame, since we need to write that |
| 277 // when decoding fails. | 279 // when decoding fails. |
| 278 std::unique_ptr<uint8_t[]> last_successful_frame_buffer_; | 280 std::unique_ptr<uint8_t[]> last_successful_frame_buffer_; |
| 279 // To keep track of if we have excluded the first key frame from packet loss. | 281 // To keep track of if we have excluded the first key frame from packet loss. |
| 280 bool first_key_frame_has_been_excluded_; | 282 bool first_key_frame_has_been_excluded_; |
| 281 // To tell the decoder previous frame have been dropped due to packet loss. | 283 // To tell the decoder previous frame have been dropped due to packet loss. |
| 282 bool last_frame_missing_; | 284 bool last_frame_missing_; |
| 283 // If Init() has executed successfully. | 285 // If Init() has executed successfully. |
| 284 bool initialized_; | 286 bool initialized_; |
| 285 size_t encoded_frame_size_; | 287 size_t encoded_frame_size_; |
| 286 FrameType encoded_frame_type_; | 288 FrameType encoded_frame_type_; |
| 287 int prev_time_stamp_; | 289 int prev_time_stamp_; |
| 288 int num_dropped_frames_; | |
| 289 int num_spatial_resizes_; | |
| 290 int last_encoder_frame_width_; | 290 int last_encoder_frame_width_; |
| 291 int last_encoder_frame_height_; | 291 int last_encoder_frame_height_; |
| 292 | 292 |
| 293 // Statistics. | 293 // Statistics. |
| 294 Stats* stats_; |
| 295 int num_dropped_frames_; |
| 296 int num_spatial_resizes_; |
| 294 double bit_rate_factor_; // Multiply frame length with this to get bit rate. | 297 double bit_rate_factor_; // Multiply frame length with this to get bit rate. |
| 295 int64_t encode_start_ns_; | 298 int64_t encode_start_ns_; |
| 296 int64_t decode_start_ns_; | 299 int64_t decode_start_ns_; |
| 297 }; | 300 }; |
| 298 | 301 |
| 299 } // namespace test | 302 } // namespace test |
| 300 } // namespace webrtc | 303 } // namespace webrtc |
| 301 | 304 |
| 302 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_H_ | 305 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_H_ |
| OLD | NEW |