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

Unified Diff: webrtc/modules/audio_processing/intelligibility/intelligibility_utils.cc

Issue 1242943008: Remove C++11 calls from intelligibility_utils (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/intelligibility/intelligibility_utils.cc
diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.cc b/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.cc
index d67d200689f1613391c18c138b55f504a18ffde4..730bb976e1fddacb153690b98e74d563ad84d050 100644
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.cc
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.cc
@@ -31,14 +31,6 @@ float UpdateFactor(float target, float current, float limit) {
return current + sign * fminf(delta, limit);
}
-bool cplxfinite(complex<float> c) {
- return std::isfinite(c.real()) && std::isfinite(c.imag());
-}
-
-bool cplxnormal(complex<float> c) {
- return std::isnormal(c.real()) && std::isnormal(c.imag());
-}
-
complex<float> zerofudge(complex<float> c) {
const static complex<float> fudge[7] = {{0.001f, 0.002f},
{0.008f, 0.001f},
@@ -48,7 +40,7 @@ complex<float> zerofudge(complex<float> c) {
{0.003f, 0.004f},
{0.002f, 0.009f}};
static int fudge_index = 0;
Andrew MacDonald 2015/07/22 22:17:07 Ahh, non-const static! Do we really need this zer
ekm 2015/07/22 22:45:25 I think that's saying the |skip_fudge| flag can be
Andrew MacDonald 2015/07/22 23:34:59 Got it. Is there any benefit to adding this dither
ekm 2015/07/23 00:06:26 That's a good question. I think we want the dither
- if (cplxfinite(c) && !cplxnormal(c)) {
+ if (c.real() == 0.f || c.imag() == 0.f) {
fudge_index = (fudge_index + 1) % 7;
return c + fudge[fudge_index];
}

Powered by Google App Engine
This is Rietveld 408576698