| 1 | /*************************************************************************** |
|---|
| 2 | * (c)2004-2010 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: bape_dolby_volume.h $ |
|---|
| 39 | * $brcm_Revision: Hydra_Software_Devel/4 $ |
|---|
| 40 | * $brcm_Date: 5/14/11 11:56a $ |
|---|
| 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: /magnum/portinginterface/ape/7422/bape_dolby_volume.h $ |
|---|
| 49 | * |
|---|
| 50 | * Hydra_Software_Devel/4 5/14/11 11:56a jgarrett |
|---|
| 51 | * SW7425-407: Adding DV258 Support |
|---|
| 52 | * |
|---|
| 53 | * Hydra_Software_Devel/3 4/16/11 12:15p jgarrett |
|---|
| 54 | * SW7425-371: Removing tab characters |
|---|
| 55 | * |
|---|
| 56 | * Hydra_Software_Devel/2 2/22/11 5:43p jgarrett |
|---|
| 57 | * SW7422-146: Implemented type renaming based on filter graph review |
|---|
| 58 | * comments |
|---|
| 59 | * |
|---|
| 60 | * Hydra_Software_Devel/1 1/12/11 4:24p jgarrett |
|---|
| 61 | * SW7422-146: Adding additional APIs |
|---|
| 62 | * |
|---|
| 63 | ***************************************************************************/ |
|---|
| 64 | |
|---|
| 65 | #ifndef BAPE_DOLBY_VOLUME_H__ |
|---|
| 66 | #define BAPE_DOLBY_VOLUME_H__ |
|---|
| 67 | |
|---|
| 68 | #include "bape.h" |
|---|
| 69 | |
|---|
| 70 | /*************************************************************************** |
|---|
| 71 | Summary: |
|---|
| 72 | DolbyVolume Handle |
|---|
| 73 | ***************************************************************************/ |
|---|
| 74 | typedef struct BAPE_DolbyVolume *BAPE_DolbyVolumeHandle; |
|---|
| 75 | |
|---|
| 76 | /*************************************************************************** |
|---|
| 77 | Summary: |
|---|
| 78 | DolbyVolume Settings |
|---|
| 79 | ***************************************************************************/ |
|---|
| 80 | typedef struct BAPE_DolbyVolumeSettings |
|---|
| 81 | { |
|---|
| 82 | bool enabled; /* If true, processing is enabled. Otherwise, the stage is bypassed. */ |
|---|
| 83 | |
|---|
| 84 | /* System Settings*/ |
|---|
| 85 | unsigned preGain; /* Gain applied to the signal prior to entering DV258. Ranges from 0 to 480 (0..30 in steps of 0.0625 dB) (MS11 only) */ |
|---|
| 86 | unsigned inputReferenceLevel; /* Input reference level. Ranges from 0 to 2080 (0..130 in steps of 0.0625 dB) */ |
|---|
| 87 | unsigned outputReferenceLevel; /* Input reference level. Ranges from 0 to 2080 (0..130 in steps of 0.0625 dB) */ |
|---|
| 88 | int calibrationOffset; /* Calibration offset. Ranges from -480 to 480 (-30..30 in steps of 0.0625 dB) */ |
|---|
| 89 | bool reset; /* Forces a reset if true. */ |
|---|
| 90 | |
|---|
| 91 | /* Volume Modeler Settings*/ |
|---|
| 92 | bool volumeModelerEnabled; /* If true, the volume modeler is enabled. */ |
|---|
| 93 | int digitalVolumeLevel; /* Volume level gain applied by Dolby Volume. Ranges from -1536 to 480 (-96..30 in steps of 0.0625 dB) */ |
|---|
| 94 | int analogVolumeLevel; /* Volume level gain applied after Dolby Volume. Ranges from -1536 to 480 (-96..30 in steps of 0.0625 dB) */ |
|---|
| 95 | |
|---|
| 96 | /* Volume Leveler Settings */ |
|---|
| 97 | bool volumeLevelerEnabled; /* If true, the volume leveler is enabled */ |
|---|
| 98 | bool midsideProcessingEnabled; /* If true, midside processing is enabled */ |
|---|
| 99 | bool halfModeEnabled; /* If true, half mode will be enabled */ |
|---|
| 100 | unsigned volumeLevelerAmount; /* Ranges from 0 to 10 */ |
|---|
| 101 | |
|---|
| 102 | /* Limiter Settings */ |
|---|
| 103 | bool limiterEnabled; /* If true, the limiter is enabled (MS11 only) */ |
|---|
| 104 | } BAPE_DolbyVolumeSettings; |
|---|
| 105 | |
|---|
| 106 | /*************************************************************************** |
|---|
| 107 | Summary: |
|---|
| 108 | Get default settings for a DolbyVolume stage |
|---|
| 109 | ***************************************************************************/ |
|---|
| 110 | void BAPE_DolbyVolume_GetDefaultSettings( |
|---|
| 111 | BAPE_DolbyVolumeSettings *pSettings /* [out] default settings */ |
|---|
| 112 | ); |
|---|
| 113 | |
|---|
| 114 | /*************************************************************************** |
|---|
| 115 | Summary: |
|---|
| 116 | Open a DolbyVolume stage |
|---|
| 117 | ***************************************************************************/ |
|---|
| 118 | BERR_Code BAPE_DolbyVolume_Create( |
|---|
| 119 | BAPE_Handle deviceHandle, |
|---|
| 120 | const BAPE_DolbyVolumeSettings *pSettings, |
|---|
| 121 | BAPE_DolbyVolumeHandle *pHandle /* [out] */ |
|---|
| 122 | ); |
|---|
| 123 | |
|---|
| 124 | /*************************************************************************** |
|---|
| 125 | Summary: |
|---|
| 126 | Close a DolbyVolume stage |
|---|
| 127 | |
|---|
| 128 | Description: |
|---|
| 129 | Input to the stage must be removed prior to closing. |
|---|
| 130 | ***************************************************************************/ |
|---|
| 131 | void BAPE_DolbyVolume_Destroy( |
|---|
| 132 | BAPE_DolbyVolumeHandle handle |
|---|
| 133 | ); |
|---|
| 134 | |
|---|
| 135 | /*************************************************************************** |
|---|
| 136 | Summary: |
|---|
| 137 | Get Settings for a DolbyVolume stage |
|---|
| 138 | ***************************************************************************/ |
|---|
| 139 | void BAPE_DolbyVolume_GetSettings( |
|---|
| 140 | BAPE_DolbyVolumeHandle handle, |
|---|
| 141 | BAPE_DolbyVolumeSettings *pSettings /* [out] Settings */ |
|---|
| 142 | ); |
|---|
| 143 | |
|---|
| 144 | /*************************************************************************** |
|---|
| 145 | Summary: |
|---|
| 146 | Set Settings for a DolbyVolume stage |
|---|
| 147 | ***************************************************************************/ |
|---|
| 148 | BERR_Code BAPE_DolbyVolume_SetSettings( |
|---|
| 149 | BAPE_DolbyVolumeHandle handle, |
|---|
| 150 | const BAPE_DolbyVolumeSettings *pSettings |
|---|
| 151 | ); |
|---|
| 152 | |
|---|
| 153 | /*************************************************************************** |
|---|
| 154 | Summary: |
|---|
| 155 | Get the audio connector for a DolbyVolume stage |
|---|
| 156 | ***************************************************************************/ |
|---|
| 157 | void BAPE_DolbyVolume_GetConnector( |
|---|
| 158 | BAPE_DolbyVolumeHandle handle, |
|---|
| 159 | BAPE_Connector *pConnector /* [out] */ |
|---|
| 160 | ); |
|---|
| 161 | |
|---|
| 162 | /*************************************************************************** |
|---|
| 163 | Summary: |
|---|
| 164 | Add an input to this processing stage |
|---|
| 165 | ***************************************************************************/ |
|---|
| 166 | BERR_Code BAPE_DolbyVolume_AddInput( |
|---|
| 167 | BAPE_DolbyVolumeHandle handle, |
|---|
| 168 | BAPE_Connector input |
|---|
| 169 | ); |
|---|
| 170 | |
|---|
| 171 | /*************************************************************************** |
|---|
| 172 | Summary: |
|---|
| 173 | Remove an input from this processing stage |
|---|
| 174 | ***************************************************************************/ |
|---|
| 175 | BERR_Code BAPE_DolbyVolume_RemoveInput( |
|---|
| 176 | BAPE_DolbyVolumeHandle handle, |
|---|
| 177 | BAPE_Connector input |
|---|
| 178 | ); |
|---|
| 179 | |
|---|
| 180 | /*************************************************************************** |
|---|
| 181 | Summary: |
|---|
| 182 | Remove all inputs from this processing stage |
|---|
| 183 | ***************************************************************************/ |
|---|
| 184 | BERR_Code BAPE_DolbyVolume_RemoveAllInputs( |
|---|
| 185 | BAPE_DolbyVolumeHandle handle |
|---|
| 186 | ); |
|---|
| 187 | |
|---|
| 188 | #endif /* #ifndef BAPE_DOLBY_VOLUME_H__ */ |
|---|
| 189 | |
|---|