diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-08-01 14:00:31 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-08-01 14:00:31 +1000 |
| commit | fbebc525117f18d5751e6951bc4ffcc51f70dcc4 (patch) | |
| tree | 5725146701b816060fdd1f0979b2ff83fc4f7e24 /lib/libsamplerate/libsamplerate-0.2.2/tests/util.h | |
| parent | 55429fa6231cb576a79bbc7d6b0bf0732f5ea7a4 (diff) | |
| download | tangara-fw-fbebc525117f18d5751e6951bc4ffcc51f70dcc4.tar.gz | |
Add libsamplerate for resampling decoder output
Diffstat (limited to 'lib/libsamplerate/libsamplerate-0.2.2/tests/util.h')
| -rwxr-xr-x | lib/libsamplerate/libsamplerate-0.2.2/tests/util.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/libsamplerate/libsamplerate-0.2.2/tests/util.h b/lib/libsamplerate/libsamplerate-0.2.2/tests/util.h new file mode 100755 index 00000000..3303a29d --- /dev/null +++ b/lib/libsamplerate/libsamplerate-0.2.2/tests/util.h @@ -0,0 +1,41 @@ +/* +** Copyright (c) 2002-2016, Erik de Castro Lopo <erikd@mega-nerd.com> +** All rights reserved. +** +** This code is released under 2-clause BSD license. Please see the +** file at : https://github.com/libsndfile/libsamplerate/blob/master/COPYING +*/ + +#define ABS(a) (((a) < 0) ? - (a) : (a)) + +#ifndef MAX +#define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#endif + +#ifndef MIN +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +#define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof ((x) [0]))) + +void gen_windowed_sines (int freq_count, const double *freqs, double max, float *output, int output_len) ; + +void save_oct_float (char *filename, float *input, int in_len, float *output, int out_len) ; +void save_oct_double (char *filename, double *input, int in_len, double *output, int out_len) ; + +void interleave_data (const float *in, float *out, int frames, int channels) ; + +void deinterleave_data (const float *in, float *out, int frames, int channels) ; + +void reverse_data (float *data, int datalen) ; + +double calculate_snr (float *data, int len, int expected_peaks) ; + +const char * get_cpu_name (void) ; + +#define ASSERT(condition) \ + if (!(condition)) \ + { printf ("Condition failed on Line %d : %s\n\n", __LINE__, #condition) ; \ + exit (1) ; \ + } ; + |
