OLD | NEW |
---|---|
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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 for (int i = 0; i < bank_size_; ++i) { | 393 for (int i = 0; i < bank_size_; ++i) { |
394 result[i] = DotProduct(filter_bank_[i].data(), var, freqs_); | 394 result[i] = DotProduct(&(*filter_bank_[i].begin()), var, freqs_); |
jdduke (slow)
2015/07/21 21:23:13
If freqs_ can ever be zero then I'll need to chang
Andrew MacDonald
2015/07/21 22:20:12
I think
&filter_bank_[i][0] or &filter_bank[i].fro
jdduke (slow)
2015/07/22 18:07:16
Done.
| |
395 } | 395 } |
396 } | 396 } |
397 | 397 |
398 float IntelligibilityEnhancer::DotProduct(const float* a, | 398 float IntelligibilityEnhancer::DotProduct(const float* a, |
399 const float* b, | 399 const float* b, |
400 int length) { | 400 int length) { |
401 float ret = 0.0f; | 401 float ret = 0.0f; |
402 | 402 |
403 for (int i = 0; i < length; ++i) { | 403 for (int i = 0; i < length; ++i) { |
404 ret = fmaf(a[i], b[i], ret); | 404 ret = fmaf(a[i], b[i], ret); |
405 } | 405 } |
406 return ret; | 406 return ret; |
407 } | 407 } |
408 | 408 |
409 } // namespace webrtc | 409 } // namespace webrtc |
OLD | NEW |