diff options
Diffstat (limited to 'src/helper.c')
-rw-r--r-- | src/helper.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/helper.c b/src/helper.c index e9e79e5..4fd9975 100644 --- a/src/helper.c +++ b/src/helper.c @@ -1,5 +1,5 @@ /* libxtract feature extraction library - * + * * Copyright (C) 2006 Jamie Bullock * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. */ @@ -33,7 +33,8 @@ #define INDEX 1 #endif -int xtract_windowed(const float *data, const int N, const void *argv, float *result){ +int xtract_windowed(const float *data, const int N, const void *argv, float *result) +{ int n; const float *window; @@ -48,7 +49,8 @@ int xtract_windowed(const float *data, const int N, const void *argv, float *res } -int xtract_features_from_subframes(const float *data, const int N, const int feature, const void *argv, float *result){ +int xtract_features_from_subframes(const float *data, const int N, const int feature, const void *argv, float *result) +{ const float *frame1, *frame2; @@ -73,7 +75,8 @@ int xtract_features_from_subframes(const float *data, const int N, const int fea } -inline int xtract_is_denormal(double const d){ +inline int xtract_is_denormal(double const d) +{ if(sizeof(d) != 2 * sizeof(int)) fprintf(stderr, "libxtract: Error: xtract_is_denormal() detects inconsistent wordlength for type 'double'\n"); @@ -81,3 +84,8 @@ inline int xtract_is_denormal(double const d){ return (l&0x7ff00000) == 0 && d!=0; //Check for 0 may not be necessary } +inline bool xtract_is_poweroftwo(unsigned int x) +{ + return ((x != 0) && !(x & (x - 1))); +} + |