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

Unified Diff: webrtc/common_audio/smoothing_filter.cc

Issue 2687433004: TWCC-PLR -based FecController doesn’t need smoothing (Closed)
Patch Set: Rebased. Created 3 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
Index: webrtc/common_audio/smoothing_filter.cc
diff --git a/webrtc/common_audio/smoothing_filter.cc b/webrtc/common_audio/smoothing_filter.cc
index 2ab25981f1e3af4b4777026f212591094f75a78c..f0441e5d943259dd86b9ab6ae6d00de932bf1906 100644
--- a/webrtc/common_audio/smoothing_filter.cc
+++ b/webrtc/common_audio/smoothing_filter.cc
@@ -111,8 +111,6 @@ void SmoothingFilterImpl::ExtrapolateLastSample(int64_t time_ms) {
last_state_time_ms_ = time_ms;
}
-} // namespace webrtc
-
// Appendix: derivation of extrapolation during initialization phase.
// (LaTeX syntax)
// Assuming
@@ -140,3 +138,22 @@ void SmoothingFilterImpl::ExtrapolateLastSample(int64_t time_ms) {
// \frac{\gamma^m - \gamma^n}{1 - \gamma}
// &= \frac{T^\frac{T-m}{T} - T^\frac{T-n}{T}}{T - T^{1-\frac{1}{T}}}
// \end{align}
+
+NullSmoothingFilter::NullSmoothingFilter() = default;
+
+NullSmoothingFilter::~NullSmoothingFilter() = default;
+
+void NullSmoothingFilter::AddSample(float sample) {
+ last_sample_ = rtc::Optional<float>(sample);
+}
+
+rtc::Optional<float> NullSmoothingFilter::GetAverage() {
+ return last_sample_;
+}
+
+bool NullSmoothingFilter::SetTimeConstantMs(int time_constant_ms) {
+ RTC_NOTREACHED();
+ return false;
+}
+
+} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698