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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 1420963005: Add QP stats for received video streams to StatsReport. Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: add unit test 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | webrtc/video_receive_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/receive_statistics_proxy.cc
diff --git a/webrtc/video/receive_statistics_proxy.cc b/webrtc/video/receive_statistics_proxy.cc
index 5b456a817f5511f939db3a2dbd608b5020118ec4..bd00edc4bed66d141c08bca1719ee39151730277 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -19,6 +19,9 @@
#include "webrtc/system_wrappers/interface/metrics.h"
namespace webrtc {
+namespace {
+const float kQpWeigthFactor = 0.97f;
+} // namespace
ReceiveStatisticsProxy::ReceiveStatisticsProxy(uint32_t ssrc, Clock* clock)
: clock_(clock),
@@ -26,7 +29,8 @@ ReceiveStatisticsProxy::ReceiveStatisticsProxy(uint32_t ssrc, Clock* clock)
decode_fps_estimator_(1000, 1000),
renders_fps_estimator_(1000, 1000),
render_fps_tracker_(100u, 10u),
- render_pixel_tracker_(100u, 10u) {
+ render_pixel_tracker_(100u, 10u),
+ qp_(kQpWeigthFactor) {
stats_.ssrc = ssrc;
}
@@ -194,6 +198,10 @@ void ReceiveStatisticsProxy::OnPreDecode(
if (codec_specific_info->codecType == kVideoCodecVP8) {
qp_counters_.vp8.Add(encoded_image.qp_);
}
+ qp_.Apply(1.0f, encoded_image.qp_);
+
+ rtc::CritScope lock(&crit_);
+ stats_.qp = round(qp_.filtered());
}
void ReceiveStatisticsProxy::SampleCounter::Add(int sample) {
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | webrtc/video_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698