| 1 | /*************************************************************************** |
|---|
| 2 | * (c)2004-2011 Broadcom Corporation |
|---|
| 3 | * |
|---|
| 4 | * This program is the proprietary software of Broadcom Corporation and/or its licensors, |
|---|
| 5 | * and may only be used, duplicated, modified or distributed pursuant to the terms and |
|---|
| 6 | * conditions of a separate, written license agreement executed between you and Broadcom |
|---|
| 7 | * (an "Authorized License"). Except as set forth in an Authorized License, Broadcom grants |
|---|
| 8 | * no license (express or implied), right to use, or waiver of any kind with respect to the |
|---|
| 9 | * Software, and Broadcom expressly reserves all rights in and to the Software and all |
|---|
| 10 | * intellectual property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU |
|---|
| 11 | * HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY |
|---|
| 12 | * NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. |
|---|
| 13 | * |
|---|
| 14 | * Except as expressly set forth in the Authorized License, |
|---|
| 15 | * |
|---|
| 16 | * 1. This program, including its structure, sequence and organization, constitutes the valuable trade |
|---|
| 17 | * secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof, |
|---|
| 18 | * and to use this information only in connection with your use of Broadcom integrated circuit products. |
|---|
| 19 | * |
|---|
| 20 | * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" |
|---|
| 21 | * AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR |
|---|
| 22 | * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO |
|---|
| 23 | * THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES |
|---|
| 24 | * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, |
|---|
| 25 | * LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION |
|---|
| 26 | * OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF |
|---|
| 27 | * USE OR PERFORMANCE OF THE SOFTWARE. |
|---|
| 28 | * |
|---|
| 29 | * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS |
|---|
| 30 | * LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR |
|---|
| 31 | * EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR |
|---|
| 32 | * USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF |
|---|
| 33 | * THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT |
|---|
| 34 | * ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE |
|---|
| 35 | * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF |
|---|
| 36 | * ANY LIMITED REMEDY. |
|---|
| 37 | * |
|---|
| 38 | * $brcm_Workfile: nexus_tru_volume.h $ |
|---|
| 39 | * $brcm_Revision: 10 $ |
|---|
| 40 | * $brcm_Date: 4/22/11 10:44a $ |
|---|
| 41 | * |
|---|
| 42 | * API Description: |
|---|
| 43 | * API name: TruVolume |
|---|
| 44 | * Specific APIs related to SRS TruVolume (formerly Volume IQ) Audio Processing |
|---|
| 45 | * |
|---|
| 46 | * Revision History: |
|---|
| 47 | * |
|---|
| 48 | * $brcm_Log: /nexus/modules/audio/7400/include/nexus_tru_volume.h $ |
|---|
| 49 | * |
|---|
| 50 | * 10 4/22/11 10:44a erickson |
|---|
| 51 | * SW7420-1148: remove attr{shutdown=NEXUS_AudioInput_Shutdown} |
|---|
| 52 | * |
|---|
| 53 | * 9 3/16/11 3:04p jhaberf |
|---|
| 54 | * SWDTV-5784: Updated SRS StudioSound interface with new HPF/PEQ |
|---|
| 55 | * parameters |
|---|
| 56 | * |
|---|
| 57 | * 8 2/7/11 3:33p jhaberf |
|---|
| 58 | * SW35230-2902: Provided SRS High Pass Filter settings in TruVolume |
|---|
| 59 | * |
|---|
| 60 | * 7 1/7/11 4:42p jhaberf |
|---|
| 61 | * SW35230-2530: Modified the TruVol mode values requested by SRS lab |
|---|
| 62 | * |
|---|
| 63 | * 6 12/14/10 3:18p erickson |
|---|
| 64 | * SW7420-1285: add null_allowed attribute |
|---|
| 65 | * |
|---|
| 66 | * 5 12/8/10 4:07p jhaberf |
|---|
| 67 | * SW35230-2530: Update Nexus TruVolume parameters to support |
|---|
| 68 | * certification test |
|---|
| 69 | * |
|---|
| 70 | * 4 10/4/10 5:31p jgarrett |
|---|
| 71 | * SW7420-1133: Adding certification parameters for tru volume |
|---|
| 72 | * |
|---|
| 73 | * 3 11/9/09 2:46p jgarrett |
|---|
| 74 | * SW3548-2566: Adding DC notch filter setting |
|---|
| 75 | * |
|---|
| 76 | * 2 8/31/09 11:52a jgarrett |
|---|
| 77 | * SW3548-2440: Updating comments regarding noise manager threshold |
|---|
| 78 | * |
|---|
| 79 | * 1 2/12/09 5:36p jgarrett |
|---|
| 80 | * PR 46135: Adding TruVolume |
|---|
| 81 | * |
|---|
| 82 | ***************************************************************************/ |
|---|
| 83 | |
|---|
| 84 | #ifndef NEXUS_TRU_VOLUME_H__ |
|---|
| 85 | #define NEXUS_TRU_VOLUME_H__ |
|---|
| 86 | |
|---|
| 87 | #include "nexus_types.h" |
|---|
| 88 | #include "nexus_audio_types.h" |
|---|
| 89 | |
|---|
| 90 | #ifdef __cplusplus |
|---|
| 91 | extern "C" { |
|---|
| 92 | #endif |
|---|
| 93 | |
|---|
| 94 | /*=************************************ |
|---|
| 95 | Interface: TruVolume |
|---|
| 96 | |
|---|
| 97 | Header file: nexus_tru_volume.h |
|---|
| 98 | |
|---|
| 99 | Module: Audio |
|---|
| 100 | |
|---|
| 101 | Description: SRS TruVolume stage |
|---|
| 102 | |
|---|
| 103 | **************************************/ |
|---|
| 104 | |
|---|
| 105 | /** |
|---|
| 106 | Summary: |
|---|
| 107 | Handle for SRS Volume IQ stage |
|---|
| 108 | **/ |
|---|
| 109 | typedef struct NEXUS_TruVolume *NEXUS_TruVolumeHandle; |
|---|
| 110 | |
|---|
| 111 | /*************************************************************************** |
|---|
| 112 | Summary: |
|---|
| 113 | TruVolume Block Size |
|---|
| 114 | ***************************************************************************/ |
|---|
| 115 | typedef enum NEXUS_TruVolumeBlockSize |
|---|
| 116 | { |
|---|
| 117 | NEXUS_TruVolumeBlockSize_e256, |
|---|
| 118 | NEXUS_TruVolumeBlockSize_e512, |
|---|
| 119 | NEXUS_TruVolumeBlockSize_e768, |
|---|
| 120 | NEXUS_TruVolumeBlockSize_e1024, |
|---|
| 121 | NEXUS_TruVolumeBlockSize_eMax |
|---|
| 122 | } NEXUS_TruVolumeBlockSize; |
|---|
| 123 | |
|---|
| 124 | /*************************************************************************** |
|---|
| 125 | Summary: |
|---|
| 126 | TruVolume Mode |
|---|
| 127 | ***************************************************************************/ |
|---|
| 128 | typedef enum NEXUS_TruVolumeMode |
|---|
| 129 | { |
|---|
| 130 | NEXUS_TruVolumeMode_eLight, |
|---|
| 131 | NEXUS_TruVolumeMode_eNormal, |
|---|
| 132 | NEXUS_TruVolumeMode_eHeavy, |
|---|
| 133 | NEXUS_TruVolumeMode_eMax |
|---|
| 134 | } NEXUS_TruVolumeMode; |
|---|
| 135 | |
|---|
| 136 | /*************************************************************************** |
|---|
| 137 | Summary: |
|---|
| 138 | TruVolume Speaker Resolution |
|---|
| 139 | ***************************************************************************/ |
|---|
| 140 | typedef enum NEXUS_TruVolumeSpeakerResolution |
|---|
| 141 | { |
|---|
| 142 | NEXUS_TruVolumeSpeakerResolution_e20Hz, |
|---|
| 143 | NEXUS_TruVolumeSpeakerResolution_e40Hz, |
|---|
| 144 | NEXUS_TruVolumeSpeakerResolution_e110Hz, |
|---|
| 145 | NEXUS_TruVolumeSpeakerResolution_e200Hz, |
|---|
| 146 | NEXUS_TruVolumeSpeakerResolution_e315Hz, |
|---|
| 147 | NEXUS_TruVolumeSpeakerResolution_e410Hz, |
|---|
| 148 | NEXUS_TruVolumeSpeakerResolution_eMax |
|---|
| 149 | } NEXUS_TruVolumeSpeakerResolution; |
|---|
| 150 | |
|---|
| 151 | /*************************************************************************** |
|---|
| 152 | Summary: |
|---|
| 153 | SRS Filter Coefficient Generation Modes. Also required by StudioSound. |
|---|
| 154 | ***************************************************************************/ |
|---|
| 155 | typedef enum NEXUS_SrsFilterCoefGenMode |
|---|
| 156 | { |
|---|
| 157 | NEXUS_SrsFilterCoefGenMode_eFilterUser, /* Use user specified coefficients */ |
|---|
| 158 | NEXUS_SrsFilterCoefGenMode_eFilterSpec, /* Use Filter Specification to generate filter coeffcients */ |
|---|
| 159 | NEXUS_SrsFilterCoefGenMode_eMax |
|---|
| 160 | } NEXUS_SrsFilterCoefGenMode; |
|---|
| 161 | |
|---|
| 162 | /*************************************************************************** |
|---|
| 163 | Summary: |
|---|
| 164 | SRS High Pass Filter Order. Also required by StudioSound. |
|---|
| 165 | ***************************************************************************/ |
|---|
| 166 | typedef enum NEXUS_SrsFilterOrder |
|---|
| 167 | { |
|---|
| 168 | NEXUS_SrsFilterOrder_eOrder0 = 0, |
|---|
| 169 | NEXUS_SrsFilterOrder_eOrder2 = 2, |
|---|
| 170 | NEXUS_SrsFilterOrder_eOrder4 = 4, |
|---|
| 171 | NEXUS_SrsFilterOrder_eOrder6 = 6, |
|---|
| 172 | NEXUS_SrsFilterOrder_eMax |
|---|
| 173 | } NEXUS_SrsFilterOrder; |
|---|
| 174 | |
|---|
| 175 | /*************************************************************************** |
|---|
| 176 | Summary: |
|---|
| 177 | SRS High Pass Filter Coefficients. Also required by StudioSound. |
|---|
| 178 | ***************************************************************************/ |
|---|
| 179 | typedef struct NEXUS_SrsHighPassFilterCoef |
|---|
| 180 | { |
|---|
| 181 | unsigned scale; /* Specified q-format of the coefficients. (1+scale).(31-scale) format |
|---|
| 182 | Default: 1. scale=1 implies a q-format of 2.30 */ |
|---|
| 183 | int coefficientB0; |
|---|
| 184 | int coefficientB1; |
|---|
| 185 | int coefficientB2; |
|---|
| 186 | int coefficientA1; |
|---|
| 187 | int coefficientA2; |
|---|
| 188 | } NEXUS_SrsHighPassFilterCoef; |
|---|
| 189 | |
|---|
| 190 | /*************************************************************************** |
|---|
| 191 | Summary: |
|---|
| 192 | SRS High Pass Filter parameter for coefficients specified by user. Also required by StudioSound. |
|---|
| 193 | ***************************************************************************/ |
|---|
| 194 | typedef struct NEXUS_SrsHighPassFilterCoefUserParam |
|---|
| 195 | { |
|---|
| 196 | NEXUS_SrsFilterOrder filterOrder; /* HighPass Filter order. Default NEXUS_SrsFilterOrder_eOrder4 */ |
|---|
| 197 | NEXUS_SrsHighPassFilterCoef coefficients[3]; /* Number of active biquads filter decided by filterOrder, N = filterOrder/2 */ |
|---|
| 198 | } NEXUS_SrsHighPassFilterCoefUserParam; |
|---|
| 199 | |
|---|
| 200 | |
|---|
| 201 | /*************************************************************************** |
|---|
| 202 | Summary: |
|---|
| 203 | SRS High Pass Filter parameter for coefficients generated by specification. Also required by StudioSound. |
|---|
| 204 | ***************************************************************************/ |
|---|
| 205 | typedef struct NEXUS_SrsHighPassFilterCoefSpecParam |
|---|
| 206 | { |
|---|
| 207 | unsigned cutOffFrequency; /* Range: 20 to 1000 hz, Default: 180 Hz */ |
|---|
| 208 | NEXUS_SrsFilterOrder filterOrder; /* HighPass Filter order. Default NEXUS_SrsFilterOrder_eOrder4 */ |
|---|
| 209 | } NEXUS_SrsHighPassFilterCoefSpecParam; |
|---|
| 210 | |
|---|
| 211 | |
|---|
| 212 | /*************************************************************************** |
|---|
| 213 | Summary: |
|---|
| 214 | SRS High Pass Filter Settings. Also required by StudioSound. |
|---|
| 215 | ***************************************************************************/ |
|---|
| 216 | typedef struct NEXUS_SrsHighPassFilterSettings |
|---|
| 217 | { |
|---|
| 218 | bool enabled; /* If true, High Pass Filter processing is enabled. Default: true */ |
|---|
| 219 | NEXUS_SrsFilterCoefGenMode coefGenMode; /* Coefficients generation mode. Default: NEXUS_SrsHighPassFilterCoefGenMode_eFilterUser */ |
|---|
| 220 | |
|---|
| 221 | union |
|---|
| 222 | { |
|---|
| 223 | NEXUS_SrsHighPassFilterCoefUserParam highPassFilterCoefUser[3]; /* Array size 3, representing supported sampling rates 32, 44.1 and 48kHz, |
|---|
| 224 | will be used if coefMode is NEXUS_SrsFilterCoefGenMode_eFilterUser */ |
|---|
| 225 | NEXUS_SrsHighPassFilterCoefSpecParam highPassFilterCoefSpec; /* Filter specification for generating filter coeffcients, |
|---|
| 226 | will be used if coefMode is NEXUS_SrsFilterCoefGenMode_eFilterSpec */ |
|---|
| 227 | } coefParam; |
|---|
| 228 | } NEXUS_SrsHighPassFilterSettings; |
|---|
| 229 | |
|---|
| 230 | /*************************************************************************** |
|---|
| 231 | Summary: |
|---|
| 232 | TruVolume Settings |
|---|
| 233 | ***************************************************************************/ |
|---|
| 234 | typedef struct NEXUS_TruVolumeSettings |
|---|
| 235 | { |
|---|
| 236 | bool enabled; /* If true, processing is enabled. Otherwise this stage is bypassed */ |
|---|
| 237 | |
|---|
| 238 | NEXUS_TruVolumeBlockSize blockSize; /* Block Size for processing */ |
|---|
| 239 | |
|---|
| 240 | bool enableNormalGain; /* If true, normal processing will be performed. If false, only bypassGain is applied. */ |
|---|
| 241 | |
|---|
| 242 | unsigned inputGain; /* Input gain ranges from 0 to 3200. Default: 100 */ |
|---|
| 243 | unsigned outputGain; /* Output gain ranges from 0 to 3200. Default: 50 */ |
|---|
| 244 | unsigned bypassGain; /* Bypass gain (In %). Ranges from 0 to 100 */ |
|---|
| 245 | |
|---|
| 246 | uint32_t referenceLevel; /* Reference level. Ranges from 0x00000109 to 0x007fffff */ |
|---|
| 247 | |
|---|
| 248 | NEXUS_TruVolumeMode mode; /* Processing Mode. */ |
|---|
| 249 | |
|---|
| 250 | NEXUS_TruVolumeSpeakerResolution speakerResolution; |
|---|
| 251 | |
|---|
| 252 | unsigned maxGain; /* Max gain control (In %). Ranges from 0 to 100 */ |
|---|
| 253 | |
|---|
| 254 | bool enableDcNotchFilter; /* If true, the DC notch filter will be enabled */ |
|---|
| 255 | |
|---|
| 256 | bool enableNoiseManager; |
|---|
| 257 | int noiseManagerThreshold; /* Noise manager threshold. Ranges from 0 to 200 (Default=20). */ |
|---|
| 258 | |
|---|
| 259 | bool enableNormalizer; /* If true, the normalizer is enabled. */ |
|---|
| 260 | |
|---|
| 261 | unsigned calibrate; /* Ranges from 0..25600. Default=100. */ |
|---|
| 262 | |
|---|
| 263 | NEXUS_SrsHighPassFilterSettings highPassFilter; /* High Pass Filter Settings applied prior TruVolume */ |
|---|
| 264 | } NEXUS_TruVolumeSettings; |
|---|
| 265 | |
|---|
| 266 | /*************************************************************************** |
|---|
| 267 | Summary: |
|---|
| 268 | Get default settings for an SRS TruVolume stage |
|---|
| 269 | ***************************************************************************/ |
|---|
| 270 | void NEXUS_TruVolume_GetDefaultSettings( |
|---|
| 271 | NEXUS_TruVolumeSettings *pSettings /* [out] default settings */ |
|---|
| 272 | ); |
|---|
| 273 | |
|---|
| 274 | /*************************************************************************** |
|---|
| 275 | Summary: |
|---|
| 276 | Open an SRS TruVolume stage |
|---|
| 277 | ***************************************************************************/ |
|---|
| 278 | NEXUS_TruVolumeHandle NEXUS_TruVolume_Open( /* attr{destructor=NEXUS_TruVolume_Close} */ |
|---|
| 279 | const NEXUS_TruVolumeSettings *pSettings /* attr{null_allowed=y} */ |
|---|
| 280 | ); |
|---|
| 281 | |
|---|
| 282 | /*************************************************************************** |
|---|
| 283 | Summary: |
|---|
| 284 | Close an SRS TruVolume stage |
|---|
| 285 | |
|---|
| 286 | Description: |
|---|
| 287 | Input to the stage must be removed prior to closing. |
|---|
| 288 | ***************************************************************************/ |
|---|
| 289 | void NEXUS_TruVolume_Close( |
|---|
| 290 | NEXUS_TruVolumeHandle handle |
|---|
| 291 | ); |
|---|
| 292 | |
|---|
| 293 | /*************************************************************************** |
|---|
| 294 | Summary: |
|---|
| 295 | Get Settings for an SRS TruVolume stage |
|---|
| 296 | ***************************************************************************/ |
|---|
| 297 | void NEXUS_TruVolume_GetSettings( |
|---|
| 298 | NEXUS_TruVolumeHandle handle, |
|---|
| 299 | NEXUS_TruVolumeSettings *pSettings /* [out] Settings */ |
|---|
| 300 | ); |
|---|
| 301 | |
|---|
| 302 | /*************************************************************************** |
|---|
| 303 | Summary: |
|---|
| 304 | Set Settings for an SRS TruVolume stage |
|---|
| 305 | ***************************************************************************/ |
|---|
| 306 | NEXUS_Error NEXUS_TruVolume_SetSettings( |
|---|
| 307 | NEXUS_TruVolumeHandle handle, |
|---|
| 308 | const NEXUS_TruVolumeSettings *pSettings |
|---|
| 309 | ); |
|---|
| 310 | |
|---|
| 311 | /*************************************************************************** |
|---|
| 312 | Summary: |
|---|
| 313 | Get the audio connector for an SRS TruVolume stage |
|---|
| 314 | ***************************************************************************/ |
|---|
| 315 | NEXUS_AudioInput NEXUS_TruVolume_GetConnector( |
|---|
| 316 | NEXUS_TruVolumeHandle handle |
|---|
| 317 | ); |
|---|
| 318 | |
|---|
| 319 | /*************************************************************************** |
|---|
| 320 | Summary: |
|---|
| 321 | Add an input to this processing stage |
|---|
| 322 | ***************************************************************************/ |
|---|
| 323 | NEXUS_Error NEXUS_TruVolume_AddInput( |
|---|
| 324 | NEXUS_TruVolumeHandle handle, |
|---|
| 325 | NEXUS_AudioInput input |
|---|
| 326 | ); |
|---|
| 327 | |
|---|
| 328 | /*************************************************************************** |
|---|
| 329 | Summary: |
|---|
| 330 | Remove an input from this processing stage |
|---|
| 331 | ***************************************************************************/ |
|---|
| 332 | NEXUS_Error NEXUS_TruVolume_RemoveInput( |
|---|
| 333 | NEXUS_TruVolumeHandle handle, |
|---|
| 334 | NEXUS_AudioInput input |
|---|
| 335 | ); |
|---|
| 336 | |
|---|
| 337 | /*************************************************************************** |
|---|
| 338 | Summary: |
|---|
| 339 | Remove all inputs from this processing stage |
|---|
| 340 | ***************************************************************************/ |
|---|
| 341 | NEXUS_Error NEXUS_TruVolume_RemoveAllInputs( |
|---|
| 342 | NEXUS_TruVolumeHandle handle |
|---|
| 343 | ); |
|---|
| 344 | |
|---|
| 345 | #ifdef __cplusplus |
|---|
| 346 | } |
|---|
| 347 | #endif |
|---|
| 348 | |
|---|
| 349 | #endif /* #ifndef NEXUS_TRU_VOLUME_H__ */ |
|---|
| 350 | |
|---|