# HG changeset patch # User pontscho # Date 1028029698 0 # Node ID a94cde7ef947ca443f19c9a2613aa1beb56afe7f # Parent a3867d6e2c1109ed7f58520b56b4a7fe4776d75c fix (?) equalizer distortion problem diff -r a3867d6e2c11 -r a94cde7ef947 libao2/pl_eq.c --- a/libao2/pl_eq.c Tue Jul 30 11:46:29 2002 +0000 +++ b/libao2/pl_eq.c Tue Jul 30 11:48:18 2002 +0000 @@ -146,10 +146,12 @@ // Reset buffers reset(); +#if 0 // Reset gain factors for(c=0;c> 4; register int32_t w = xt + wq[0]*pl_eq.a[k][0] + wq[1]*pl_eq.a[k][1]; @@ -196,6 +199,19 @@ // Calculate output *out=(int16_t)(yt+x); +#else + // Calculate output from AR part of current filter + register int32_t xt = (x*pl_eq.b[k][0]) / 48; + register int32_t w = xt + wq[0]*pl_eq.a[k][0] + wq[1]*pl_eq.a[k][1]; + // Calculate output form MA part of current filter + yt+=(((w + wq[1]*pl_eq.b[k][1]) >> 10)*g[k]) >> 12; + // Update circular buffer + wq[1] = wq[0]; wq[0] = w / 24576; + } + + // Calculate output + *out=(int16_t)(yt * 0.25 + x * 0.5); +#endif out+=nch; } }