Improve computational performance of BWE by switching list to deque.
BUG=webrtc:6998 Review-Url: https://codereview.webrtc.org/2633293004 Cr-Commit-Position: refs/heads/master@{#16137}
This commit is contained in:
parent
1d2d78984d
commit
d3fabe51b2
@ -13,7 +13,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <list>
|
||||
#include <deque>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
@ -63,7 +63,7 @@ class MedianSlopeEstimator {
|
||||
unsigned int num_of_deltas_;
|
||||
// Theil-Sen robust line fitting
|
||||
double accumulated_delay_;
|
||||
std::list<DelayInfo> delay_hist_;
|
||||
std::deque<DelayInfo> delay_hist_;
|
||||
PercentileFilter<double> median_filter_;
|
||||
double trendline_;
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ namespace webrtc {
|
||||
|
||||
namespace {
|
||||
rtc::Optional<double> LinearFitSlope(
|
||||
const std::list<std::pair<double, double>> points) {
|
||||
const std::deque<std::pair<double, double>>& points) {
|
||||
RTC_DCHECK(points.size() >= 2);
|
||||
// Compute the "center of mass".
|
||||
double sum_x = 0;
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <list>
|
||||
#include <deque>
|
||||
#include <utility>
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
@ -61,7 +61,7 @@ class TrendlineEstimator {
|
||||
double accumulated_delay_;
|
||||
double smoothed_delay_;
|
||||
// Linear least squares regression.
|
||||
std::list<std::pair<double, double>> delay_hist_;
|
||||
std::deque<std::pair<double, double>> delay_hist_;
|
||||
double trendline_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(TrendlineEstimator);
|
||||
|
||||
@ -129,9 +129,8 @@ double OveruseEstimator::UpdateMinFramePeriod(double ts_delta) {
|
||||
if (ts_delta_hist_.size() >= kMinFramePeriodHistoryLength) {
|
||||
ts_delta_hist_.pop_front();
|
||||
}
|
||||
std::list<double>::iterator it = ts_delta_hist_.begin();
|
||||
for (; it != ts_delta_hist_.end(); it++) {
|
||||
min_frame_period = std::min(*it, min_frame_period);
|
||||
for (const double old_ts_delta : ts_delta_hist_) {
|
||||
min_frame_period = std::min(old_ts_delta, min_frame_period);
|
||||
}
|
||||
ts_delta_hist_.push_back(ts_delta);
|
||||
return min_frame_period;
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
#ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_OVERUSE_ESTIMATOR_H_
|
||||
#define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_OVERUSE_ESTIMATOR_H_
|
||||
|
||||
#include <list>
|
||||
#include <deque>
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/common_types.h"
|
||||
@ -64,7 +64,7 @@ class OveruseEstimator {
|
||||
double process_noise_[2];
|
||||
double avg_noise_;
|
||||
double var_noise_;
|
||||
std::list<double> ts_delta_hist_;
|
||||
std::deque<double> ts_delta_hist_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(OveruseEstimator);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user