annotate src/libsamplerate-0.1.9/tests/util.h @ 56:af97cad61ff0

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