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

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

Issue 2709613005: Add QP statistics to VideoProcessorIntegrationTest. (Closed)
Patch Set: rebase Created 3 years, 10 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
« no previous file with comments | « webrtc/modules/video_coding/codecs/test/stats.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 encoded_frame_size_ = encoded_image._length; 307 encoded_frame_size_ = encoded_image._length;
308 encoded_frame_type_ = encoded_image._frameType; 308 encoded_frame_type_ = encoded_image._frameType;
309 int frame_number = encoded_image._timeStamp / k90khzTimestampFrameDiff - 1; 309 int frame_number = encoded_image._timeStamp / k90khzTimestampFrameDiff - 1;
310 FrameStatistic& stat = stats_->stats_[frame_number]; 310 FrameStatistic& stat = stats_->stats_[frame_number];
311 stat.encode_time_in_us = 311 stat.encode_time_in_us =
312 GetElapsedTimeMicroseconds(encode_start_ns_, encode_stop_ns); 312 GetElapsedTimeMicroseconds(encode_start_ns_, encode_stop_ns);
313 stat.encoding_successful = true; 313 stat.encoding_successful = true;
314 stat.encoded_frame_length_in_bytes = encoded_image._length; 314 stat.encoded_frame_length_in_bytes = encoded_image._length;
315 stat.frame_number = frame_number; 315 stat.frame_number = frame_number;
316 stat.frame_type = encoded_image._frameType; 316 stat.frame_type = encoded_image._frameType;
317 stat.qp = encoded_image.qp_;
317 stat.bit_rate_in_kbps = encoded_image._length * bit_rate_factor_; 318 stat.bit_rate_in_kbps = encoded_image._length * bit_rate_factor_;
318 stat.total_packets = 319 stat.total_packets =
319 encoded_image._length / config_.networking_config.packet_size_in_bytes + 320 encoded_image._length / config_.networking_config.packet_size_in_bytes +
320 1; 321 1;
321 322
322 // Simulate packet loss. 323 // Simulate packet loss.
323 bool exclude_this_frame = false; 324 bool exclude_this_frame = false;
324 // Only keyframes can be excluded. 325 // Only keyframes can be excluded.
325 if (encoded_image._frameType == kVideoFrameKey) { 326 if (encoded_image._frameType == kVideoFrameKey) {
326 switch (config_.exclude_frame_types) { 327 switch (config_.exclude_frame_types) {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 int VideoProcessorImpl::GetElapsedTimeMicroseconds(int64_t start, 459 int VideoProcessorImpl::GetElapsedTimeMicroseconds(int64_t start,
459 int64_t stop) { 460 int64_t stop) {
460 int64_t encode_time = (stop - start) / rtc::kNumNanosecsPerMicrosec; 461 int64_t encode_time = (stop - start) / rtc::kNumNanosecsPerMicrosec;
461 RTC_DCHECK_GE(encode_time, std::numeric_limits<int>::min()); 462 RTC_DCHECK_GE(encode_time, std::numeric_limits<int>::min());
462 RTC_DCHECK_LE(encode_time, std::numeric_limits<int>::max()); 463 RTC_DCHECK_LE(encode_time, std::numeric_limits<int>::max());
463 return static_cast<int>(encode_time); 464 return static_cast<int>(encode_time);
464 } 465 }
465 466
466 } // namespace test 467 } // namespace test
467 } // namespace webrtc 468 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/test/stats.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698