Move MovingAverage to rtc_base/numerics and update it.

This utility class is needed in rtcp_rtp. Instead of reimplementing it
again, the existing class is moved to rtc_base, cleaned from unused
features and extended as required for the new usage.

Bug: webrtc:9914
Change-Id: I3b0d83d08d8fa5e1384b4721a93c6a90781948fd
Reviewed-on: https://webrtc-review.googlesource.com/c/109081
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25498}
This commit is contained in:
Ilya Nikolaevskiy
2018-11-05 12:55:18 +01:00
committed by Commit Bot
parent a1ead6f2ab
commit 26341990a1
10 changed files with 229 additions and 161 deletions

View File

@ -17,8 +17,8 @@
#include "absl/types/optional.h"
#include "api/video_codecs/video_encoder.h"
#include "common_types.h" // NOLINT(build/include)
#include "modules/video_coding/utility/moving_average.h"
#include "rtc_base/experiments/quality_scaling_experiment.h"
#include "rtc_base/numerics/moving_average.h"
#include "rtc_base/sequenced_task_checker.h"
namespace webrtc {
@ -79,9 +79,10 @@ class QualityScaler {
const VideoEncoder::QpThresholds thresholds_;
const int64_t sampling_period_ms_;
bool fast_rampup_ RTC_GUARDED_BY(&task_checker_);
MovingAverage average_qp_ RTC_GUARDED_BY(&task_checker_);
MovingAverage framedrop_percent_media_opt_ RTC_GUARDED_BY(&task_checker_);
MovingAverage framedrop_percent_all_ RTC_GUARDED_BY(&task_checker_);
rtc::MovingAverage average_qp_ RTC_GUARDED_BY(&task_checker_);
rtc::MovingAverage framedrop_percent_media_opt_
RTC_GUARDED_BY(&task_checker_);
rtc::MovingAverage framedrop_percent_all_ RTC_GUARDED_BY(&task_checker_);
// Used by QualityScalingExperiment.
const bool experiment_enabled_;