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

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

Issue 2709613005: Add QP statistics to VideoProcessorIntegrationTest. (Closed)
Patch Set: 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
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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 encoded_frame_type_ = encoded_image._frameType; 274 encoded_frame_type_ = encoded_image._frameType;
275 int frame_number = encoded_image._timeStamp; 275 int frame_number = encoded_image._timeStamp;
276 276
277 FrameStatistic& stat = stats_->stats_[frame_number]; 277 FrameStatistic& stat = stats_->stats_[frame_number];
278 stat.encode_time_in_us = 278 stat.encode_time_in_us =
279 GetElapsedTimeMicroseconds(encode_start_ns_, encode_stop_ns); 279 GetElapsedTimeMicroseconds(encode_start_ns_, encode_stop_ns);
280 stat.encoding_successful = true; 280 stat.encoding_successful = true;
281 stat.encoded_frame_length_in_bytes = encoded_image._length; 281 stat.encoded_frame_length_in_bytes = encoded_image._length;
282 stat.frame_number = encoded_image._timeStamp; 282 stat.frame_number = encoded_image._timeStamp;
283 stat.frame_type = encoded_image._frameType; 283 stat.frame_type = encoded_image._frameType;
284 stat.qp = encoded_image.qp_;
284 stat.bit_rate_in_kbps = encoded_image._length * bit_rate_factor_; 285 stat.bit_rate_in_kbps = encoded_image._length * bit_rate_factor_;
285 stat.total_packets = 286 stat.total_packets =
286 encoded_image._length / config_.networking_config.packet_size_in_bytes + 287 encoded_image._length / config_.networking_config.packet_size_in_bytes +
287 1; 288 1;
288 289
289 // Simulate packet loss. 290 // Simulate packet loss.
290 bool exclude_this_frame = false; 291 bool exclude_this_frame = false;
291 // Only keyframes can be excluded. 292 // Only keyframes can be excluded.
292 if (encoded_image._frameType == kVideoFrameKey) { 293 if (encoded_image._frameType == kVideoFrameKey) {
293 switch (config_.exclude_frame_types) { 294 switch (config_.exclude_frame_types) {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 int VideoProcessorImpl::GetElapsedTimeMicroseconds(int64_t start, 422 int VideoProcessorImpl::GetElapsedTimeMicroseconds(int64_t start,
422 int64_t stop) { 423 int64_t stop) {
423 int64_t encode_time = (stop - start) / rtc::kNumNanosecsPerMicrosec; 424 int64_t encode_time = (stop - start) / rtc::kNumNanosecsPerMicrosec;
424 RTC_DCHECK_GE(encode_time, std::numeric_limits<int>::min()); 425 RTC_DCHECK_GE(encode_time, std::numeric_limits<int>::min());
425 RTC_DCHECK_LE(encode_time, std::numeric_limits<int>::max()); 426 RTC_DCHECK_LE(encode_time, std::numeric_limits<int>::max());
426 return static_cast<int>(encode_time); 427 return static_cast<int>(encode_time);
427 } 428 }
428 429
429 } // namespace test 430 } // namespace test
430 } // namespace webrtc 431 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698