Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e30200e authored by Eric Laurent's avatar Eric Laurent Committed by Android Git Automerger
Browse files

am 33e0d834: am b6d71351: Merge "LVM release 1.05 delivery" into gingerbread

Merge commit '33e0d834'

* commit '33e0d834':
  LVM release 1.05 delivery
parents c28227d4 33e0d834
Loading
Loading
Loading
Loading
+55 −0
Original line number Diff line number Diff line
@@ -122,3 +122,58 @@ LOCAL_C_INCLUDES += \
    $(LOCAL_PATH)/StereoWidening/lib

include $(BUILD_STATIC_LIBRARY)

# Reverb library
include $(CLEAR_VARS)

LOCAL_ARM_MODE := arm

LOCAL_SRC_FILES:= \
    Reverb/src/LVREV_ApplyNewSettings.c \
    Reverb/src/LVREV_ClearAudioBuffers.c \
    Reverb/src/LVREV_GetControlParameters.c \
    Reverb/src/LVREV_GetInstanceHandle.c \
    Reverb/src/LVREV_GetMemoryTable.c \
    Reverb/src/LVREV_Process.c \
    Reverb/src/LVREV_SetControlParameters.c \
    Reverb/src/LVREV_Tables.c \
    Common/src/Abs_32.c \
    Common/src/InstAlloc.c \
    Common/src/LoadConst_16.c \
    Common/src/LoadConst_32.c \
    Common/src/From2iToMono_32.c \
    Common/src/Mult3s_32x16.c \
    Common/src/FO_1I_D32F32C31_TRC_WRA_01.c \
    Common/src/FO_1I_D32F32Cll_TRC_WRA_01_Init.c \
    Common/src/DelayAllPass_Sat_32x16To32.c \
    Common/src/Copy_16.c \
    Common/src/Mac3s_Sat_32x16.c \
    Common/src/DelayWrite_32.c \
    Common/src/Shift_Sat_v32xv32.c \
    Common/src/Add2_Sat_32x32.c \
    Common/src/JoinTo2i_32x32.c \
    Common/src/MonoTo2I_32.c \
    Common/src/LVM_FO_HPF.c \
    Common/src/LVM_FO_LPF.c \
    Common/src/LVM_Polynomial.c \
    Common/src/LVM_Power10.c \
    Common/src/LVM_GetOmega.c \
    Common/src/MixSoft_2St_D32C31_SAT.c \
    Common/src/MixSoft_1St_D32C31_WRA.c \
    Common/src/MixInSoft_D32C31_SAT.c \
    Common/src/LVM_Mixer_TimeConstant.c \
    Common/src/Core_MixHard_2St_D32C31_SAT.c \
    Common/src/Core_MixSoft_1St_D32C31_WRA.c \
    Common/src/Core_MixInSoft_D32C31_SAT.c

LOCAL_MODULE:= libreverb

LOCAL_PRELINK_MODULE := false

LOCAL_C_INCLUDES += \
    $(LOCAL_PATH)/Reverb/lib \
    $(LOCAL_PATH)/Reverb/src \
    $(LOCAL_PATH)/Common/lib \
    $(LOCAL_PATH)/Common/src

include $(BUILD_STATIC_LIBRARY)
+18 −13
Original line number Diff line number Diff line
@@ -17,9 +17,9 @@

/****************************************************************************************

     $Author: nxp007753 $
     $Revision: 1315 $
     $Date: 2010-07-23 11:52:08 +0200 (Fri, 23 Jul 2010) $
     $Author: beq06068 $
     $Revision: 1401 $
     $Date: 2010-08-03 09:52:22 +0200 (Tue, 03 Aug 2010) $

*****************************************************************************************/

@@ -317,6 +317,7 @@ LVDBE_ReturnStatus_en LVDBE_Control(LVDBE_Handle_t hInstance,
{

    LVDBE_Instance_t    *pInstance =(LVDBE_Instance_t  *)hInstance;
    LVMixer3_2St_st     *pBypassMixer_Instance = &pInstance->pData->BypassMixer;


    /*
@@ -339,6 +340,14 @@ LVDBE_ReturnStatus_en LVDBE_Control(LVDBE_Handle_t hInstance,
    {
        LVDBE_SetAGC(pInstance,                         /* Instance pointer */
                     pParams);                          /* New parameters */

        LVC_Mixer_SetTimeConstant(&pBypassMixer_Instance->MixerStream[0],
            LVDBE_BYPASS_MIXER_TC,pParams->SampleRate,2);

        LVC_Mixer_SetTimeConstant(&pBypassMixer_Instance->MixerStream[1],
            LVDBE_BYPASS_MIXER_TC,pParams->SampleRate,2);


    }


@@ -356,17 +365,13 @@ LVDBE_ReturnStatus_en LVDBE_Control(LVDBE_Handle_t hInstance,

    if (pInstance->Params.OperatingMode==LVDBE_ON && pParams->OperatingMode==LVDBE_OFF)
    {
        LVDBE_Params_t  Params  = *pParams;             /* make local copy of params */
        Params.EffectLevel      = 0;                    /* zero effect level before switching off module*/
        pInstance->bTransitionOnToOff  = LVM_TRUE;             /* Set the CallBack */
        LVDBE_SetAGC(pInstance,                         /* Instance pointer */
                     &Params);                          /* New parameters */
        LVC_Mixer_SetTarget(&pInstance->pData->BypassMixer.MixerStream[0],0);
        LVC_Mixer_SetTarget(&pInstance->pData->BypassMixer.MixerStream[1],0x00007FFF);
    }
    if (pInstance->Params.OperatingMode==LVDBE_OFF && pParams->OperatingMode==LVDBE_ON)
    {
        pInstance->bTransitionOnToOff  = LVM_FALSE;     /* Set the CallBack */
        LVDBE_SetAGC(pInstance,                         /* Instance pointer */
                     pParams);                          /* New parameters */
        LVC_Mixer_SetTarget(&pInstance->pData->BypassMixer.MixerStream[0],0x00007FFF);
        LVC_Mixer_SetTarget(&pInstance->pData->BypassMixer.MixerStream[1],0);
    }

    /*
+33 −8
Original line number Diff line number Diff line
@@ -17,9 +17,9 @@

/****************************************************************************************

     $Author: nxp007753 $
     $Revision: 1081 $
     $Date: 2010-07-05 11:48:44 +0200 (Mon, 05 Jul 2010) $
     $Author: beq06068 $
     $Revision: 1399 $
     $Date: 2010-08-03 08:16:00 +0200 (Tue, 03 Aug 2010) $

*****************************************************************************************/

@@ -160,6 +160,7 @@ LVDBE_ReturnStatus_en LVDBE_Init(LVDBE_Handle_t *phInstance,

    LVDBE_Instance_t      *pInstance;
    LVMixer3_1St_st       *pMixer_Instance;
    LVMixer3_2St_st       *pBypassMixer_Instance;
    LVM_INT16             i;
    LVM_INT32             MixGain;

@@ -236,7 +237,8 @@ LVDBE_ReturnStatus_en LVDBE_Init(LVDBE_Handle_t *phInstance,
     */
    LVDBE_SetAGC(pInstance,                                     /* Set the AGC gain */
                 &pInstance->Params);
    pInstance->pData->AGCInstance.AGC_Gain = pInstance->pData->AGCInstance.AGC_MaxGain;   /* Default to the bass boost setting */
    pInstance->pData->AGCInstance.AGC_Gain = pInstance->pData->AGCInstance.AGC_MaxGain;
                                                /* Default to the bass boost setting */


    /*
@@ -245,7 +247,8 @@ LVDBE_ReturnStatus_en LVDBE_Init(LVDBE_Handle_t *phInstance,
    LVDBE_SetVolume(pInstance,                                         /* Set the Volume */
                    &pInstance->Params);

    pInstance->pData->AGCInstance.Volume = pInstance->pData->AGCInstance.Target;  /* Initialise as the target */
    pInstance->pData->AGCInstance.Volume = pInstance->pData->AGCInstance.Target;
                                                /* Initialise as the target */

    pMixer_Instance = &pInstance->pData->BypassVolume;
    MixGain = LVC_Mixer_GetTarget(&pMixer_Instance->MixerStream[0]);
@@ -258,9 +261,31 @@ LVDBE_ReturnStatus_en LVDBE_Init(LVDBE_Handle_t *phInstance,
    pMixer_Instance->MixerStream[0].CallbackSet = 0;

    /*
     * Initialise the clicks minimisation variable
     * Initialise the clicks minimisation BypassMixer
     */
    pInstance->bTransitionOnToOff   =   LVM_FALSE;

    pBypassMixer_Instance = &pInstance->pData->BypassMixer;

    /*
     * Setup the mixer gain for the processed path
     */
    pBypassMixer_Instance->MixerStream[0].CallbackParam = 0;
    pBypassMixer_Instance->MixerStream[0].pCallbackHandle = LVM_NULL;
    pBypassMixer_Instance->MixerStream[0].pCallBack = LVM_NULL;
    pBypassMixer_Instance->MixerStream[0].CallbackSet=0;
    LVC_Mixer_Init(&pBypassMixer_Instance->MixerStream[0],0,0);
    LVC_Mixer_SetTimeConstant(&pBypassMixer_Instance->MixerStream[0],
        LVDBE_BYPASS_MIXER_TC,pInstance->Params.SampleRate,2);
    /*
     * Setup the mixer gain for the unprocessed path
     */
    pBypassMixer_Instance->MixerStream[1].CallbackParam = 0;
    pBypassMixer_Instance->MixerStream[1].pCallbackHandle = LVM_NULL;
    pBypassMixer_Instance->MixerStream[1].pCallBack = LVM_NULL;
    pBypassMixer_Instance->MixerStream[1].CallbackSet=0;
    LVC_Mixer_Init(&pBypassMixer_Instance->MixerStream[1],0x00007FFF,0x00007FFF);
    LVC_Mixer_SetTimeConstant(&pBypassMixer_Instance->MixerStream[1],
        LVDBE_BYPASS_MIXER_TC,pInstance->Params.SampleRate,2);

    return(LVDBE_SUCCESS);
}
+6 −6
Original line number Diff line number Diff line
@@ -17,9 +17,9 @@

/****************************************************************************************

     $Author: nxp007753 $
     $Revision: 1081 $
     $Date: 2010-07-05 11:48:44 +0200 (Mon, 05 Jul 2010) $
     $Author: beq06068 $
     $Revision: 1399 $
     $Date: 2010-08-03 08:16:00 +0200 (Tue, 03 Aug 2010) $

*****************************************************************************************/

@@ -75,6 +75,8 @@ extern "C" {
#define LVDBE_SCRATCHBUFFERS_INPLACE     4       /* Number of buffers required for inplace processing */

#define LVDBE_MIXER_TC                   5       /* Mixer time  */
#define LVDBE_BYPASS_MIXER_TC            100     /* Bypass mixer time */


/****************************************************************************************/
/*                                                                                      */
@@ -92,6 +94,7 @@ typedef struct
    Biquad_2I_Order2_Taps_t     HPFTaps;            /* High pass filter taps */
    Biquad_1I_Order2_Taps_t     BPFTaps;            /* Band pass filter taps */
    LVMixer3_1St_st             BypassVolume;       /* Bypass volume scaler */
    LVMixer3_2St_st             BypassMixer;        /* Bypass Mixer for Click Removal */

} LVDBE_Data_t;

@@ -115,9 +118,6 @@ typedef struct
    /* Data and coefficient pointers */
    LVDBE_Data_t                *pData;                /* Instance data */
    LVDBE_Coef_t                *pCoef;                /* Instance coefficients */

    LVM_INT32                   bTransitionOnToOff;

} LVDBE_Instance_t;


+54 −44
Original line number Diff line number Diff line
@@ -17,9 +17,9 @@

/****************************************************************************************

     $Author: nxp007753 $
     $Revision: 1081 $
     $Date: 2010-07-05 11:48:44 +0200 (Mon, 05 Jul 2010) $
     $Author: beq06068 $
     $Revision: 1400 $
     $Date: 2010-08-03 09:22:37 +0200 (Tue, 03 Aug 2010) $

*****************************************************************************************/

@@ -89,10 +89,16 @@ LVDBE_ReturnStatus_en LVDBE_Process(LVDBE_Handle_t hInstance,

    LVDBE_Instance_t    *pInstance =(LVDBE_Instance_t  *)hInstance;
    LVM_INT32           *pScratch  = (LVM_INT32 *)pInstance->MemoryTable.Region[LVDBE_MEMREGION_SCRATCH].pBaseAddress;
    LVM_INT32           *pMono     = (LVM_INT32 *)pOutData;
    LVM_INT32           *pMono;
    LVM_INT16           *pInput    = (LVM_INT16 *)pInData;


    /* Scratch for Volume Control starts at offset of 2*NumSamples short values from pScratch */
    LVM_INT16           *pScratchVol = (LVM_INT16 *)(&pScratch[NumSamples]);

    /* Scratch for Mono path starts at offset of 2*NumSamples 32-bit values from pScratch */
    pMono                            = &pScratch[2*NumSamples];

    /*
     * Check the number of samples is not too large
     */
@@ -104,8 +110,10 @@ LVDBE_ReturnStatus_en LVDBE_Process(LVDBE_Handle_t hInstance,
    /*
     * Check if the algorithm is enabled
     */
    if ((pInstance->Params.OperatingMode != LVDBE_OFF) ||
        (pInstance->bTransitionOnToOff == LVM_TRUE))
    /* DBE path is processed when DBE is ON or during On/Off transitions */
    if ((pInstance->Params.OperatingMode == LVDBE_ON)||
        (LVC_Mixer_GetCurrent(&pInstance->pData->BypassMixer.MixerStream[0])
         !=LVC_Mixer_GetTarget(&pInstance->pData->BypassMixer.MixerStream[0])))
    {

        /*
@@ -113,7 +121,7 @@ LVDBE_ReturnStatus_en LVDBE_Process(LVDBE_Handle_t hInstance,
         * (For a 16-bit implementation apply headroom loss here)
         */
        Int16LShiftToInt32_16x32(pInput,                               /* Source 16-bit data    */
                                 pScratch,                             /* Destination 32-bit data */
                                 pScratch,                             /* Dest. 32-bit data     */
                                 (LVM_INT16)(2*NumSamples),            /* Left and right        */
                                 LVDBE_SCALESHIFT);                    /* Shift scale           */

@@ -156,28 +164,21 @@ LVDBE_ReturnStatus_en LVDBE_Process(LVDBE_Handle_t hInstance,
                                    pScratch,                          /* Stereo destination    */
                                    NumSamples);                       /* Number of samples     */

        if(pInstance->bTransitionOnToOff == LVM_TRUE)
        {
            if ((pInstance->pData->AGCInstance.AGC_Gain == pInstance->pData->AGCInstance.AGC_Target)&&
                (pInstance->pData->AGCInstance.AGC_Gain == 0))
            {
                    pInstance->bTransitionOnToOff = LVM_FALSE;
            }
        }



        /*
         * Convert 32-bit samples to 16-bit and saturate
         * (Not required for 16-bit implemenations)
         */
        Int32RShiftToInt16_Sat_32x16(pScratch,                         /* Source 32-bit data    */
                                     pOutData,                         /* Destination 16-bit data */
                                     (LVM_INT16 *)pScratch,            /* Dest. 16-bit data     */
                                     (LVM_INT16)(2*NumSamples),        /* Left and right        */
                                     LVDBE_SCALESHIFT);                /* Shift scale           */

    }
    else

    /* Bypass Volume path is processed when DBE is OFF or during On/Off transitions */
    if ((pInstance->Params.OperatingMode == LVDBE_OFF)||
        (LVC_Mixer_GetCurrent(&pInstance->pData->BypassMixer.MixerStream[1])
         !=LVC_Mixer_GetTarget(&pInstance->pData->BypassMixer.MixerStream[1])))
    {

        /*
@@ -186,11 +187,20 @@ LVDBE_ReturnStatus_en LVDBE_Process(LVDBE_Handle_t hInstance,
         */
        LVC_MixSoft_1St_D16C31_SAT(&pInstance->pData->BypassVolume,
                                  pInData,
                               pOutData,
                                  pScratchVol,
                               (LVM_INT16)(2*NumSamples));           /* Left and right          */

    }

    /*
     * Mix DBE processed path and bypass volume path
     */
    LVC_MixSoft_2St_D16C31_SAT(&pInstance->pData->BypassMixer,
                                    (LVM_INT16 *) pScratch,
                                    pScratchVol,
                                    pOutData,
                                    (LVM_INT16)(2*NumSamples));

    return(LVDBE_SUCCESS);
}

Loading