| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2006-2012, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bape_echo_canceller.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/1 $ |
|---|
| 12 | * $brcm_Date: 1/31/12 6:17p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: Audio Decoder Interface |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/ape/7422/bape_echo_canceller.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/1 1/31/12 6:17p jgarrett |
|---|
| 21 | * SW7425-2268: Adding initial voice conferencing support |
|---|
| 22 | * |
|---|
| 23 | ***************************************************************************/ |
|---|
| 24 | #ifndef BAPE_ECHO_CANCELLER_H_ |
|---|
| 25 | #define BAPE_ECHO_CANCELLER_H_ |
|---|
| 26 | |
|---|
| 27 | #include "bape.h" |
|---|
| 28 | |
|---|
| 29 | /*************************************************************************** |
|---|
| 30 | Summary: |
|---|
| 31 | Echo Canceller Handle |
|---|
| 32 | ***************************************************************************/ |
|---|
| 33 | typedef struct BAPE_EchoCanceller *BAPE_EchoCancellerHandle; |
|---|
| 34 | |
|---|
| 35 | /*************************************************************************** |
|---|
| 36 | Summary: |
|---|
| 37 | Echo Cancellation Algorithms |
|---|
| 38 | ***************************************************************************/ |
|---|
| 39 | typedef enum BAPE_EchoCancellerAlgorithm |
|---|
| 40 | { |
|---|
| 41 | BAPE_EchoCancellerAlgorithm_eSpeex, /* Speex Algorithm (http://www.speex.org) */ |
|---|
| 42 | BAPE_EchoCancellerAlgorithm_eMax |
|---|
| 43 | } BAPE_EchoCancellerAlgorithm; |
|---|
| 44 | |
|---|
| 45 | /*************************************************************************** |
|---|
| 46 | Summary: |
|---|
| 47 | Settings for an echo canceller |
|---|
| 48 | ***************************************************************************/ |
|---|
| 49 | typedef struct BAPE_EchoCancellerSettings |
|---|
| 50 | { |
|---|
| 51 | BAPE_EchoCancellerAlgorithm algorithm; /* What echo canceller algorithm to use */ |
|---|
| 52 | } BAPE_EchoCancellerSettings; |
|---|
| 53 | |
|---|
| 54 | /*************************************************************************** |
|---|
| 55 | Summary: |
|---|
| 56 | Get default settings for an echo canceller |
|---|
| 57 | ***************************************************************************/ |
|---|
| 58 | void BAPE_EchoCanceller_GetDefaultSettings( |
|---|
| 59 | BAPE_EchoCancellerSettings *pSettings /* [out] */ |
|---|
| 60 | ); |
|---|
| 61 | |
|---|
| 62 | /*************************************************************************** |
|---|
| 63 | Summary: |
|---|
| 64 | Create an echo canceller |
|---|
| 65 | ***************************************************************************/ |
|---|
| 66 | BERR_Code BAPE_EchoCanceller_Create( |
|---|
| 67 | BAPE_Handle deviceHandle, |
|---|
| 68 | const BAPE_EchoCancellerSettings *pSettings, |
|---|
| 69 | BAPE_EchoCancellerHandle *pHandle /* [out] */ |
|---|
| 70 | ); |
|---|
| 71 | |
|---|
| 72 | /*************************************************************************** |
|---|
| 73 | Summary: |
|---|
| 74 | Destroy an echo canceller |
|---|
| 75 | ***************************************************************************/ |
|---|
| 76 | void BAPE_EchoCanceller_Destroy( |
|---|
| 77 | BAPE_EchoCancellerHandle handle |
|---|
| 78 | ); |
|---|
| 79 | |
|---|
| 80 | /*************************************************************************** |
|---|
| 81 | Summary: |
|---|
| 82 | Get Settings for an echo canceller |
|---|
| 83 | ***************************************************************************/ |
|---|
| 84 | void BAPE_EchoCanceller_GetSettings( |
|---|
| 85 | BAPE_EchoCancellerHandle handle, |
|---|
| 86 | BAPE_EchoCancellerSettings *pSettings /* [out] Settings */ |
|---|
| 87 | ); |
|---|
| 88 | |
|---|
| 89 | /*************************************************************************** |
|---|
| 90 | Summary: |
|---|
| 91 | Set Settings for an echo canceller |
|---|
| 92 | ***************************************************************************/ |
|---|
| 93 | BERR_Code BAPE_EchoCanceller_SetSettings( |
|---|
| 94 | BAPE_EchoCancellerHandle handle, |
|---|
| 95 | const BAPE_EchoCancellerSettings *pSettings |
|---|
| 96 | ); |
|---|
| 97 | |
|---|
| 98 | /*************************************************************************** |
|---|
| 99 | Summary: |
|---|
| 100 | Speex Echo Canceller Gain Modes |
|---|
| 101 | ***************************************************************************/ |
|---|
| 102 | typedef enum BAPE_SpeexEchoCancellerGainMode |
|---|
| 103 | { |
|---|
| 104 | BAPE_SpeexEchoCancellerGainMode_eBark, /* Bark mode (default). Provides faster response. */ |
|---|
| 105 | BAPE_SpeexEchoCancellerGainMode_eLinear, /* Linear mode (optional). Provides higher quality but slower. */ |
|---|
| 106 | BAPE_SpeexEchoCancellerGainMode_eMax |
|---|
| 107 | } BAPE_SpeexEchoCancellerGainMode; |
|---|
| 108 | |
|---|
| 109 | /*************************************************************************** |
|---|
| 110 | Summary: |
|---|
| 111 | Speex Echo Canceller Settings |
|---|
| 112 | ***************************************************************************/ |
|---|
| 113 | typedef struct BAPE_SpeexEchoCancellerSettings |
|---|
| 114 | { |
|---|
| 115 | BAPE_SpeexEchoCancellerGainMode gainMode; |
|---|
| 116 | } BAPE_SpeexEchoCancellerSettings; |
|---|
| 117 | |
|---|
| 118 | /*************************************************************************** |
|---|
| 119 | Summary: |
|---|
| 120 | Echo Canceller Algorithm Settings |
|---|
| 121 | ***************************************************************************/ |
|---|
| 122 | typedef struct BAPE_EchoCancellerAlgorithmSettings |
|---|
| 123 | { |
|---|
| 124 | BAPE_EchoCancellerAlgorithm algorithm; |
|---|
| 125 | |
|---|
| 126 | union |
|---|
| 127 | { |
|---|
| 128 | BAPE_SpeexEchoCancellerSettings speex; /* Settings for Speex Echo Canceller */ |
|---|
| 129 | } algorithmSettings; |
|---|
| 130 | } BAPE_EchoCancellerAlgorithmSettings; |
|---|
| 131 | |
|---|
| 132 | /*************************************************************************** |
|---|
| 133 | Summary: |
|---|
| 134 | Get Echo Canceller Algorithm Settings |
|---|
| 135 | ***************************************************************************/ |
|---|
| 136 | void BAPE_EchoCanceller_GetAlgorithmSettings( |
|---|
| 137 | BAPE_EchoCancellerHandle handle, |
|---|
| 138 | BAPE_EchoCancellerAlgorithm algorithm, |
|---|
| 139 | BAPE_EchoCancellerAlgorithmSettings *pSettings /* [out] */ |
|---|
| 140 | ); |
|---|
| 141 | |
|---|
| 142 | /*************************************************************************** |
|---|
| 143 | Summary: |
|---|
| 144 | Set Echo Canceller Algorithm Settings |
|---|
| 145 | ***************************************************************************/ |
|---|
| 146 | BERR_Code BAPE_EchoCanceller_SetAlgorithmSettings( |
|---|
| 147 | BAPE_EchoCancellerHandle handle, |
|---|
| 148 | const BAPE_EchoCancellerAlgorithmSettings *pSettings |
|---|
| 149 | ); |
|---|
| 150 | |
|---|
| 151 | /*************************************************************************** |
|---|
| 152 | Summary: |
|---|
| 153 | Get the audio connector for an Audio EchoCanceller stage |
|---|
| 154 | ***************************************************************************/ |
|---|
| 155 | void BAPE_EchoCanceller_GetConnector( |
|---|
| 156 | BAPE_EchoCancellerHandle handle, |
|---|
| 157 | BAPE_Connector *pConnector /* [out] */ |
|---|
| 158 | ); |
|---|
| 159 | |
|---|
| 160 | /*************************************************************************** |
|---|
| 161 | Summary: |
|---|
| 162 | Add a local (near-end) input to the echo canceller |
|---|
| 163 | ***************************************************************************/ |
|---|
| 164 | BERR_Code BAPE_EchoCanceller_AddLocalInput( |
|---|
| 165 | BAPE_EchoCancellerHandle handle, |
|---|
| 166 | BAPE_Connector input |
|---|
| 167 | ); |
|---|
| 168 | |
|---|
| 169 | /*************************************************************************** |
|---|
| 170 | Summary: |
|---|
| 171 | Remove a local (near-end) input from this processing stage |
|---|
| 172 | ***************************************************************************/ |
|---|
| 173 | BERR_Code BAPE_EchoCanceller_RemoveLocalInput( |
|---|
| 174 | BAPE_EchoCancellerHandle handle, |
|---|
| 175 | BAPE_Connector input |
|---|
| 176 | ); |
|---|
| 177 | |
|---|
| 178 | /*************************************************************************** |
|---|
| 179 | Summary: |
|---|
| 180 | Add a remote (far-end) input to the echo canceller |
|---|
| 181 | ***************************************************************************/ |
|---|
| 182 | BERR_Code BAPE_EchoCanceller_AddRemoteInput( |
|---|
| 183 | BAPE_EchoCancellerHandle handle, |
|---|
| 184 | BAPE_Connector input |
|---|
| 185 | ); |
|---|
| 186 | |
|---|
| 187 | /*************************************************************************** |
|---|
| 188 | Summary: |
|---|
| 189 | Remove a remote (far-end) input from this processing stage |
|---|
| 190 | ***************************************************************************/ |
|---|
| 191 | BERR_Code BAPE_EchoCanceller_RemoveRemoteInput( |
|---|
| 192 | BAPE_EchoCancellerHandle handle, |
|---|
| 193 | BAPE_Connector input |
|---|
| 194 | ); |
|---|
| 195 | |
|---|
| 196 | /*************************************************************************** |
|---|
| 197 | Summary: |
|---|
| 198 | Remove all inputs from this processing stage |
|---|
| 199 | ***************************************************************************/ |
|---|
| 200 | BERR_Code BAPE_EchoCanceller_RemoveAllInputs( |
|---|
| 201 | BAPE_EchoCancellerHandle handle |
|---|
| 202 | ); |
|---|
| 203 | |
|---|
| 204 | #endif /* #ifndef BAPE_ECHO_CANCELLER_H_ */ |
|---|