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) { |