aboutsummaryrefslogtreecommitdiff
path: root/src/vector.c
diff options
context:
space:
mode:
authorDan Stowell <danstowell@gmail.com>2007-03-19 15:06:55 +0000
committerDan Stowell <danstowell@gmail.com>2007-03-19 15:06:55 +0000
commit091e54c0f13d72307be568daabe630bb3463393c (patch)
tree0d0673e25364e8b9ce469a29d1f496d059f77ce8 /src/vector.c
parent09f660a376c245e38134800d5df676630086c849 (diff)
downloadLibXtract-091e54c0f13d72307be568daabe630bb3463393c.tar.gz
LibXtract-091e54c0f13d72307be568daabe630bb3463393c.tar.bz2
LibXtract-091e54c0f13d72307be568daabe630bb3463393c.zip
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.
Diffstat (limited to 'src/vector.c')
-rw-r--r--src/vector.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/vector.c b/src/vector.c
index 75404f0..5e5057a 100644
--- a/src/vector.c
+++ b/src/vector.c
@@ -163,8 +163,7 @@ int xtract_mfcc(const float *data, const int N, const void *argv, float *result)
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;