cannam@85: /* cannam@85: ** Copyright (C) 2008-2011 Erik de Castro Lopo cannam@85: ** cannam@85: ** This program is free software; you can redistribute it and/or modify cannam@85: ** it under the terms of the GNU General Public License as published by cannam@85: ** the Free Software Foundation; either version 2 of the License, or cannam@85: ** (at your option) any later version. cannam@85: ** cannam@85: ** This program is distributed in the hope that it will be useful, cannam@85: ** but WITHOUT ANY WARRANTY; without even the implied warranty of cannam@85: ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the cannam@85: ** GNU General Public License for more details. cannam@85: ** cannam@85: ** You should have received a copy of the GNU General Public License cannam@85: ** along with this program; if not, write to the Free Software cannam@85: ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. cannam@85: */ cannam@85: cannam@85: #include cannam@85: #include cannam@85: #include cannam@85: cannam@85: #include "util.h" cannam@85: cannam@85: static void cannam@85: downsample_test (int converter) cannam@85: { static float in [1000], out [10] ; cannam@85: SRC_DATA data ; cannam@85: cannam@85: printf (" downsample_test (%-28s) ....... ", src_get_name (converter)) ; cannam@85: fflush (stdout) ; cannam@85: cannam@85: data.src_ratio = 1.0 / 255.0 ; cannam@85: data.input_frames = ARRAY_LEN (in) ; cannam@85: data.output_frames = ARRAY_LEN (out) ; cannam@85: data.data_in = in ; cannam@85: data.data_out = out ; cannam@85: cannam@85: if (src_simple (&data, converter, 1)) cannam@85: { puts ("src_simple failed.") ; cannam@85: exit (1) ; cannam@85: } ; cannam@85: cannam@85: puts ("ok") ; cannam@85: } /* downsample_test */ cannam@85: cannam@85: int cannam@85: main (void) cannam@85: { cannam@85: puts ("") ; cannam@85: cannam@85: downsample_test (SRC_ZERO_ORDER_HOLD) ; cannam@85: downsample_test (SRC_LINEAR) ; cannam@85: downsample_test (SRC_SINC_FASTEST) ; cannam@85: downsample_test (SRC_SINC_MEDIUM_QUALITY) ; cannam@85: downsample_test (SRC_SINC_BEST_QUALITY) ; cannam@85: cannam@85: puts ("") ; cannam@85: cannam@85: return 0 ; cannam@85: } /* main */