[xiph-commits] r10715 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Mon Jan 9 04:18:04 PST 2006


Author: jm
Date: 2006-01-09 04:18:01 -0800 (Mon, 09 Jan 2006)
New Revision: 10715

Modified:
   trunk/speex/libspeex/_kiss_fft_guts.h
Log:
slight accuracy improvement for computing the fft table


Modified: trunk/speex/libspeex/_kiss_fft_guts.h
===================================================================
--- trunk/speex/libspeex/_kiss_fft_guts.h	2006-01-09 11:24:39 UTC (rev 10714)
+++ trunk/speex/libspeex/_kiss_fft_guts.h	2006-01-09 12:18:01 UTC (rev 10715)
@@ -12,6 +12,9 @@
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#define MIN(a,b) ((a)<(b) ? (a):(b))
+#define MAX(a,b) ((a)>(b) ? (a):(b))
+
 /* kiss_fft.h
    defines kiss_fft_scalar as either short or a float type
    and defines
@@ -119,8 +122,8 @@
 
 
 #ifdef FIXED_POINT
-#  define KISS_FFT_COS(phase)  floor(.5+SAMP_MAX * cos (phase))
-#  define KISS_FFT_SIN(phase)  floor(.5+SAMP_MAX * sin (phase))
+#  define KISS_FFT_COS(phase)  floor(MIN(32767,MAX(-32767,.5+32768 * cos (phase))))
+#  define KISS_FFT_SIN(phase)  floor(MIN(32767,MAX(-32767,.5+32768 * sin (phase))))
 #  define HALF_OF(x) ((x)>>1)
 #elif defined(USE_SIMD)
 #  define KISS_FFT_COS(phase) _mm_set1_ps( cos(phase) )



More information about the commits mailing list