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

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 1325153009: Add histogram for percentage of sent frames that are limited in resolution due to quality. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: add stats for number of times a frame is down scaled Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/video/send_statistics_proxy.cc
diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc
index 551b4b562a43904f6cfe1105d65455b2610126b9..729c3f480fed4c5ee18738f76c59243be5bae4af 100644
--- a/webrtc/video/send_statistics_proxy.cc
+++ b/webrtc/video/send_statistics_proxy.cc
@@ -62,6 +62,18 @@ void SendStatisticsProxy::UpdateHistograms() {
int encode_ms = encode_time_counter_.Avg(kMinRequiredSamples);
if (encode_ms != -1)
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.EncodeTimeInMs", encode_ms);
+
+ int quality_limited =
+ quality_limited_frame_counter_.Percent(kMinRequiredSamples);
+ if (quality_limited != -1) {
+ RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.QualityLimitedResolutionInPercent",
+ quality_limited);
+ }
+ int downscales = quality_downscales_counter_.Avg(kMinRequiredSamples);
stefan-webrtc 2015/09/23 15:08:07 What will this average represent? The average numb
åsapersson 2015/09/24 08:16:17 If a frame is downscaled, |quality_downscales_coun
stefan-webrtc 2015/09/28 13:44:29 Ok! I was mostly wondering if it was an average ov
+ if (downscales != -1) {
+ RTC_HISTOGRAM_ENUMERATION("WebRTC.Video.QualityLimitedResolutionDownscales",
+ downscales, 20);
+ }
}
void SendStatisticsProxy::OutgoingRate(const int video_channel,
@@ -162,6 +174,18 @@ void SendStatisticsProxy::OnSendEncodedImage(
stats->height = encoded_image._encodedHeight;
update_times_[ssrc].resolution_update_ms = clock_->TimeInMilliseconds();
+ if (encoded_image._length > 0) {
pbos-webrtc 2015/09/28 14:30:18 != kSkipFrame please
+ if (encoded_image.adapt_reason_.quality_available) {
+ bool downscaled =
+ encoded_image.adapt_reason_.quality_resolution_downscales > 0;
+ quality_limited_frame_counter_.Add(downscaled);
+ if (downscaled) {
+ quality_downscales_counter_.Add(
+ encoded_image.adapt_reason_.quality_resolution_downscales);
+ }
+ }
+ }
+
// TODO(asapersson): This is incorrect if simulcast layers are encoded on
// different threads and there is no guarantee that one frame of all layers
// are encoded before the next start.
@@ -274,4 +298,16 @@ int SendStatisticsProxy::SampleCounter::Avg(int min_required_samples) const {
return sum / num_samples;
}
+void SendStatisticsProxy::BoolSampleCounter::Add(bool sample) {
+ if (sample)
+ ++sum;
+ ++num_samples;
+}
+
+int SendStatisticsProxy::BoolSampleCounter::Percent(
+ int min_required_samples) const {
+ if (num_samples < min_required_samples || num_samples == 0)
+ return -1;
+ return sum * 100 / num_samples;
+}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698