2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
11 #include "webrtc/modules/video_coding/utility/include/exp_filter.h"
18 VCMExpFilter::Reset(float alpha)
25 VCMExpFilter::Apply(float exp, float sample)
27 if (_filtered == -1.0)
29 // Initialize filtered bit rates
34 _filtered = _alpha * _filtered + (1 - _alpha) * sample;
38 float alpha = pow(_alpha, exp);
39 _filtered = alpha * _filtered + (1 - alpha) * sample;
41 if (_max != -1 && _filtered > _max)
49 VCMExpFilter::UpdateBase(float alpha)
55 VCMExpFilter::Value() const