Unified · Split
| @@ -1,7 +1,7 @@ | |||
| 1 | noinst_PROGRAMS = misc_test termination_test simple_test callback_test \ | 1 | noinst_PROGRAMS = misc_test termination_test simple_test callback_test \ |
| 2 | reset_test multi_channel_test snr_bw_test \ | 2 | reset_test multi_channel_test snr_bw_test \ |
| 3 | float_short_test varispeed_test callback_hang_test \ | 3 | float_short_test varispeed_test callback_hang_test \ |
| 4 | src-evaluate throughput_test | 4 | src-evaluate throughput_test downsample_test |
| 5 | 5 | ||
| 6 | SAMPLRATEDIR =../src | 6 | SAMPLRATEDIR =../src |
| 7 | INCLUDES = -I$(srcdir)/$(SAMPLRATEDIR) | 7 | INCLUDES = -I$(srcdir)/$(SAMPLRATEDIR) |
| @@ -39,6 +39,9 @@ callback_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la · 31 unmodified lines | |||
| 39 | float_short_test_SOURCES = float_short_test.c util.c util.h | 39 | float_short_test_SOURCES = float_short_test.c util.c util.h |
| 40 | float_short_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la | 40 | float_short_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la |
| 41 | 41 | ||
| 42 | downsample_test_SOURCES = downsample_test.c util.c util.h | ||
| 43 | downsample_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la | ||
| 44 | |||
| 42 | varispeed_test_SOURCES = varispeed_test.c util.c util.h calc_snr.c | 45 | varispeed_test_SOURCES = varispeed_test.c util.c util.h calc_snr.c |
| 43 | varispeed_test_CFLAGS = @FFTW3_CFLAGS@ | 46 | varispeed_test_CFLAGS = @FFTW3_CFLAGS@ |
| 44 | varispeed_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la $(FFTW3_LIBS) | 47 | varispeed_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la $(FFTW3_LIBS) |
| @@ -61,6 +64,7 @@ check: $(noinst_PROGRAMS) · 16 unmodified lines | |||
| 61 | ./misc_test | 64 | ./misc_test |
| 62 | ./termination_test | 65 | ./termination_test |
| 63 | ./callback_hang_test | 66 | ./callback_hang_test |
| 67 | ./downsample_test | ||
| 64 | ./simple_test | 68 | ./simple_test |
| 65 | ./callback_test | 69 | ./callback_test |
| 66 | ./reset_test | 70 | ./reset_test |
| @@ -0,0 +1,57 @@ | |||
| 1 | /* | ||
| 2 | ** Copyright (C) 2008 Erik de Castro Lopo <erikd@mega-nerd.com> | ||
| 3 | ** | ||
| 4 | ** This program is free software; you can redistribute it and/or modify | ||
| 5 | ** it under the terms of the GNU General Public License as published by | ||
| 6 | ** the Free Software Foundation; either version 2 of the License, or | ||
| 7 | ** (at your option) any later version. | ||
| 8 | ** | ||
| 9 | ** This program is distributed in the hope that it will be useful, | ||
| 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | ** GNU General Public License for more details. | ||
| 13 | ** | ||
| 14 | ** You should have received a copy of the GNU General Public License | ||
| 15 | ** along with this program; if not, write to the Free Software | ||
| 16 | ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #include <stdio.h> | ||
| 20 | #include <samplerate.h> | ||
| 21 | |||
| 22 | #include "util.h" | ||
| 23 | |||
| 24 | static void | ||
| 25 | downsample_test (int converter) | ||
| 26 | { static float in [1000], out[10] ; | ||
| 27 | SRC_DATA data ; | ||
| 28 | |||
| 29 | printf (" downsample_test (%-28s) ....... ", src_get_name (converter)) ; | ||
| 30 | fflush (stdout) ; | ||
| 31 | |||
| 32 | data.src_ratio = 1.0 / 255.0 ; | ||
| 33 | data.input_frames = ARRAY_LEN (in) ; | ||
| 34 | data.output_frames = ARRAY_LEN (out) ; | ||
| 35 | data.data_in = in ; | ||
| 36 | data.data_out = out ; | ||
| 37 | |||
| 38 | src_simple (&data, converter, 1) ; | ||
| 39 | |||
| 40 | puts ("ok") ; | ||
| 41 | } /* downsample_test */ | ||
| 42 | |||
| 43 | int | ||
| 44 | main (void) | ||
| 45 | { | ||
| 46 | puts ("") ; | ||
| 47 | |||
| 48 | downsample_test (SRC_ZERO_ORDER_HOLD) ; | ||
| 49 | downsample_test (SRC_LINEAR) ; | ||
| 50 | downsample_test (SRC_SINC_FASTEST) ; | ||
| 51 | downsample_test (SRC_SINC_MEDIUM_QUALITY) ; | ||
| 52 | downsample_test (SRC_SINC_BEST_QUALITY) ; | ||
| 53 | |||
| 54 | puts ("") ; | ||
| 55 | |||
| 56 | return 0 ; | ||
| 57 | } /* main */ | ||