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

Side by Side Diff: webrtc/video/receive_statistics_proxy.cc

Issue 1410533004: Round Rate computations from RateTracker. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Correct first-bucket rounding. Created 5 years, 1 month 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/p2p/base/port.cc ('k') | webrtc/video/send_statistics_proxy.cc » ('j') | 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 26 matching lines...) Expand all
37 void ReceiveStatisticsProxy::UpdateHistograms() { 37 void ReceiveStatisticsProxy::UpdateHistograms() {
38 int fraction_lost = report_block_stats_.FractionLostInPercent(); 38 int fraction_lost = report_block_stats_.FractionLostInPercent();
39 if (fraction_lost != -1) { 39 if (fraction_lost != -1) {
40 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent", 40 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent",
41 fraction_lost); 41 fraction_lost);
42 } 42 }
43 const int kMinRequiredSamples = 200; 43 const int kMinRequiredSamples = 200;
44 int samples = static_cast<int>(render_fps_tracker_.TotalSampleCount()); 44 int samples = static_cast<int>(render_fps_tracker_.TotalSampleCount());
45 if (samples > kMinRequiredSamples) { 45 if (samples > kMinRequiredSamples) {
46 RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.RenderFramesPerSecond", 46 RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.RenderFramesPerSecond",
47 static_cast<int>(render_fps_tracker_.ComputeTotalRate())); 47 round(render_fps_tracker_.ComputeTotalRate()));
48 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.RenderSqrtPixelsPerSecond", 48 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.RenderSqrtPixelsPerSecond",
49 static_cast<int>(render_pixel_tracker_.ComputeTotalRate())); 49 round(render_pixel_tracker_.ComputeTotalRate()));
50 } 50 }
51 int width = render_width_counter_.Avg(kMinRequiredSamples); 51 int width = render_width_counter_.Avg(kMinRequiredSamples);
52 int height = render_height_counter_.Avg(kMinRequiredSamples); 52 int height = render_height_counter_.Avg(kMinRequiredSamples);
53 if (width != -1) { 53 if (width != -1) {
54 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedWidthInPixels", width); 54 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedWidthInPixels", width);
55 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedHeightInPixels", height); 55 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedHeightInPixels", height);
56 } 56 }
57 int qp = qp_counters_.vp8.Avg(kMinRequiredSamples); 57 int qp = qp_counters_.vp8.Avg(kMinRequiredSamples);
58 if (qp != -1) 58 if (qp != -1)
59 RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp); 59 RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 ++num_samples; 201 ++num_samples;
202 } 202 }
203 203
204 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { 204 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const {
205 if (num_samples < min_required_samples || num_samples == 0) 205 if (num_samples < min_required_samples || num_samples == 0)
206 return -1; 206 return -1;
207 return sum / num_samples; 207 return sum / num_samples;
208 } 208 }
209 209
210 } // namespace webrtc 210 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/p2p/base/port.cc ('k') | webrtc/video/send_statistics_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698