Mercurial > hg > libxtract
changeset 69:99ea1aae68ec
xtract_mfcc(): Slightly different way of limiting to XTRACT_LOG_LIMIT. It's the same in theory, but saves on one assignment operation. But the real reason I did it was because my compiler (gcc 4.0.1, Apple intel edition) was getting it wrong (presumably during some optimisation). It does save on the assignment though.
author | Dan Stowell <danstowell@gmail.com> |
---|---|
date | Mon, 19 Mar 2007 15:06:55 +0000 |
parents | 9de5628b69a8 |
children | adcecb0b5d99 |
files | src/vector.c |
diffstat | 1 files changed, 1 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/vector.c Mon Mar 19 14:41:56 2007 +0000 +++ b/src/vector.c Mon Mar 19 15:06:55 2007 +0000 @@ -163,8 +163,7 @@ for(n = 0; n < N; n++){ result[filter] += input[n] * f->filters[filter][n]; } - if(result[filter] < XTRACT_LOG_LIMIT) result[filter] = XTRACT_LOG_LIMIT; - result[filter] = log(result[filter]); + result[filter] = log(result[filter] < XTRACT_LOG_LIMIT ? XTRACT_LOG_LIMIT : result[filter]); } for(n = filter + 1; n < N; n++) result[n] = 0;