spandsp 0.0.6

test_utils.h
Go to the documentation of this file.
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * test_utils.h - Utility routines for module tests.
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2006 Steve Underwood
9 *
10 * All rights reserved.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 2.1,
14 * as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26/*! \file */
27
28#if !defined(_TEST_UTILS_H_)
29#define _TEST_UTILS_H_
30
31#include <sndfile.h>
32
33 enum
34{
35 MUNGE_CODEC_NONE = 0,
36 MUNGE_CODEC_ALAW,
37 MUNGE_CODEC_ULAW,
38 MUNGE_CODEC_G726_40K,
39 MUNGE_CODEC_G726_32K,
40 MUNGE_CODEC_G726_24K,
41 MUNGE_CODEC_G726_16K,
42};
43
44 typedef struct codec_munge_state_s codec_munge_state_t;
45
46 typedef struct complexify_state_s complexify_state_t;
47
48#ifdef __cplusplus
49 extern "C" {
50#endif
51
52SPAN_DECLARE(complexify_state_t *) complexify_init(void);
53
54SPAN_DECLARE(void) complexify_release(complexify_state_t *s);
55
56SPAN_DECLARE(complexf_t) complexify(complexify_state_t *s, int16_t amp);
57
58SPAN_DECLARE(void) fft(complex_t data[], int len);
59
60SPAN_DECLARE(void) ifft(complex_t data[], int len);
61
62SPAN_DECLARE(codec_munge_state_t *) codec_munge_init(int codec, int info);
63
64SPAN_DECLARE(void) codec_munge_release(codec_munge_state_t *s);
65
66SPAN_DECLARE(void) codec_munge(codec_munge_state_t *s, int16_t amp[], int len);
67
68SPAN_DECLARE(SNDFILE *) sf_open_telephony_read(const char *name, int channels);
69
70SPAN_DECLARE(SNDFILE *) sf_open_telephony_write(const char *name, int channels);
71
72SPAN_DECLARE(int) sf_close_telephony(SNDFILE *handle);
73
74#ifdef __cplusplus
75}
76#endif
77
78#endif
79/*- End of file ------------------------------------------------------------*/
codec_munge_state_s
Definition test_utils.c:54
complex_t
Definition complex.h:54
complexf_t
Definition complex.h:43
complexify_state_s
Definition test_utils.c:63