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

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 1523293002: Add histogram stats for average QP per frame for VP8 (for sent video streams): (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 9 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
« no previous file with comments | « webrtc/video/send_statistics_proxy.h ('k') | webrtc/video/send_statistics_proxy_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/send_statistics_proxy.cc
diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc
index 6c689bfcdb443d7c30c27328435e2a3fc0aafdc5..3d82a3b0468d121bf8fe6b2416851b2239e91a81 100644
--- a/webrtc/video/send_statistics_proxy.cc
+++ b/webrtc/video/send_statistics_proxy.cc
@@ -193,6 +193,29 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
kIndex, uma_prefix_ + "SendSideDelayMaxInMs", max_delay_ms);
}
+ for (const auto& it : qp_counters_) {
+ int qp = it.second.vp8.Avg(kMinRequiredSamples);
+ if (qp != -1) {
+ int spatial_idx = it.first;
+ if (spatial_idx == -1) {
+ RTC_LOGGED_HISTOGRAMS_COUNTS_200(kIndex, uma_prefix_ + "Encoded.Qp.Vp8",
+ qp);
+ } else if (spatial_idx == 0) {
+ RTC_LOGGED_HISTOGRAMS_COUNTS_200(kIndex,
+ uma_prefix_ + "Encoded.Qp.Vp8.S0", qp);
+ } else if (spatial_idx == 1) {
+ RTC_LOGGED_HISTOGRAMS_COUNTS_200(kIndex,
+ uma_prefix_ + "Encoded.Qp.Vp8.S1", qp);
+ } else if (spatial_idx == 2) {
+ RTC_LOGGED_HISTOGRAMS_COUNTS_200(kIndex,
+ uma_prefix_ + "Encoded.Qp.Vp8.S2", qp);
+ } else {
+ LOG(LS_WARNING) << "QP stats not recorded for VP8 spatial idx "
+ << spatial_idx;
+ }
+ }
+ }
+
if (first_rtcp_stats_time_ms_ != -1) {
int64_t elapsed_sec =
(clock_->TimeInMilliseconds() - first_rtcp_stats_time_ms_) / 1000;
@@ -427,6 +450,13 @@ void SendStatisticsProxy::OnSendEncodedImage(
}
}
+ if (encoded_image.qp_ != -1 && rtp_video_header != nullptr &&
+ rtp_video_header->codec == kRtpVideoVp8) {
+ int spatial_idx =
+ (config_.rtp.ssrcs.size() == 1) ? -1 : static_cast<int>(simulcast_idx);
+ uma_container_->qp_counters_[spatial_idx].vp8.Add(encoded_image.qp_);
+ }
+
// 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.
« no previous file with comments | « webrtc/video/send_statistics_proxy.h ('k') | webrtc/video/send_statistics_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698