Chris@0: /* Chris@0: ** Copyright (C) 2002-2011 Erik de Castro Lopo Chris@0: ** Chris@0: ** This program is free software; you can redistribute it and/or modify Chris@0: ** it under the terms of the GNU General Public License as published by Chris@0: ** the Free Software Foundation; either version 2 of the License, or Chris@0: ** (at your option) any later version. Chris@0: ** Chris@0: ** This program is distributed in the hope that it will be useful, Chris@0: ** but WITHOUT ANY WARRANTY; without even the implied warranty of Chris@0: ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Chris@0: ** GNU General Public License for more details. Chris@0: ** Chris@0: ** You should have received a copy of the GNU General Public License Chris@0: ** along with this program; if not, write to the Free Software Chris@0: ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. Chris@0: */ Chris@0: Chris@0: #define ABS(a) (((a) < 0) ? - (a) : (a)) Chris@0: #define MIN(a,b) (((a) < (b)) ? (a) : (b)) Chris@0: #define MAX(a,b) (((a) >= (b)) ? (a) : (b)) Chris@0: Chris@0: #define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof ((x) [0]))) Chris@0: Chris@0: void gen_windowed_sines (int freq_count, const double *freqs, double max, float *output, int output_len) ; Chris@0: Chris@0: void save_oct_float (char *filename, float *input, int in_len, float *output, int out_len) ; Chris@0: void save_oct_double (char *filename, double *input, int in_len, double *output, int out_len) ; Chris@0: Chris@0: void interleave_data (const float *in, float *out, int frames, int channels) ; Chris@0: Chris@0: void deinterleave_data (const float *in, float *out, int frames, int channels) ; Chris@0: Chris@0: void reverse_data (float *data, int datalen) ; Chris@0: Chris@0: double calculate_snr (float *data, int len, int expected_peaks) ; Chris@0: Chris@0: const char * get_cpu_name (void) ; Chris@0: Chris@0: #if OS_IS_WIN32 Chris@0: /* Chris@0: ** Extra Win32 hacks. Chris@0: ** Chris@0: ** Despite Microsoft claim of windows being POSIX compatibile it has '_sleep' Chris@0: ** instead of 'sleep'. Chris@0: */ Chris@0: Chris@0: #define sleep _sleep Chris@0: #endif Chris@0: