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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/overuse_estimator.cc

Issue 1151603008: Make the BWE threshold adaptive. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix string length issue. Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 if (num_of_deltas_ > 10*30) { 139 if (num_of_deltas_ > 10*30) {
140 alpha = 0.002; 140 alpha = 0.002;
141 } 141 }
142 // Only update the noise estimate if we're not over-using. |beta| is a 142 // Only update the noise estimate if we're not over-using. |beta| is a
143 // function of alpha and the time delta since the previous update. 143 // function of alpha and the time delta since the previous update.
144 const double beta = pow(1 - alpha, ts_delta * 30.0 / 1000.0); 144 const double beta = pow(1 - alpha, ts_delta * 30.0 / 1000.0);
145 avg_noise_ = beta * avg_noise_ 145 avg_noise_ = beta * avg_noise_
146 + (1 - beta) * residual; 146 + (1 - beta) * residual;
147 var_noise_ = beta * var_noise_ 147 var_noise_ = beta * var_noise_
148 + (1 - beta) * (avg_noise_ - residual) * (avg_noise_ - residual); 148 + (1 - beta) * (avg_noise_ - residual) * (avg_noise_ - residual);
149 if (var_noise_ < 1e-7) { 149 if (var_noise_ < 1) {
150 var_noise_ = 1e-7; 150 var_noise_ = 1;
151 } 151 }
152 } 152 }
153 } // namespace webrtc 153 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698