| 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_dolby_volume.h $ |
|---|
| 39 | * $brcm_Revision: 5 $ |
|---|
| 40 | * $brcm_Date: 5/25/11 5:16p $ |
|---|
| 41 | * |
|---|
| 42 | * API Description: |
|---|
| 43 | * API name: DolbyVolume |
|---|
| 44 | * Specific APIs related to Dolby Volume Audio Processing |
|---|
| 45 | * |
|---|
| 46 | * Revision History: |
|---|
| 47 | * |
|---|
| 48 | * $brcm_Log: /nexus/modules/audio/7400/include/nexus_dolby_volume.h $ |
|---|
| 49 | * |
|---|
| 50 | * 5 5/25/11 5:16p jgarrett |
|---|
| 51 | * SW7425-408: Adding BDBG_OBJECT to input/output types and MS11 features |
|---|
| 52 | * |
|---|
| 53 | * 4 5/13/11 12:18p erickson |
|---|
| 54 | * SW7420-1873: remove shutdown attribute |
|---|
| 55 | * |
|---|
| 56 | * 3 12/14/10 3:18p erickson |
|---|
| 57 | * SW7420-1285: add null_allowed attribute |
|---|
| 58 | * |
|---|
| 59 | * 2 8/18/10 10:06a jgarrett |
|---|
| 60 | * SW7420-790: Merging MS11 updates to main branch |
|---|
| 61 | * |
|---|
| 62 | * SW7420-790/1 6/8/10 5:49p jgarrett |
|---|
| 63 | * SW7420-790: Adding DolbyVolume258 |
|---|
| 64 | * |
|---|
| 65 | * 1 3/20/09 6:56p jgarrett |
|---|
| 66 | * PR 53293: Adding DolbyVolume |
|---|
| 67 | * |
|---|
| 68 | ***************************************************************************/ |
|---|
| 69 | |
|---|
| 70 | #ifndef NEXUS_DOLBY_VOLUME_H__ |
|---|
| 71 | #define NEXUS_DOLBY_VOLUME_H__ |
|---|
| 72 | |
|---|
| 73 | #include "nexus_types.h" |
|---|
| 74 | #include "nexus_audio_types.h" |
|---|
| 75 | |
|---|
| 76 | #ifdef __cplusplus |
|---|
| 77 | extern "C" { |
|---|
| 78 | #endif |
|---|
| 79 | |
|---|
| 80 | /*=************************************ |
|---|
| 81 | Interface: DolbyVolume |
|---|
| 82 | |
|---|
| 83 | Header file: nexus_dolby_volume.h |
|---|
| 84 | |
|---|
| 85 | Module: Audio |
|---|
| 86 | |
|---|
| 87 | Description: Dolby Volume stage |
|---|
| 88 | |
|---|
| 89 | **************************************/ |
|---|
| 90 | |
|---|
| 91 | typedef struct NEXUS_DolbyVolume *NEXUS_DolbyVolumeHandle; |
|---|
| 92 | |
|---|
| 93 | /*************************************************************************** |
|---|
| 94 | Summary: |
|---|
| 95 | DolbyVolume Settings |
|---|
| 96 | ***************************************************************************/ |
|---|
| 97 | typedef struct NEXUS_DolbyVolumeSettings |
|---|
| 98 | { |
|---|
| 99 | bool enabled; /* If true, processing is enabled. Otherwise, the stage is bypassed. */ |
|---|
| 100 | |
|---|
| 101 | int blockSize; /*Size of processing block in samples. Ranges from 256 to 512. */ |
|---|
| 102 | unsigned numBands; /* Number of critical bands to use. Values of 20 or 40 are legal. */ |
|---|
| 103 | |
|---|
| 104 | /* System Settings*/ |
|---|
| 105 | unsigned inputReferenceLevel; /* Input reference level in dBSPL. Ranges from 0 to 100. */ |
|---|
| 106 | unsigned outputReferenceLevel; /* Output reference level in dBSPL. Ranges from 0 to 100. */ |
|---|
| 107 | int calibrationOffset; /* Calibration offset in dB. Ranges from -100 to +30. */ |
|---|
| 108 | bool reset; /* Forces a reset if true. */ |
|---|
| 109 | |
|---|
| 110 | /*Volume Modeler Settings*/ |
|---|
| 111 | bool volumeModelerEnabled; /* If true, the volume modeler is enabled. */ |
|---|
| 112 | int digitalVolumeLevel; /* Volume level gain in dB. Ranges from -100 to 30. */ |
|---|
| 113 | int analogVolumeLevel; /* Volume level gain in dB. Ranges from -100 to 30. */ |
|---|
| 114 | |
|---|
| 115 | /*Volume Leveler Settings */ |
|---|
| 116 | bool volumeLevelerEnabled; /* If true, the volume leveler is enabled */ |
|---|
| 117 | bool midsideProcessingEnabled; /* If true, midside processing is enabled */ |
|---|
| 118 | bool halfModeEnabled; /* If true, half mode will be enabled */ |
|---|
| 119 | unsigned volumeLevelerAmount; /* Ranges from 0 to 10 */ |
|---|
| 120 | |
|---|
| 121 | } NEXUS_DolbyVolumeSettings; |
|---|
| 122 | |
|---|
| 123 | /*************************************************************************** |
|---|
| 124 | Summary: |
|---|
| 125 | Get default settings for a DolbyVolume stage |
|---|
| 126 | ***************************************************************************/ |
|---|
| 127 | void NEXUS_DolbyVolume_GetDefaultSettings( |
|---|
| 128 | NEXUS_DolbyVolumeSettings *pSettings /* [out] default settings */ |
|---|
| 129 | ); |
|---|
| 130 | |
|---|
| 131 | /*************************************************************************** |
|---|
| 132 | Summary: |
|---|
| 133 | Open a DolbyVolume stage |
|---|
| 134 | ***************************************************************************/ |
|---|
| 135 | NEXUS_DolbyVolumeHandle NEXUS_DolbyVolume_Open( /* attr{destructor=NEXUS_DolbyVolume_Close} */ |
|---|
| 136 | const NEXUS_DolbyVolumeSettings *pSettings /* attr{null_allowed=y} */ |
|---|
| 137 | ); |
|---|
| 138 | |
|---|
| 139 | /*************************************************************************** |
|---|
| 140 | Summary: |
|---|
| 141 | Close a DolbyVolume stage |
|---|
| 142 | |
|---|
| 143 | Description: |
|---|
| 144 | Input to the stage must be removed prior to closing. |
|---|
| 145 | ***************************************************************************/ |
|---|
| 146 | void NEXUS_DolbyVolume_Close( |
|---|
| 147 | NEXUS_DolbyVolumeHandle handle |
|---|
| 148 | ); |
|---|
| 149 | |
|---|
| 150 | /*************************************************************************** |
|---|
| 151 | Summary: |
|---|
| 152 | Get Settings for a DolbyVolume stage |
|---|
| 153 | ***************************************************************************/ |
|---|
| 154 | void NEXUS_DolbyVolume_GetSettings( |
|---|
| 155 | NEXUS_DolbyVolumeHandle handle, |
|---|
| 156 | NEXUS_DolbyVolumeSettings *pSettings /* [out] Settings */ |
|---|
| 157 | ); |
|---|
| 158 | |
|---|
| 159 | /*************************************************************************** |
|---|
| 160 | Summary: |
|---|
| 161 | Set Settings for a DolbyVolume stage |
|---|
| 162 | ***************************************************************************/ |
|---|
| 163 | NEXUS_Error NEXUS_DolbyVolume_SetSettings( |
|---|
| 164 | NEXUS_DolbyVolumeHandle handle, |
|---|
| 165 | const NEXUS_DolbyVolumeSettings *pSettings |
|---|
| 166 | ); |
|---|
| 167 | |
|---|
| 168 | /*************************************************************************** |
|---|
| 169 | Summary: |
|---|
| 170 | Get the audio connector for a DolbyVolume stage |
|---|
| 171 | ***************************************************************************/ |
|---|
| 172 | NEXUS_AudioInput NEXUS_DolbyVolume_GetConnector( |
|---|
| 173 | NEXUS_DolbyVolumeHandle handle |
|---|
| 174 | ); |
|---|
| 175 | |
|---|
| 176 | /*************************************************************************** |
|---|
| 177 | Summary: |
|---|
| 178 | Add an input to this processing stage |
|---|
| 179 | ***************************************************************************/ |
|---|
| 180 | NEXUS_Error NEXUS_DolbyVolume_AddInput( |
|---|
| 181 | NEXUS_DolbyVolumeHandle handle, |
|---|
| 182 | NEXUS_AudioInput input |
|---|
| 183 | ); |
|---|
| 184 | |
|---|
| 185 | /*************************************************************************** |
|---|
| 186 | Summary: |
|---|
| 187 | Remove an input from this processing stage |
|---|
| 188 | ***************************************************************************/ |
|---|
| 189 | NEXUS_Error NEXUS_DolbyVolume_RemoveInput( |
|---|
| 190 | NEXUS_DolbyVolumeHandle handle, |
|---|
| 191 | NEXUS_AudioInput input |
|---|
| 192 | ); |
|---|
| 193 | |
|---|
| 194 | /*************************************************************************** |
|---|
| 195 | Summary: |
|---|
| 196 | Remove all inputs from this processing stage |
|---|
| 197 | ***************************************************************************/ |
|---|
| 198 | NEXUS_Error NEXUS_DolbyVolume_RemoveAllInputs( |
|---|
| 199 | NEXUS_DolbyVolumeHandle handle |
|---|
| 200 | ); |
|---|
| 201 | |
|---|
| 202 | /*************************************************************************** |
|---|
| 203 | Summary: |
|---|
| 204 | Dolby Volume 258 (MS11) Handle |
|---|
| 205 | ***************************************************************************/ |
|---|
| 206 | typedef struct NEXUS_DolbyVolume258 *NEXUS_DolbyVolume258Handle; |
|---|
| 207 | |
|---|
| 208 | /*************************************************************************** |
|---|
| 209 | Summary: |
|---|
| 210 | DolbyVolume258 Settings |
|---|
| 211 | ***************************************************************************/ |
|---|
| 212 | typedef struct NEXUS_DolbyVolume258Settings |
|---|
| 213 | { |
|---|
| 214 | bool enabled; /* If true, processing is enabled. Otherwise, the stage is bypassed. */ |
|---|
| 215 | |
|---|
| 216 | /* System Settings*/ |
|---|
| 217 | unsigned preGain; /* Gain applied to the signal prior to entering DV258. Ranges from 0 to 480 (0..30 in steps of 0.0625 dB) */ |
|---|
| 218 | unsigned inputReferenceLevel; /* Input reference level. Ranges from 0 to 2080 (0..130 in steps of 0.0625 dB) */ |
|---|
| 219 | unsigned outputReferenceLevel; /* Input reference level. Ranges from 0 to 2080 (0..130 in steps of 0.0625 dB) */ |
|---|
| 220 | int calibrationOffset; /* Calibration offset. Ranges from -480 to 480 (-30..30 in steps of 0.0625 dB) */ |
|---|
| 221 | bool reset; /* Forces a reset if true. */ |
|---|
| 222 | |
|---|
| 223 | /*Volume Modeler Settings*/ |
|---|
| 224 | bool volumeModelerEnabled; /* If true, the volume modeler is enabled. */ |
|---|
| 225 | int digitalVolumeLevel; /* Volume level gain applied by Dolby Volume. Ranges from -1536 to 480 (-96..30 in steps of 0.0625 dB) */ |
|---|
| 226 | int analogVolumeLevel; /* Volume level gain applied after Dolby Volume. Ranges from -1536 to 480 (-96..30 in steps of 0.0625 dB) */ |
|---|
| 227 | |
|---|
| 228 | /*Volume Leveler Settings */ |
|---|
| 229 | bool volumeLevelerEnabled; /* If true, the volume leveler is enabled */ |
|---|
| 230 | bool midsideProcessingEnabled; /* If true, midside processing is enabled */ |
|---|
| 231 | bool halfModeEnabled; /* If true, half mode will be enabled */ |
|---|
| 232 | unsigned volumeLevelerAmount; /* Ranges from 0 to 10 */ |
|---|
| 233 | |
|---|
| 234 | /* Limiter Settings */ |
|---|
| 235 | bool limiterEnabled; /* If true, the limiter is enabled */ |
|---|
| 236 | |
|---|
| 237 | } NEXUS_DolbyVolume258Settings; |
|---|
| 238 | |
|---|
| 239 | /*************************************************************************** |
|---|
| 240 | Summary: |
|---|
| 241 | Get default settings for a DolbyVolume258 stage |
|---|
| 242 | ***************************************************************************/ |
|---|
| 243 | void NEXUS_DolbyVolume258_GetDefaultSettings( |
|---|
| 244 | NEXUS_DolbyVolume258Settings *pSettings /* [out] default settings */ |
|---|
| 245 | ); |
|---|
| 246 | |
|---|
| 247 | /*************************************************************************** |
|---|
| 248 | Summary: |
|---|
| 249 | Open a DolbyVolume258 stage |
|---|
| 250 | ***************************************************************************/ |
|---|
| 251 | NEXUS_DolbyVolume258Handle NEXUS_DolbyVolume258_Open( /* attr{destructor=NEXUS_DolbyVolume258_Close} */ |
|---|
| 252 | const NEXUS_DolbyVolume258Settings *pSettings /* attr{null_allowed=y} */ |
|---|
| 253 | ); |
|---|
| 254 | |
|---|
| 255 | /*************************************************************************** |
|---|
| 256 | Summary: |
|---|
| 257 | Close a DolbyVolume258 stage |
|---|
| 258 | |
|---|
| 259 | Description: |
|---|
| 260 | Input to the stage must be removed prior to closing. |
|---|
| 261 | ***************************************************************************/ |
|---|
| 262 | void NEXUS_DolbyVolume258_Close( |
|---|
| 263 | NEXUS_DolbyVolume258Handle handle |
|---|
| 264 | ); |
|---|
| 265 | |
|---|
| 266 | /*************************************************************************** |
|---|
| 267 | Summary: |
|---|
| 268 | Get Settings for a DolbyVolume258 stage |
|---|
| 269 | ***************************************************************************/ |
|---|
| 270 | void NEXUS_DolbyVolume258_GetSettings( |
|---|
| 271 | NEXUS_DolbyVolume258Handle handle, |
|---|
| 272 | NEXUS_DolbyVolume258Settings *pSettings /* [out] Settings */ |
|---|
| 273 | ); |
|---|
| 274 | |
|---|
| 275 | /*************************************************************************** |
|---|
| 276 | Summary: |
|---|
| 277 | Set Settings for a DolbyVolume258 stage |
|---|
| 278 | ***************************************************************************/ |
|---|
| 279 | NEXUS_Error NEXUS_DolbyVolume258_SetSettings( |
|---|
| 280 | NEXUS_DolbyVolume258Handle handle, |
|---|
| 281 | const NEXUS_DolbyVolume258Settings *pSettings |
|---|
| 282 | ); |
|---|
| 283 | |
|---|
| 284 | /*************************************************************************** |
|---|
| 285 | Summary: |
|---|
| 286 | Get the audio connector for a DolbyVolume258 stage |
|---|
| 287 | ***************************************************************************/ |
|---|
| 288 | NEXUS_AudioInput NEXUS_DolbyVolume258_GetConnector( |
|---|
| 289 | NEXUS_DolbyVolume258Handle handle |
|---|
| 290 | ); |
|---|
| 291 | |
|---|
| 292 | /*************************************************************************** |
|---|
| 293 | Summary: |
|---|
| 294 | Add an input to this processing stage |
|---|
| 295 | ***************************************************************************/ |
|---|
| 296 | NEXUS_Error NEXUS_DolbyVolume258_AddInput( |
|---|
| 297 | NEXUS_DolbyVolume258Handle handle, |
|---|
| 298 | NEXUS_AudioInput input |
|---|
| 299 | ); |
|---|
| 300 | |
|---|
| 301 | /*************************************************************************** |
|---|
| 302 | Summary: |
|---|
| 303 | Remove an input from this processing stage |
|---|
| 304 | ***************************************************************************/ |
|---|
| 305 | NEXUS_Error NEXUS_DolbyVolume258_RemoveInput( |
|---|
| 306 | NEXUS_DolbyVolume258Handle handle, |
|---|
| 307 | NEXUS_AudioInput input |
|---|
| 308 | ); |
|---|
| 309 | |
|---|
| 310 | /*************************************************************************** |
|---|
| 311 | Summary: |
|---|
| 312 | Remove all inputs from this processing stage |
|---|
| 313 | ***************************************************************************/ |
|---|
| 314 | NEXUS_Error NEXUS_DolbyVolume258_RemoveAllInputs( |
|---|
| 315 | NEXUS_DolbyVolume258Handle handle |
|---|
| 316 | ); |
|---|
| 317 | |
|---|
| 318 | #ifdef __cplusplus |
|---|
| 319 | } |
|---|
| 320 | #endif |
|---|
| 321 | |
|---|
| 322 | #endif /* #ifndef NEXUS_DOLBY_VOLUME_H__ */ |
|---|
| 323 | |
|---|