LVDBE_Private.h revision d918324d44aa48b3b064ea9b87d0c520c38f15a9
1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright (C) 2004-2010 NXP Software 3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright (C) 2010 The Android Open Source Project 4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Licensed under the Apache License, Version 2.0 (the "License"); 6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * you may not use this file except in compliance with the License. 7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * You may obtain a copy of the License at 8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * http://www.apache.org/licenses/LICENSE-2.0 10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Unless required by applicable law or agreed to in writing, software 12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * distributed under the License is distributed on an "AS IS" BASIS, 13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * See the License for the specific language governing permissions and 15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * limitations under the License. 16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/****************************************************************************************/ 19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* */ 20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Header file for the private layer interface of Dynamic Bass Enhancement module */ 21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* */ 22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* This files includes all definitions, types, structures and function */ 23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* prototypes required by the execution layer. */ 24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* */ 25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/****************************************************************************************/ 26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifndef __LVDBE_PRIVATE_H__ 28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define __LVDBE_PRIVATE_H__ 29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifdef __cplusplus 31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern "C" { 32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif /* __cplusplus */ 33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/****************************************************************************************/ 36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* */ 37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Includes */ 38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* */ 39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/****************************************************************************************/ 40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "LVDBE.h" /* Calling or Application layer definitions */ 42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "BIQUAD.h" 43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "LVC_Mixer.h" 44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "AGC.h" 45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/****************************************************************************************/ 48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* */ 49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Defines */ 50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* */ 51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/****************************************************************************************/ 52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* General */ 54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LVDBE_INVALID 0xFFFF /* Invalid init parameter */ 55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Memory */ 57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LVDBE_MEMREGION_INSTANCE 0 /* Offset to the instance memory region */ 58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LVDBE_MEMREGION_PERSISTENT_DATA 1 /* Offset to persistent data memory region */ 59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LVDBE_MEMREGION_PERSISTENT_COEF 2 /* Offset to persistent coefficient region */ 60#define LVDBE_MEMREGION_SCRATCH 3 /* Offset to data scratch memory region */ 61 62#define LVDBE_INSTANCE_ALIGN 4 /* 32-bit alignment for structures */ 63#define LVDBE_PERSISTENT_DATA_ALIGN 4 /* 32-bit alignment for data */ 64#define LVDBE_PERSISTENT_COEF_ALIGN 4 /* 32-bit alignment for coef */ 65#define LVDBE_SCRATCH_ALIGN 4 /* 32-bit alignment for long data */ 66 67#define LVDBE_SCRATCHBUFFERS_INPLACE 4 /* Number of buffers required for inplace processing */ 68 69#define LVDBE_MIXER_TC 5 /* Mixer time */ 70#define LVDBE_BYPASS_MIXER_TC 100 /* Bypass mixer time */ 71 72 73/****************************************************************************************/ 74/* */ 75/* Structures */ 76/* */ 77/****************************************************************************************/ 78 79/* Data structure */ 80typedef struct 81{ 82 /* AGC parameters */ 83 AGC_MIX_VOL_2St1Mon_D32_t AGCInstance; /* AGC instance parameters */ 84 85 /* Process variables */ 86 Biquad_2I_Order2_Taps_t HPFTaps; /* High pass filter taps */ 87 Biquad_1I_Order2_Taps_t BPFTaps; /* Band pass filter taps */ 88 LVMixer3_1St_st BypassVolume; /* Bypass volume scaler */ 89 LVMixer3_2St_st BypassMixer; /* Bypass Mixer for Click Removal */ 90 91} LVDBE_Data_t; 92 93/* Coefs structure */ 94typedef struct 95{ 96 /* Process variables */ 97 Biquad_Instance_t HPFInstance; /* High pass filter instance */ 98 Biquad_Instance_t BPFInstance; /* Band pass filter instance */ 99 100} LVDBE_Coef_t; 101 102/* Instance structure */ 103typedef struct 104{ 105 /* Public parameters */ 106 LVDBE_MemTab_t MemoryTable; /* Instance memory allocation table */ 107 LVDBE_Params_t Params; /* Instance parameters */ 108 LVDBE_Capabilities_t Capabilities; /* Instance capabilities */ 109 110 /* Data and coefficient pointers */ 111 LVDBE_Data_t *pData; /* Instance data */ 112 LVDBE_Coef_t *pCoef; /* Instance coefficients */ 113} LVDBE_Instance_t; 114 115 116/****************************************************************************************/ 117/* */ 118/* Function prototypes */ 119/* */ 120/****************************************************************************************/ 121 122void LVDBE_SetAGC(LVDBE_Instance_t *pInstance, 123 LVDBE_Params_t *pParams); 124 125 126void LVDBE_SetVolume(LVDBE_Instance_t *pInstance, 127 LVDBE_Params_t *pParams); 128 129 130void LVDBE_SetFilters(LVDBE_Instance_t *pInstance, 131 LVDBE_Params_t *pParams); 132 133 134#ifdef __cplusplus 135} 136#endif /* __cplusplus */ 137 138#endif /* __LVDBE_PRIVATE_H__ */ 139 140 141