Le jeudi 26 mai 2005 ? 13:44 -0400, Fritz Koenig a ?crit
:> In the fir_mem_up filter, the inner loop does a mac on the y0, y1, y2,
> y3 variables. What is the range of values of those variables? I would
> like to move the SHR 1 outside the loop after the mac has been done.
> Will this result in a 32 bit overflow of the y0, y2, y2 and y3 variables?
With the current range, the SHR 1 is needed in order to be 100% sure
that no overflow is possible. However, even without the shift, it takes
pathological cases for an overflow to occur (e.g. a 4kHz sine wave of
maximal amplitude) and I would not expect it on real-life signals. If
you have a CPU/DSP that supports MAC with saturation (or can live with
the fact that an overflow may appear for pathological cases), you can
definitely mode the SHR out of the loop. Of course, you can always SHR
one of the inputs at the price of a slight loss in precision.
Jean-Marc
>
> On2 Technologies, Inc.
> http://www.on2.com
>
>
>
> _______________________________________________
> Speex-dev mailing list
> Speex-dev@xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev
--
Jean-Marc Valin <Jean-Marc.Valin@USherbrooke.ca>
Universite de Sherbrooke