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 __LVCS_BYPASSMIX_H__
19#define __LVCS_BYPASSMIX_H__
20
21#ifdef __cplusplus
22extern "C" {
23#endif /* __cplusplus */
24
25
26/************************************************************************************/
27/*                                                                                  */
28/*    Includes                                                                      */
29/*                                                                                  */
30/************************************************************************************/
31
32#include "LVC_Mixer.h"
33
34
35/************************************************************************************/
36/*                                                                                  */
37/*    Structures                                                                    */
38/*                                                                                  */
39/************************************************************************************/
40
41/* Bypass mixer structure */
42typedef struct
43{
44    /* Mixer settings */
45#ifdef BUILD_FLOAT
46    LVMixer3_2St_FLOAT_st   Mixer_Instance;             /* Mixer instance */
47#else
48    LVMixer3_2St_st         Mixer_Instance;             /* Mixer instance */
49#endif
50    LVM_UINT16              Output_Shift;               /* Correcting gain output shift */
51
52} LVCS_BypassMix_t;
53
54#ifndef BUILD_FLOAT
55/* Output gain type */
56typedef struct
57{
58    /* Output gain settings, Gain = (Loss/32768) * 2^Shift */
59    LVM_UINT16              Shift;                      /* Left shifts required */
60    LVM_UINT16              Loss;                       /* Loss required */
61    LVM_UINT16              UnprocLoss;                 /* Unprocessed path loss */
62} Gain_t;
63#else
64typedef struct
65{
66    /* Output gain settings, Gain = (Loss/32768) * 2^Shift */
67    LVM_UINT16             Shift;                      /* Left shifts required */
68    LVM_FLOAT              Loss;                       /* Loss required */
69    LVM_FLOAT              UnprocLoss;                 /* Unprocessed path loss */
70} Gain_t;
71#endif
72/************************************************************************************/
73/*                                                                                    */
74/*    Function prototypes                                                                */
75/*                                                                                    */
76/************************************************************************************/
77
78LVCS_ReturnStatus_en LVCS_BypassMixInit(LVCS_Handle_t       hInstance,
79                                           LVCS_Params_t    *pParams);
80
81#ifndef BUILD_FLOAT
82LVCS_ReturnStatus_en LVCS_BypassMixer(LVCS_Handle_t         hInstance,
83                                      const LVM_INT16       *pProcessed,
84                                      const LVM_INT16       *unProcessed,
85                                      LVM_INT16       *pOutData,
86                                      LVM_UINT16      NumSamples);
87#else
88LVCS_ReturnStatus_en LVCS_BypassMixer(LVCS_Handle_t         hInstance,
89                                      const LVM_FLOAT       *pProcessed,
90                                      const LVM_FLOAT       *unProcessed,
91                                      LVM_FLOAT       *pOutData,
92                                      LVM_UINT16      NumSamples);
93#endif
94#ifdef __cplusplus
95}
96#endif /* __cplusplus */
97
98#endif  /* BYPASSMIX_H */
99