diff options
author | Stephane Letz <letz@grame.fr> | 2011-11-04 14:47:54 +0100 |
---|---|---|
committer | Stephane Letz <letz@grame.fr> | 2011-11-04 14:47:54 +0100 |
commit | 734e45092474d2f77933dc2075bfec799b731c37 (patch) | |
tree | 9954307ae45def8d493a0eebb7648924938c792e /tests | |
parent | 2b7864ad5ebee559b459c6450ca1965b5906abbb (diff) | |
download | jack2-734e45092474d2f77933dc2075bfec799b731c37.tar.gz |
NetJack2 code cleanup.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/iodelay.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/tests/iodelay.cpp b/tests/iodelay.cpp index e6237741..66026fcb 100644 --- a/tests/iodelay.cpp +++ b/tests/iodelay.cpp @@ -76,9 +76,9 @@ MTDM::MTDM (void) : _cnt (0), _inv (0) for (i = 0, F = _freq; i < 5; i++, F++) { - F->p = 128; - F->xa = F->ya = 0.0f; - F->xf = F->yf = 0.0f; + F->p = 128; + F->xa = F->ya = 0.0f; + F->xf = F->yf = 0.0f; } } @@ -91,28 +91,28 @@ int MTDM::process (size_t len, float *ip, float *op) while (len--) { vop = 0.0f; - vip = *ip++; - for (i = 0, F = _freq; i < 5; i++, F++) - { - a = 2 * (float) M_PI * (F->p & 65535) / 65536.0; - F->p += F->f; - c = cosf (a); - s = -sinf (a); - vop += F->a * s; - F->xa += s * vip; - F->ya += c * vip; - } - *op++ = vop; - if (++_cnt == 16) - { - for (i = 0, F = _freq; i < 5; i++, F++) - { - F->xf += 1e-3f * (F->xa - F->xf + 1e-20); - F->yf += 1e-3f * (F->ya - F->yf + 1e-20); - F->xa = F->ya = 0.0f; - } + vip = *ip++; + for (i = 0, F = _freq; i < 5; i++, F++) + { + a = 2 * (float) M_PI * (F->p & 65535) / 65536.0; + F->p += F->f; + c = cosf (a); + s = -sinf (a); + vop += F->a * s; + F->xa += s * vip; + F->ya += c * vip; + } + *op++ = vop; + if (++_cnt == 16) + { + for (i = 0, F = _freq; i < 5; i++, F++) + { + F->xf += 1e-3f * (F->xa - F->xf + 1e-20); + F->yf += 1e-3f * (F->ya - F->yf + 1e-20); + F->xa = F->ya = 0.0f; + } _cnt = 0; - } + } } return 0; @@ -133,17 +133,17 @@ int MTDM::resolve (void) _err = 0.0; for (i = 0; i < 4; i++) { - F++; - p = atan2 (F->yf, F->xf) / (2 * M_PI) - d * F->f / f0; + F++; + p = atan2 (F->yf, F->xf) / (2 * M_PI) - d * F->f / f0; if (_inv) p += 0.5f; - p -= floor (p); - p *= 8; - k = (int)(floor (p + 0.5)); - e = fabs (p - k); + p -= floor (p); + p *= 8; + k = (int)(floor (p + 0.5)); + e = fabs (p - k); if (e > _err) _err = e; if (e > 0.4) return 1; - d += m * (k & 7); - m *= 8; + d += m * (k & 7); + m *= 8; } _del = 16 * d; @@ -246,7 +246,7 @@ int main (int ac, char *av []) , mtdm._del, mtdm._del * t, systemic_latency, systemic_latency/2); if (mtdm._err > 0.2) printf (" ??"); - if (mtdm._inv) printf (" Inv"); + if (mtdm._inv) printf (" Inv"); printf ("\n"); } } |