Home | History | Annotate | Download | only in src
      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 #ifndef _LVPSA_QPD_H_
     19 #define _LVPSA_QPD_H_
     20 
     21 #include "LVM_Types.h"
     22 
     23 
     24 #ifdef __cplusplus
     25 extern "C" {
     26 #endif /* __cplusplus */
     27 
     28 typedef struct
     29 {
     30   LVM_INT32                            *pDelay;        /* pointer to the delayed samples (data of 32 bits)   */
     31   LVM_INT32                            Coefs[2];       /* pointer to the filter coefficients */
     32 }QPD_State_t, *pQPD_State_t;
     33 
     34 typedef struct
     35 {
     36     LVM_INT32 KP;    /*should store a0*/
     37     LVM_INT32 KM;    /*should store b2*/
     38 
     39 } QPD_C32_Coefs, *PQPD_C32_Coefs;
     40 
     41 typedef struct
     42 {
     43     LVM_INT32 Storage[1];
     44 
     45 } QPD_Taps_t, *pQPD_Taps_t;
     46 
     47 /************************************************************************************/
     48 /*                                                                                  */
     49 /* FUNCTION:            LVPSA_QPD_Process                                           */
     50 /*                                                                                  */
     51 /* DESCRIPTION:                                                                     */
     52 /*  Apply downsampling, post gain, quasi peak filtering and write the levels values */
     53 /*  in the buffer every 20 ms.                                                      */
     54 /*                                                                                  */
     55 /* PARAMETERS:                                                                      */
     56 /*                                                                                  */
     57 /* RETURNS:             void                                                        */
     58 /*                                                                                  */
     59 /************************************************************************************/
     60 void LVPSA_QPD_Process (            void                               *hInstance,
     61                                     LVM_INT16                          *pInSamps,
     62                                     LVM_INT16                           numSamples,
     63                                     LVM_INT16                           BandIndex);
     64 
     65 /************************************************************************************/
     66 /*                                                                                  */
     67 /* FUNCTION:            LVPSA_QPD_Init                                              */
     68 /*                                                                                  */
     69 /* DESCRIPTION:                                                                     */
     70 /*  Initialize a quasi peak filter instance.                                        */
     71 /*                                                                                  */
     72 /* PARAMETERS:                                                                      */
     73 /*  pInstance           Pointer to the instance                                     */
     74 /*   pTaps               Pointer to the filter's taps                               */
     75 /*   pCoef               Pointer to the filter's coefficients                       */
     76 /*                                                                                  */
     77 /* RETURNS:     void                                                                */
     78 /*                                                                                  */
     79 /************************************************************************************/
     80 void LVPSA_QPD_Init (   QPD_State_t       *pInstance,
     81                         QPD_Taps_t        *pTaps,
     82                         QPD_C32_Coefs     *pCoef     );
     83 
     84 
     85 #ifdef __cplusplus
     86 }
     87 #endif /* __cplusplus */
     88 
     89 #endif
     90 
     91