Thorvald Natvig: Fix for the fixed-point scaling of impulse response query
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Wed, 13 Feb 2008 22:08:18 +0000 (22:08 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Wed, 13 Feb 2008 22:08:18 +0000 (22:08 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@14503 0101bb08-14d6-0310-b084-bc0e0c8e3800

libspeex/mdf.c

index bc24d36..618a410 100644 (file)
@@ -1180,13 +1180,13 @@ int speex_echo_ctl(SpeexEchoState *st, int request, void *ptr)
          {
 #ifdef FIXED_POINT
             for (i=0;i<N;i++)
-               st->wtmp2[i] = EXTRACT16(PSHR32(st->W[j*N+i],16));
+               st->wtmp2[i] = EXTRACT16(PSHR32(st->W[j*N+i],16+NORMALIZE_SCALEDOWN));
             spx_ifft(st->fft_table, st->wtmp2, st->wtmp);
 #else
             spx_ifft(st->fft_table, &st->W[j*N], st->wtmp);
 #endif
             for(i=0;i<n;i++)
-               filt[j*n+i] = PSHR32(MULT16_16(32767,st->wtmp[i]), WEIGHT_SHIFT);
+               filt[j*n+i] = PSHR32(MULT16_16(32767,st->wtmp[i]), WEIGHT_SHIFT-NORMALIZE_SCALEDOWN);
          }
       }
          break;