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