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

Side by Side Diff: modules/audio_processing/intelligibility/intelligibility_enhancer.cc

Issue 1250663007: Allow webrtc compilation with stlport (Closed) Base URL: https://chromium.googlesource.com/external/webrtc/trunk/webrtc.git@master
Patch Set: Fix only .data() 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 sols[n] = 383 sols[n] =
384 (-beta0 - sqrtf(beta0 * beta0 - 4 * alpha0 * gamma0)) / (2 * alpha0); 384 (-beta0 - sqrtf(beta0 * beta0 - 4 * alpha0 * gamma0)) / (2 * alpha0);
385 } else { 385 } else {
386 sols[n] = -gamma0 / beta0; 386 sols[n] = -gamma0 / beta0;
387 } 387 }
388 sols[n] = fmax(0, sols[n]); 388 sols[n] = fmax(0, sols[n]);
389 } 389 }
390 } 390 }
391 391
392 void IntelligibilityEnhancer::FilterVariance(const float* var, float* result) { 392 void IntelligibilityEnhancer::FilterVariance(const float* var, float* result) {
393 DCHECK_GT(freqs_, 0);
393 for (int i = 0; i < bank_size_; ++i) { 394 for (int i = 0; i < bank_size_; ++i) {
394 result[i] = DotProduct(filter_bank_[i].data(), var, freqs_); 395 result[i] = DotProduct(&filter_bank_[i][0], var, freqs_);
395 } 396 }
396 } 397 }
397 398
398 float IntelligibilityEnhancer::DotProduct(const float* a, 399 float IntelligibilityEnhancer::DotProduct(const float* a,
399 const float* b, 400 const float* b,
400 int length) { 401 int length) {
401 float ret = 0.0f; 402 float ret = 0.0f;
402 403
403 for (int i = 0; i < length; ++i) { 404 for (int i = 0; i < length; ++i) {
404 ret = fmaf(a[i], b[i], ret); 405 ret = fmaf(a[i], b[i], ret);
405 } 406 }
406 return ret; 407 return ret;
407 } 408 }
408 409
409 } // namespace webrtc 410 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698