Home | History | Annotate | Download | only in lib
      1 /*
      2  * Copyright (C) 2004-2010 NXP Software
      3  * Copyright (C) 2010 The Android Open Source Project
      4  *
      5  * Licensed under the Apache License, Version 2.0 (the "License");
      6  * you may not use this file except in compliance with the License.
      7  * You may obtain a copy of the License at
      8  *
      9  *      http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  * Unless required by applicable law or agreed to in writing, software
     12  * distributed under the License is distributed on an "AS IS" BASIS,
     13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  * See the License for the specific language governing permissions and
     15  * limitations under the License.
     16  */
     17 
     18 /****************************************************************************************/
     19 /*                                                                                      */
     20 /*  Header file for the application layer interface of Concert Sound, Bass Enhancement, */
     21 /*  Equalizer, Power Spectrum Analyzer, Trebble Enhancement and volume management       */
     22 /*  bundle.                                                                             */
     23 /*                                                                                      */
     24 /*  This files includes all definitions, types, structures and function                 */
     25 /*  prototypes required by the calling layer. All other types, structures and           */
     26 /*  functions are private.                                                              */
     27 /*                                                                                      */
     28 /****************************************************************************************/
     29 /*                                                                                      */
     30 /*  Note: 1                                                                             */
     31 /*  =======                                                                             */
     32 /*  The algorithm can execute either with separate input and output buffers or with     */
     33 /*  a common buffer, i.e. the data is processed in-place.                               */
     34 /*                                                                                      */
     35 /****************************************************************************************/
     36 /*                                                                                      */
     37 /*  Note: 2                                                                             */
     38 /*  =======                                                                             */
     39 /*  Three data formats are support Stereo,Mono-In-Stereo and Mono. The data is          */
     40 /*  interleaved as follows:                                                             */
     41 /*                                                                                      */
     42 /*  Byte Offset         Stereo Input         Mono-In-Stereo Input       Mono Input      */
     43 /*  ===========         ============         ====================     ==============    */
     44 /*      0               Left Sample #1          Mono Sample #1        Mono Sample #1    */
     45 /*      2               Right Sample #1         Mono Sample #1        Mono Sample #2    */
     46 /*      4               Left Sample #2          Mono Sample #2        Mono Sample #3    */
     47 /*      6               Right Sample #2         Mono Sample #2        Mono Sample #4    */
     48 /*      .                      .                     .                     .            */
     49 /*      .                      .                     .                     .            */
     50 /*                                                                                      */
     51 /****************************************************************************************/
     52 
     53 #ifndef __LVM_H__
     54 #define __LVM_H__
     55 
     56 #ifdef __cplusplus
     57 extern "C" {
     58 #endif /* __cplusplus */
     59 
     60 
     61 /****************************************************************************************/
     62 /*                                                                                      */
     63 /*  Includes                                                                            */
     64 /*                                                                                      */
     65 /****************************************************************************************/
     66 
     67 #include "LVM_Types.h"
     68 
     69 
     70 /****************************************************************************************/
     71 /*                                                                                      */
     72 /*  Definitions                                                                         */
     73 /*                                                                                      */
     74 /****************************************************************************************/
     75 
     76 /* Memory table*/
     77 #define LVM_NR_MEMORY_REGIONS                 4     /* Number of memory regions */
     78 
     79 /* Concert Sound effect level presets */
     80 #define LVM_CS_EFFECT_NONE                    0     /* 0% effect, minimum value */
     81 #define LVM_CS_EFFECT_LOW                 16384     /* 50% effect */
     82 #define LVM_CS_EFFECT_MED                 24576     /* 75% effect */
     83 #define LVM_CS_EFFECT_HIGH                32767     /* 100% effect, maximum value */
     84 
     85 /* Treble enhancement */
     86 #define LVM_TE_LOW_MIPS                   32767
     87 
     88 /* Bass enhancement effect level presets */
     89 #define LVM_BE_0DB                            0     /* 0dB boost, no effect */
     90 #define LVM_BE_3DB                            3     /* +3dB boost */
     91 #define LVM_BE_6DB                            6     /* +6dB boost */
     92 #define LVM_BE_9DB                            9     /* +9dB boost */
     93 #define LVM_BE_12DB                          12     /* +12dB boost */
     94 #define LVM_BE_15DB                          15     /* +15dB boost */
     95 
     96 /* N-Band Equalizer */
     97 #define LVM_EQ_NBANDS                         5    /* Number of bands for equalizer */
     98 
     99 /* Headroom management */
    100 #define LVM_HEADROOM_MAX_NBANDS               5
    101 
    102 /****************************************************************************************/
    103 /*                                                                                      */
    104 /*  Types                                                                               */
    105 /*                                                                                      */
    106 /****************************************************************************************/
    107 
    108 /* Instance handle */
    109 typedef void *LVM_Handle_t;
    110 
    111 
    112 /* Status return values */
    113 typedef enum
    114 {
    115     LVM_SUCCESS            = 0,                     /* Successful return from a routine */
    116     LVM_ALIGNMENTERROR     = 1,                     /* Memory alignment error */
    117     LVM_NULLADDRESS        = 2,                     /* NULL allocation address */
    118     LVM_OUTOFRANGE         = 3,                     /* Out of range control parameter */
    119     LVM_INVALIDNUMSAMPLES  = 4,                     /* Invalid number of samples */
    120     LVM_WRONGAUDIOTIME     = 5,                     /* Wrong time value for audio time*/
    121     LVM_ALGORITHMDISABLED  = 6,                     /* Algorithm is disabled*/
    122     LVM_ALGORITHMPSA       = 7,                     /* Algorithm PSA returns an error */
    123     LVM_RETURNSTATUS_DUMMY = LVM_MAXENUM
    124 } LVM_ReturnStatus_en;
    125 
    126 
    127 /* Buffer Management mode */
    128 typedef enum
    129 {
    130     LVM_MANAGED_BUFFERS   = 0,
    131     LVM_UNMANAGED_BUFFERS = 1,
    132     LVM_BUFFERS_DUMMY     = LVM_MAXENUM
    133 } LVM_BufferMode_en;
    134 
    135 /* Output device type */
    136 typedef enum
    137 {
    138     LVM_HEADPHONES             = 0,
    139     LVM_EX_HEADPHONES          = 1,
    140     LVM_SPEAKERTYPE_MAX        = LVM_MAXENUM
    141 } LVM_OutputDeviceType_en;
    142 
    143 /* Virtualizer mode selection*/
    144 typedef enum
    145 {
    146     LVM_CONCERTSOUND       = 0,
    147     LVM_VIRTUALIZERTYPE_DUMMY   = LVM_MAXENUM
    148 } LVM_VirtualizerType_en;
    149 
    150 /* N-Band Equaliser operating mode */
    151 typedef enum
    152 {
    153     LVM_EQNB_OFF   = 0,
    154     LVM_EQNB_ON    = 1,
    155     LVM_EQNB_DUMMY = LVM_MAXENUM
    156 } LVM_EQNB_Mode_en;
    157 
    158 /* Bass Enhancement operating mode */
    159 typedef enum
    160 {
    161     LVM_BE_OFF   = 0,
    162     LVM_BE_ON    = 1,
    163     LVM_BE_DUMMY = LVM_MAXENUM
    164 } LVM_BE_Mode_en;
    165 
    166 /* Bass Enhancement centre frequency selection control */
    167 typedef enum
    168 {
    169     LVM_BE_CENTRE_55Hz  = 0,
    170     LVM_BE_CENTRE_66Hz  = 1,
    171     LVM_BE_CENTRE_78Hz  = 2,
    172     LVM_BE_CENTRE_90Hz  = 3,
    173     LVM_BE_CENTRE_DUMMY = LVM_MAXENUM
    174 } LVM_BE_CentreFreq_en;
    175 
    176 /* Bass Enhancement HPF selection control */
    177 typedef enum
    178 {
    179     LVM_BE_HPF_OFF   = 0,
    180     LVM_BE_HPF_ON    = 1,
    181     LVM_BE_HPF_DUMMY = LVM_MAXENUM
    182 } LVM_BE_FilterSelect_en;
    183 
    184 /* Volume Control operating mode */
    185 typedef enum
    186 {
    187     LVM_VC_OFF   = 0,
    188     LVM_VC_ON    = 1,
    189     LVM_VC_DUMMY = LVM_MAXENUM
    190 } LVM_VC_Mode_en;
    191 
    192 /* Treble Enhancement operating mode */
    193 typedef enum
    194 {
    195     LVM_TE_OFF   = 0,
    196     LVM_TE_ON    = 1,
    197     LVM_TE_DUMMY = LVM_MAXENUM
    198 } LVM_TE_Mode_en;
    199 
    200 /* Headroom management operating mode */
    201 typedef enum
    202 {
    203     LVM_HEADROOM_OFF   = 0,
    204     LVM_HEADROOM_ON    = 1,
    205     LVM_Headroom_DUMMY = LVM_MAXENUM
    206 } LVM_Headroom_Mode_en;
    207 
    208 typedef enum
    209 {
    210     LVM_PSA_SPEED_SLOW,                                  /* Peak decaying at slow speed */
    211     LVM_PSA_SPEED_MEDIUM,                                /* Peak decaying at medium speed */
    212     LVM_PSA_SPEED_FAST,                                  /* Peak decaying at fast speed */
    213     LVM_PSA_SPEED_DUMMY = LVM_MAXENUM
    214 } LVM_PSA_DecaySpeed_en;
    215 
    216 typedef enum
    217 {
    218     LVM_PSA_OFF   = 0,
    219     LVM_PSA_ON    = 1,
    220     LVM_PSA_DUMMY = LVM_MAXENUM
    221 } LVM_PSA_Mode_en;
    222 
    223 /* Version information */
    224 typedef struct
    225 {
    226     LVM_CHAR                    *pVersionNumber;        /* Pointer to the version number in the format X.YY.ZZ */
    227     LVM_CHAR                    *pPlatform;             /* Pointer to the library platform type */
    228 } LVM_VersionInfo_st;
    229 
    230 
    231 /****************************************************************************************/
    232 /*                                                                                      */
    233 /*  Structures                                                                          */
    234 /*                                                                                      */
    235 /****************************************************************************************/
    236 
    237 /* Memory table containing the region definitions */
    238 typedef struct
    239 {
    240     LVM_MemoryRegion_st         Region[LVM_NR_MEMORY_REGIONS];  /* One definition for each region */
    241 } LVM_MemTab_t;
    242 
    243 /* N-Band equaliser band definition */
    244 typedef struct
    245 {
    246     LVM_INT16                   Gain;                   /* Band gain in dB */
    247     LVM_UINT16                  Frequency;              /* Band centre frequency in Hz */
    248     LVM_UINT16                  QFactor;                /* Band quality factor (x100) */
    249 } LVM_EQNB_BandDef_t;
    250 
    251 
    252 /* Headroom band definition */
    253 typedef struct
    254 {
    255     LVM_UINT16                  Limit_Low;              /* Low frequency limit of the band in Hertz */
    256     LVM_UINT16                  Limit_High;             /* High frequency limit of the band in Hertz */
    257     LVM_INT16                   Headroom_Offset;        /* Headroom = biggest band gain - Headroom_Offset */
    258 } LVM_HeadroomBandDef_t;
    259 
    260 
    261 /* Control Parameter structure */
    262 typedef struct
    263 {
    264     /* General parameters */
    265     LVM_Mode_en                 OperatingMode;          /* Bundle operating mode On/Bypass */
    266     LVM_Fs_en                   SampleRate;             /* Sample rate */
    267     LVM_Format_en               SourceFormat;           /* Input data format */
    268     LVM_OutputDeviceType_en     SpeakerType;            /* Output device type */
    269 
    270     /* Concert Sound Virtualizer parameters*/
    271     LVM_Mode_en                 VirtualizerOperatingMode; /* Virtualizer operating mode On/Off */
    272     LVM_VirtualizerType_en      VirtualizerType;          /* Virtualizer type: ConcertSound */
    273     LVM_UINT16                  VirtualizerReverbLevel;   /* Virtualizer reverb level in % */
    274     LVM_INT16                   CS_EffectLevel;           /* Concert Sound effect level */
    275 
    276     /* N-Band Equaliser parameters */
    277     LVM_EQNB_Mode_en            EQNB_OperatingMode;     /* N-Band Equaliser operating mode */
    278     LVM_UINT16                  EQNB_NBands;            /* Number of bands */
    279     LVM_EQNB_BandDef_t          *pEQNB_BandDefinition;  /* Pointer to equaliser definitions */
    280 
    281     /* Bass Enhancement parameters */
    282     LVM_BE_Mode_en              BE_OperatingMode;       /* Bass Enhancement operating mode */
    283     LVM_INT16                   BE_EffectLevel;         /* Bass Enhancement effect level */
    284     LVM_BE_CentreFreq_en        BE_CentreFreq;          /* Bass Enhancement centre frequency */
    285     LVM_BE_FilterSelect_en      BE_HPF;                 /* Bass Enhancement high pass filter selector */
    286 
    287     /* Volume Control parameters */
    288     LVM_INT16                   VC_EffectLevel;         /* Volume Control setting in dBs */
    289     LVM_INT16                   VC_Balance;             /* Left Right Balance control in dB (-96 to 96 dB), -ve values reduce
    290                                                            Right channel while +ve value reduces Left channel*/
    291 
    292     /* Treble Enhancement parameters */
    293     LVM_TE_Mode_en              TE_OperatingMode;       /* Treble Enhancement On/Off */
    294     LVM_INT16                   TE_EffectLevel;         /* Treble Enhancement gain dBs */
    295 
    296     /* Spectrum Analyzer parameters Control */
    297     LVM_PSA_Mode_en             PSA_Enable;
    298     LVM_PSA_DecaySpeed_en       PSA_PeakDecayRate;      /* Peak value decay rate*/
    299 
    300 } LVM_ControlParams_t;
    301 
    302 
    303 /* Instance Parameter structure */
    304 typedef struct
    305 {
    306     /* General */
    307     LVM_BufferMode_en           BufferMode;             /* Buffer management mode */
    308     LVM_UINT16                  MaxBlockSize;           /* Maximum processing block size */
    309 
    310     /* N-Band Equaliser */
    311     LVM_UINT16                  EQNB_NumBands;          /* Maximum number of equaliser bands */
    312 
    313     /* PSA */
    314     LVM_PSA_Mode_en             PSA_Included;            /* Controls the instance memory allocation for PSA: ON/OFF */
    315 } LVM_InstParams_t;
    316 
    317 /* Headroom management parameter structure */
    318 typedef struct
    319 {
    320     LVM_Headroom_Mode_en        Headroom_OperatingMode; /* Headroom Control On/Off */
    321     LVM_HeadroomBandDef_t       *pHeadroomDefinition;   /* Pointer to headroom bands definition */
    322     LVM_UINT16                  NHeadroomBands;         /* Number of headroom bands */
    323 
    324 } LVM_HeadroomParams_t;
    325 
    326 /****************************************************************************************/
    327 /*                                                                                      */
    328 /*  Function Prototypes                                                                 */
    329 /*                                                                                      */
    330 /****************************************************************************************/
    331 
    332 
    333 /****************************************************************************************/
    334 /*                                                                                      */
    335 /* FUNCTION:                LVM_GetVersionInfo                                          */
    336 /*                                                                                      */
    337 /* DESCRIPTION:                                                                         */
    338 /*  This function is used to retrieve information about the library's version.          */
    339 /*                                                                                      */
    340 /* PARAMETERS:                                                                          */
    341 /*  pVersion                Pointer to an empty version info structure                  */
    342 /*                                                                                      */
    343 /* RETURNS:                                                                             */
    344 /*  LVM_SUCCESS             Succeeded                                                   */
    345 /*  LVM_NULLADDRESS         when pVersion is NULL                                       */
    346 /*                                                                                      */
    347 /* NOTES:                                                                               */
    348 /*  1.  This function may be interrupted by the LVM_Process function                    */
    349 /*                                                                                      */
    350 /****************************************************************************************/
    351 LVM_ReturnStatus_en LVM_GetVersionInfo(LVM_VersionInfo_st  *pVersion);
    352 
    353 
    354 /****************************************************************************************/
    355 /*                                                                                      */
    356 /* FUNCTION:                LVM_GetMemoryTable                                          */
    357 /*                                                                                      */
    358 /* DESCRIPTION:                                                                         */
    359 /*  This function is used for memory allocation and free. It can be called in           */
    360 /*  two ways:                                                                           */
    361 /*                                                                                      */
    362 /*      hInstance = NULL                Returns the memory requirements                 */
    363 /*      hInstance = Instance handle     Returns the memory requirements and             */
    364 /*                                      allocated base addresses for the instance       */
    365 /*                                                                                      */
    366 /*  When this function is called for memory allocation (hInstance=NULL) the memory      */
    367 /*  base address pointers are NULL on return.                                           */
    368 /*                                                                                      */
    369 /*  When the function is called for free (hInstance = Instance Handle) the memory       */
    370 /*  table returns the allocated memory and base addresses used during initialisation.   */
    371 /*                                                                                      */
    372 /* PARAMETERS:                                                                          */
    373 /*  hInstance               Instance Handle                                             */
    374 /*  pMemoryTable            Pointer to an empty memory definition table                 */
    375 /*  pInstParams             Pointer to the instance parameters                          */
    376 /*                                                                                      */
    377 /* RETURNS:                                                                             */
    378 /*  LVM_SUCCESS             Succeeded                                                   */
    379 /*  LVM_NULLADDRESS         When one of pMemoryTable or pInstParams is NULL             */
    380 /*  LVM_OUTOFRANGE          When any of the Instance parameters are out of range        */
    381 /*                                                                                      */
    382 /* NOTES:                                                                               */
    383 /*  1.  This function may be interrupted by the LVM_Process function                    */
    384 /*                                                                                      */
    385 /****************************************************************************************/
    386 LVM_ReturnStatus_en LVM_GetMemoryTable(LVM_Handle_t         hInstance,
    387                                        LVM_MemTab_t         *pMemoryTable,
    388                                        LVM_InstParams_t     *pInstParams);
    389 
    390 
    391 /****************************************************************************************/
    392 /*                                                                                      */
    393 /* FUNCTION:                LVM_GetInstanceHandle                                       */
    394 /*                                                                                      */
    395 /* DESCRIPTION:                                                                         */
    396 /*  This function is used to create a bundle instance. It returns the created instance  */
    397 /*  handle through phInstance. All parameters are set to their default, inactive state. */
    398 /*                                                                                      */
    399 /* PARAMETERS:                                                                          */
    400 /*  phInstance              pointer to the instance handle                              */
    401 /*  pMemoryTable            Pointer to the memory definition table                      */
    402 /*  pInstParams             Pointer to the instance parameters                          */
    403 /*                                                                                      */
    404 /* RETURNS:                                                                             */
    405 /*  LVM_SUCCESS             Initialisation succeeded                                    */
    406 /*  LVM_NULLADDRESS         One or more memory has a NULL pointer                       */
    407 /*  LVM_OUTOFRANGE          When any of the Instance parameters are out of range        */
    408 /*                                                                                      */
    409 /* NOTES:                                                                               */
    410 /*  1. This function must not be interrupted by the LVM_Process function                */
    411 /*                                                                                      */
    412 /****************************************************************************************/
    413 LVM_ReturnStatus_en LVM_GetInstanceHandle(LVM_Handle_t        *phInstance,
    414                                           LVM_MemTab_t        *pMemoryTable,
    415                                           LVM_InstParams_t    *pInstParams);
    416 
    417 
    418 /****************************************************************************************/
    419 /*                                                                                      */
    420 /* FUNCTION:                LVM_ClearAudioBuffers                                       */
    421 /*                                                                                      */
    422 /* DESCRIPTION:                                                                         */
    423 /*  This function is used to clear the internal audio buffers of the bundle.            */
    424 /*                                                                                      */
    425 /* PARAMETERS:                                                                          */
    426 /*  hInstance               Instance handle                                             */
    427 /*                                                                                      */
    428 /* RETURNS:                                                                             */
    429 /*  LVM_SUCCESS             Initialisation succeeded                                    */
    430 /*  LVM_NULLADDRESS         Instance memory has a NULL pointer                          */
    431 /*                                                                                      */
    432 /* NOTES:                                                                               */
    433 /*  1. This function must not be interrupted by the LVM_Process function                */
    434 /*                                                                                      */
    435 /****************************************************************************************/
    436 LVM_ReturnStatus_en LVM_ClearAudioBuffers(LVM_Handle_t  hInstance);
    437 
    438 
    439 /****************************************************************************************/
    440 /*                                                                                      */
    441 /* FUNCTION:                 LVM_GetControlParameters                                   */
    442 /*                                                                                      */
    443 /* DESCRIPTION:                                                                         */
    444 /*  Request the LifeVibes module parameters. The current parameter set is returned      */
    445 /*  via the parameter pointer.                                                          */
    446 /*                                                                                      */
    447 /* PARAMETERS:                                                                          */
    448 /*  hInstance                Instance handle                                            */
    449 /*  pParams                  Pointer to an empty parameter structure                    */
    450 /*                                                                                      */
    451 /* RETURNS:                                                                             */
    452 /*  LVM_SUCCESS             Succeeded                                                   */
    453 /*  LVM_NULLADDRESS         when any of hInstance or pParams is NULL                    */
    454 /*                                                                                      */
    455 /* NOTES:                                                                               */
    456 /*  1.  This function may be interrupted by the LVM_Process function                    */
    457 /*                                                                                      */
    458 /****************************************************************************************/
    459 LVM_ReturnStatus_en LVM_GetControlParameters(LVM_Handle_t           hInstance,
    460                                              LVM_ControlParams_t    *pParams);
    461 
    462 
    463 /****************************************************************************************/
    464 /*                                                                                      */
    465 /* FUNCTION:                LVM_SetControlParameters                                    */
    466 /*                                                                                      */
    467 /* DESCRIPTION:                                                                         */
    468 /*  Sets or changes the LifeVibes module parameters.                                    */
    469 /*                                                                                      */
    470 /* PARAMETERS:                                                                          */
    471 /*  hInstance               Instance handle                                             */
    472 /*  pParams                 Pointer to a parameter structure                            */
    473 /*                                                                                      */
    474 /* RETURNS:                                                                             */
    475 /*  LVM_SUCCESS             Succeeded                                                   */
    476 /*  LVM_NULLADDRESS         When hInstance, pParams or any control pointers are NULL    */
    477 /*  LVM_OUTOFRANGE          When any of the control parameters are out of range         */
    478 /*                                                                                      */
    479 /* NOTES:                                                                               */
    480 /*  1.  This function may be interrupted by the LVM_Process function                    */
    481 /*                                                                                      */
    482 /****************************************************************************************/
    483 LVM_ReturnStatus_en LVM_SetControlParameters(LVM_Handle_t           hInstance,
    484                                              LVM_ControlParams_t    *pParams);
    485 
    486 
    487 /****************************************************************************************/
    488 /*                                                                                      */
    489 /* FUNCTION:                LVM_Process                                                 */
    490 /*                                                                                      */
    491 /* DESCRIPTION:                                                                         */
    492 /*  Process function for the LifeVibes module.                                          */
    493 /*                                                                                      */
    494 /* PARAMETERS:                                                                          */
    495 /*  hInstance               Instance handle                                             */
    496 /*  pInData                 Pointer to the input data                                   */
    497 /*  pOutData                Pointer to the output data                                  */
    498 /*  NumSamples              Number of samples in the input buffer                       */
    499 /*  AudioTime               Audio Time of the current input data in milli-seconds       */
    500 /*                                                                                      */
    501 /* RETURNS:                                                                             */
    502 /*  LVM_SUCCESS            Succeeded                                                    */
    503 /*  LVM_INVALIDNUMSAMPLES  When the NumSamples is not a valied multiple in unmanaged    */
    504 /*                         buffer mode                                                  */
    505 /*  LVM_ALIGNMENTERROR     When either the input our output buffers are not 32-bit      */
    506 /*                         aligned in unmanaged mode                                    */
    507 /*  LVM_NULLADDRESS        When one of hInstance, pInData or pOutData is NULL           */
    508 /*                                                                                      */
    509 /* NOTES:                                                                               */
    510 /*  1. The input and output buffers must be 32-bit aligned                              */
    511 /*  2. Number of samples is defined as follows:                                         */
    512 /*      MONO                the number of samples in the block                          */
    513 /*      MONOINSTEREO        the number of sample pairs in the block                     */
    514 /*      STEREO              the number of sample pairs in the block                     */
    515 /*                                                                                      */
    516 /****************************************************************************************/
    517 #ifdef BUILD_FLOAT
    518 LVM_ReturnStatus_en LVM_Process(LVM_Handle_t                hInstance,
    519                                 const LVM_FLOAT             *pInData,
    520                                 LVM_FLOAT                      *pOutData,
    521                                 LVM_UINT16                  NumSamples,
    522                                 LVM_UINT32                  AudioTime);
    523 #else
    524 LVM_ReturnStatus_en LVM_Process(LVM_Handle_t                hInstance,
    525                                 const LVM_INT16             *pInData,
    526                                 LVM_INT16                   *pOutData,
    527                                 LVM_UINT16                  NumSamples,
    528                                 LVM_UINT32                  AudioTime);
    529 #endif
    530 
    531 
    532 /****************************************************************************************/
    533 /*                                                                                      */
    534 /* FUNCTION:                LVM_SetHeadroomParams                                       */
    535 /*                                                                                      */
    536 /* DESCRIPTION:                                                                         */
    537 /*  This function is used to set the automatic headroom management parameters.          */
    538 /*                                                                                      */
    539 /* PARAMETERS:                                                                          */
    540 /*  hInstance               Instance Handle                                             */
    541 /*  pHeadroomParams         Pointer to headroom parameter structure                     */
    542 /*                                                                                      */
    543 /* RETURNS:                                                                             */
    544 /*  LVM_NULLADDRESS         When hInstance or pHeadroomParams is NULL                   */
    545 /*  LVM_SUCCESS             Succeeded                                                   */
    546 /*                                                                                      */
    547 /* NOTES:                                                                               */
    548 /*  1.  This function may be interrupted by the LVM_Process function                    */
    549 /*                                                                                      */
    550 /****************************************************************************************/
    551 LVM_ReturnStatus_en LVM_SetHeadroomParams(  LVM_Handle_t            hInstance,
    552                                             LVM_HeadroomParams_t    *pHeadroomParams);
    553 
    554 
    555 /****************************************************************************************/
    556 /*                                                                                      */
    557 /* FUNCTION:                LVM_GetHeadroomParams                                       */
    558 /*                                                                                      */
    559 /* DESCRIPTION:                                                                         */
    560 /*  This function is used to get the automatic headroom management parameters.          */
    561 /*                                                                                      */
    562 /* PARAMETERS:                                                                          */
    563 /*  hInstance               Instance Handle                                             */
    564 /*  pHeadroomParams         Pointer to headroom parameter structure (output)            */
    565 /*                                                                                      */
    566 /* RETURNS:                                                                             */
    567 /*  LVM_SUCCESS             Succeeded                                                   */
    568 /*  LVM_NULLADDRESS         When hInstance or pHeadroomParams are NULL                  */
    569 /*                                                                                      */
    570 /* NOTES:                                                                               */
    571 /*  1.  This function may be interrupted by the LVM_Process function                    */
    572 /*                                                                                      */
    573 /****************************************************************************************/
    574 LVM_ReturnStatus_en LVM_GetHeadroomParams(  LVM_Handle_t            hInstance,
    575                                             LVM_HeadroomParams_t    *pHeadroomParams);
    576 
    577 
    578 /****************************************************************************************/
    579 /*                                                                                      */
    580 /* FUNCTION:                LVM_GetSpectrum                                             */
    581 /*                                                                                      */
    582 /* DESCRIPTION:                                                                         */
    583 /* This function is used to retrieve Spectral information at a given Audio time         */
    584 /* for display usage                                                                    */
    585 /*                                                                                      */
    586 /* PARAMETERS:                                                                          */
    587 /*  hInstance               Instance Handle                                             */
    588 /*  pCurrentPeaks           Pointer to location where currents peaks are to be saved    */
    589 /*  pPastPeaks              Pointer to location where past peaks are to be saved        */
    590 /*  pCentreFreqs            Pointer to location where centre frequency of each band is  */
    591 /*                          to be saved                                                 */
    592 /*  AudioTime               Audio time at which the spectral information is needed      */
    593 /*                                                                                      */
    594 /* RETURNS:                                                                             */
    595 /*  LVM_SUCCESS             Succeeded                                                   */
    596 /*  LVM_NULLADDRESS         If any of input addresses are NULL                          */
    597 /*  LVM_WRONGAUDIOTIME      Failure due to audio time error                             */
    598 /*                                                                                      */
    599 /* NOTES:                                                                               */
    600 /*  1. This function may be interrupted by the LVM_Process function                     */
    601 /*                                                                                      */
    602 /****************************************************************************************/
    603 LVM_ReturnStatus_en LVM_GetSpectrum( LVM_Handle_t            hInstance,
    604                                      LVM_UINT8               *pCurrentPeaks,
    605                                      LVM_UINT8               *pPastPeaks,
    606                                      LVM_INT32               AudioTime);
    607 
    608 /****************************************************************************************/
    609 /*                                                                                      */
    610 /* FUNCTION:                LVM_SetVolumeNoSmoothing                                    */
    611 /*                                                                                      */
    612 /* DESCRIPTION:                                                                         */
    613 /* This function is used to set output volume without any smoothing                     */
    614 /*                                                                                      */
    615 /* PARAMETERS:                                                                          */
    616 /*  hInstance               Instance Handle                                             */
    617 /*  pParams                 Control Parameters, only volume value is used here          */
    618 /*                                                                                      */
    619 /* RETURNS:                                                                             */
    620 /*  LVM_SUCCESS             Succeeded                                                   */
    621 /*  LVM_NULLADDRESS         If any of input addresses are NULL                          */
    622 /*  LVM_OUTOFRANGE          When any of the control parameters are out of range         */
    623 /*                                                                                      */
    624 /* NOTES:                                                                               */
    625 /*  1. This function may be interrupted by the LVM_Process function                     */
    626 /*                                                                                      */
    627 /****************************************************************************************/
    628 LVM_ReturnStatus_en LVM_SetVolumeNoSmoothing( LVM_Handle_t           hInstance,
    629                                               LVM_ControlParams_t    *pParams);
    630 
    631 
    632 #ifdef __cplusplus
    633 }
    634 #endif /* __cplusplus */
    635 
    636 #endif      /* __LVM_H__ */
    637 
    638