Mercurial > hg > sv-dependency-builds
annotate src/libsamplerate-0.1.9/tests/util.h @ 126:4a7071416412
Current libsamplerate source
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Tue, 18 Oct 2016 13:24:45 +0100 |
parents | |
children |
rev | line source |
---|---|
cannam@126 | 1 /* |
cannam@126 | 2 ** Copyright (c) 2002-2016, Erik de Castro Lopo <erikd@mega-nerd.com> |
cannam@126 | 3 ** All rights reserved. |
cannam@126 | 4 ** |
cannam@126 | 5 ** This code is released under 2-clause BSD license. Please see the |
cannam@126 | 6 ** file at : https://github.com/erikd/libsamplerate/blob/master/COPYING |
cannam@126 | 7 */ |
cannam@126 | 8 |
cannam@126 | 9 #define ABS(a) (((a) < 0) ? - (a) : (a)) |
cannam@126 | 10 #define MIN(a,b) (((a) < (b)) ? (a) : (b)) |
cannam@126 | 11 #define MAX(a,b) (((a) >= (b)) ? (a) : (b)) |
cannam@126 | 12 |
cannam@126 | 13 #define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof ((x) [0]))) |
cannam@126 | 14 |
cannam@126 | 15 void gen_windowed_sines (int freq_count, const double *freqs, double max, float *output, int output_len) ; |
cannam@126 | 16 |
cannam@126 | 17 void save_oct_float (char *filename, float *input, int in_len, float *output, int out_len) ; |
cannam@126 | 18 void save_oct_double (char *filename, double *input, int in_len, double *output, int out_len) ; |
cannam@126 | 19 |
cannam@126 | 20 void interleave_data (const float *in, float *out, int frames, int channels) ; |
cannam@126 | 21 |
cannam@126 | 22 void deinterleave_data (const float *in, float *out, int frames, int channels) ; |
cannam@126 | 23 |
cannam@126 | 24 void reverse_data (float *data, int datalen) ; |
cannam@126 | 25 |
cannam@126 | 26 double calculate_snr (float *data, int len, int expected_peaks) ; |
cannam@126 | 27 |
cannam@126 | 28 const char * get_cpu_name (void) ; |
cannam@126 | 29 |
cannam@126 | 30 #if OS_IS_WIN32 |
cannam@126 | 31 /* |
cannam@126 | 32 ** Extra Win32 hacks. |
cannam@126 | 33 ** |
cannam@126 | 34 ** Despite Microsoft claim of windows being POSIX compatibile it has '_sleep' |
cannam@126 | 35 ** instead of 'sleep'. |
cannam@126 | 36 */ |
cannam@126 | 37 |
cannam@126 | 38 #define sleep _sleep |
cannam@126 | 39 #endif |
cannam@126 | 40 |