Chris@0: /* Chris@0: ** Copyright (C) 2008-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: #include Chris@0: #include Chris@0: #include Chris@0: Chris@0: #include "util.h" Chris@0: Chris@0: static void Chris@0: downsample_test (int converter) Chris@0: { static float in [1000], out [10] ; Chris@0: SRC_DATA data ; Chris@0: Chris@0: printf (" downsample_test (%-28s) ....... ", src_get_name (converter)) ; Chris@0: fflush (stdout) ; Chris@0: Chris@0: data.src_ratio = 1.0 / 255.0 ; Chris@0: data.input_frames = ARRAY_LEN (in) ; Chris@0: data.output_frames = ARRAY_LEN (out) ; Chris@0: data.data_in = in ; Chris@0: data.data_out = out ; Chris@0: Chris@0: if (src_simple (&data, converter, 1)) Chris@0: { puts ("src_simple failed.") ; Chris@0: exit (1) ; Chris@0: } ; Chris@0: Chris@0: puts ("ok") ; Chris@0: } /* downsample_test */ Chris@0: Chris@0: int Chris@0: main (void) Chris@0: { Chris@0: puts ("") ; Chris@0: Chris@0: downsample_test (SRC_ZERO_ORDER_HOLD) ; Chris@0: downsample_test (SRC_LINEAR) ; Chris@0: downsample_test (SRC_SINC_FASTEST) ; Chris@0: downsample_test (SRC_SINC_MEDIUM_QUALITY) ; Chris@0: downsample_test (SRC_SINC_BEST_QUALITY) ; Chris@0: Chris@0: puts ("") ; Chris@0: Chris@0: return 0 ; Chris@0: } /* main */