1 /* Copyright (C) Jean-Marc Valin */
2 /**
3    @file speex_echo.h
4    @brief Echo cancellation
5 */
6 /*
7    Redistribution and use in source and binary forms, with or without
8    modification, are permitted provided that the following conditions are
9    met:
10 
11    1. Redistributions of source code must retain the above copyright notice,
12    this list of conditions and the following disclaimer.
13 
14    2. Redistributions in binary form must reproduce the above copyright
15    notice, this list of conditions and the following disclaimer in the
16    documentation and/or other materials provided with the distribution.
17 
18    3. The name of the author may not be used to endorse or promote products
19    derived from this software without specific prior written permission.
20 
21    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23    OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24    DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
25    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30    ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31    POSSIBILITY OF SUCH DAMAGE.
32 */
33 
34 #ifndef SPEEX_ECHO_H
35 #define SPEEX_ECHO_H
36 
37 #include "misc.h"
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /*struct drft_lookup;*/
44 struct SpeexEchoState_;
45 
46 typedef struct SpeexEchoState_ SpeexEchoState;
47 
48 /** Creates a new echo canceller state */
49 SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length);
50 
51 /** Destroys an echo canceller state */
52 void speex_echo_state_destroy(SpeexEchoState *st);
53 
54 /** Performs echo cancellation a frame */
55 void speex_echo_cancel(SpeexEchoState *st, short *ref, short *echo, short *out, spx_int32_t *Y);
56 
57 /** Reset the echo canceller state */
58 void speex_echo_state_reset(SpeexEchoState *st);
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
64 #endif
65