]> iEval git - audio-libsamplerate.git/blob - util.h
3ea764f69fb149931e135a9ce8ba54e2631c9beb
[audio-libsamplerate.git] / util.h
1 /*
2 ** Copyright (c) 2002-2016, Erik de Castro Lopo <erikd@mega-nerd.com>
3 ** All rights reserved.
4 **
5 ** This code is released under 2-clause BSD license. Please see the
6 ** file at : https://github.com/erikd/libsamplerate/blob/master/COPYING
7 */
8
9 #define ABS(a) (((a) < 0) ? - (a) : (a))
10 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
11 #define MAX(a,b) (((a) >= (b)) ? (a) : (b))
12
13 #define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof ((x) [0])))
14
15 void gen_windowed_sines (int freq_count, const double *freqs, double max, float *output, int output_len) ;
16
17 void save_oct_float (char *filename, float *input, int in_len, float *output, int out_len) ;
18 void save_oct_double (char *filename, double *input, int in_len, double *output, int out_len) ;
19
20 void interleave_data (const float *in, float *out, int frames, int channels) ;
21
22 void deinterleave_data (const float *in, float *out, int frames, int channels) ;
23
24 void reverse_data (float *data, int datalen) ;
25
26 double calculate_snr (float *data, int len, int expected_peaks) ;
27
28 const char * get_cpu_name (void) ;
29
30 #if OS_IS_WIN32
31 /*
32 ** Extra Win32 hacks.
33 **
34 ** Despite Microsoft claim of windows being POSIX compatibile it has '_sleep'
35 ** instead of 'sleep'.
36 */
37
38 #define sleep _sleep
39 #endif
40
This page took 0.03991 seconds and 3 git commands to generate.