Preventing an overflow when sampling rate is larger than 32767
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Sat, 28 Jul 2007 22:54:34 +0000 (22:54 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Sat, 28 Jul 2007 22:54:34 +0000 (22:54 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@13382 0101bb08-14d6-0310-b084-bc0e0c8e3800

libspeex/filterbank.c

index 187d5ee..cb7a2bc 100644 (file)
@@ -59,7 +59,7 @@ FilterBank *filterbank_new(int banks, spx_word32_t sampling, int len, int type)
    int id1;
    int id2;
    df = DIV32(SHL32(sampling,15),MULT16_16(2,len));
-   max_mel = toBARK(EXTRACT16(MULT16_16_Q15(QCONST16(.5f,15),sampling)));
+   max_mel = toBARK(EXTRACT16(sampling/2));
    mel_interval = PDIV32(max_mel,banks-1);
    
    bank = (FilterBank*)speex_alloc(sizeof(FilterBank));