added kiss_fft_next_fast_size() to determine the next number divisible by the radices 2,3,5

This commit is contained in:
Mark Borgerding
2006-06-28 03:25:02 +00:00
parent a2c69eb8ea
commit 2cce2ea306
4 changed files with 24 additions and 1 deletions

View File

@ -383,3 +383,17 @@ void kiss_fft_cleanup(void)
tmpbuf=NULL;
ntmpbuf=0;
}
int kiss_fft_next_fast_size(int n)
{
while(1) {
int m=n;
while ( (m%2) == 0 ) m/=2;
while ( (m%3) == 0 ) m/=3;
while ( (m%5) == 0 ) m/=5;
if (m<=1)
break; /* n is completely factorable by twos, threes, and fives */
n++;
}
return n;
}