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 private layer interface of Dynamic Bass Enhancement module */ 21 /* */ 22 /* This files includes all definitions, types, structures and function */ 23 /* prototypes required by the execution layer. */ 24 /* */ 25 /****************************************************************************************/ 26 27 #ifndef __LVDBE_PRIVATE_H__ 28 #define __LVDBE_PRIVATE_H__ 29 30 /****************************************************************************************/ 31 /* */ 32 /* Includes */ 33 /* */ 34 /****************************************************************************************/ 35 36 #include <audio_utils/BiquadFilter.h> 37 #include "LVDBE.h" /* Calling or Application layer definitions */ 38 #include "BIQUAD.h" 39 #include "LVC_Mixer.h" 40 #include "AGC.h" 41 42 /****************************************************************************************/ 43 /* */ 44 /* Defines */ 45 /* */ 46 /****************************************************************************************/ 47 48 /* General */ 49 #define LVDBE_INVALID 0xFFFF /* Invalid init parameter */ 50 51 #define LVDBE_MIXER_TC 5 /* Mixer time */ 52 #define LVDBE_BYPASS_MIXER_TC 100 /* Bypass mixer time */ 53 54 /****************************************************************************************/ 55 /* */ 56 /* Structures */ 57 /* */ 58 /****************************************************************************************/ 59 60 /* Data structure */ 61 /* Data structure */ 62 typedef struct { 63 /* AGC parameters */ 64 AGC_MIX_VOL_2St1Mon_FLOAT_t AGCInstance; /* AGC instance parameters */ 65 66 /* Process variables */ 67 LVMixer3_1St_FLOAT_st BypassVolume; /* Bypass volume scaler */ 68 LVMixer3_2St_FLOAT_st BypassMixer; /* Bypass Mixer for Click Removal */ 69 70 } LVDBE_Data_FLOAT_t; 71 72 73 /* Instance structure */ 74 typedef struct { 75 /* Public parameters */ 76 LVDBE_Params_t Params; /* Instance parameters */ 77 LVDBE_Capabilities_t Capabilities; /* Instance capabilities */ 78 79 /* Data and coefficient pointers */ 80 LVDBE_Data_FLOAT_t* pData; /* Instance data */ 81 void* pScratch; /* scratch pointer */ 82 std::unique_ptr<android::audio_utils::BiquadFilter<LVM_FLOAT>> 83 pHPFBiquad; /* Biquad filter instance for HPF */ 84 std::unique_ptr<android::audio_utils::BiquadFilter<LVM_FLOAT>> 85 pBPFBiquad; /* Biquad filter instance for BPF */ 86 } LVDBE_Instance_t; 87 88 /****************************************************************************************/ 89 /* */ 90 /* Function prototypes */ 91 /* */ 92 /****************************************************************************************/ 93 94 void LVDBE_SetAGC(LVDBE_Instance_t* pInstance, LVDBE_Params_t* pParams); 95 96 void LVDBE_SetVolume(LVDBE_Instance_t* pInstance, LVDBE_Params_t* pParams); 97 98 void LVDBE_SetFilters(LVDBE_Instance_t* pInstance, LVDBE_Params_t* pParams); 99 100 #endif /* __LVDBE_PRIVATE_H__ */ 101