spandsp
0.0.6
|
00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * test_utils.h - Utility routines for module tests. 00005 * 00006 * Written by Steve Underwood <steveu@coppice.org> 00007 * 00008 * Copyright (C) 2006 Steve Underwood 00009 * 00010 * All rights reserved. 00011 * 00012 * This program is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License version 2.1, 00014 * as published by the Free Software Foundation. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00024 */ 00025 00026 /*! \file */ 00027 00028 #if !defined(_TEST_UTILS_H_) 00029 #define _TEST_UTILS_H_ 00030 00031 #include <sndfile.h> 00032 00033 enum 00034 { 00035 MUNGE_CODEC_NONE = 0, 00036 MUNGE_CODEC_ALAW, 00037 MUNGE_CODEC_ULAW, 00038 MUNGE_CODEC_G726_40K, 00039 MUNGE_CODEC_G726_32K, 00040 MUNGE_CODEC_G726_24K, 00041 MUNGE_CODEC_G726_16K, 00042 }; 00043 00044 typedef struct codec_munge_state_s codec_munge_state_t; 00045 00046 typedef struct complexify_state_s complexify_state_t; 00047 00048 #ifdef __cplusplus 00049 extern "C" { 00050 #endif 00051 00052 SPAN_DECLARE(complexify_state_t *) complexify_init(void); 00053 00054 SPAN_DECLARE(void) complexify_release(complexify_state_t *s); 00055 00056 SPAN_DECLARE(complexf_t) complexify(complexify_state_t *s, int16_t amp); 00057 00058 SPAN_DECLARE(void) fft(complex_t data[], int len); 00059 00060 SPAN_DECLARE(void) ifft(complex_t data[], int len); 00061 00062 SPAN_DECLARE(codec_munge_state_t *) codec_munge_init(int codec, int info); 00063 00064 SPAN_DECLARE(void) codec_munge_release(codec_munge_state_t *s); 00065 00066 SPAN_DECLARE(void) codec_munge(codec_munge_state_t *s, int16_t amp[], int len); 00067 00068 SPAN_DECLARE(SNDFILE *) sf_open_telephony_read(const char *name, int channels); 00069 00070 SPAN_DECLARE(SNDFILE *) sf_open_telephony_write(const char *name, int channels); 00071 00072 #ifdef __cplusplus 00073 } 00074 #endif 00075 00076 #endif 00077 /*- End of file ------------------------------------------------------------*/