diff options
author | Eric Laurent <elaurent@google.com> | 2010-08-27 10:52:56 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2010-08-27 11:54:39 -0700 |
commit | d918324d44aa48b3b064ea9b87d0c520c38f15a9 (patch) | |
tree | 83632ad570c190d498d18a8e15f8301ae5171ace /media/libeffects/lvm/lib/StereoWidening | |
parent | 14cc6fcf8803ae7289a1e342532c26fe257b3d3f (diff) | |
download | frameworks_av-d918324d44aa48b3b064ea9b87d0c520c38f15a9.zip frameworks_av-d918324d44aa48b3b064ea9b87d0c520c38f15a9.tar.gz frameworks_av-d918324d44aa48b3b064ea9b87d0c520c38f15a9.tar.bz2 |
LVM release 1.07 delivery.
- Virtualizer now uses the correct control parameter, instead of reverberation
- Volume smoothing for first frame has been added
- Equalizer_setParameter now returns correct error code
- Correcting Non-Linear compressor gain step noise during transitions and effect level changes
- Removed SVN header blocks
- Memory and MIPS values have been added to the API
- Reverb uses a more efficient malloc for input PCM
- Reverb DecayHFRatio now ranges up to 2000
- Logging has been removed for most volume functions
Change-Id: Ib59e7e331263c3811559231b4ae90c82e34a8421
Diffstat (limited to 'media/libeffects/lvm/lib/StereoWidening')
16 files changed, 78 insertions, 123 deletions
diff --git a/media/libeffects/lvm/lib/StereoWidening/lib/LVCS.h b/media/libeffects/lvm/lib/StereoWidening/lib/LVCS.h index 1ab45cc..0d62274 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/lib/LVCS.h +++ b/media/libeffects/lvm/lib/StereoWidening/lib/LVCS.h @@ -15,14 +15,6 @@ * limitations under the License. */ -/**************************************************************************************** - - $Author: beq07716 $ - $Revision: 1001 $ - $Date: 2010-06-28 13:23:02 +0200 (Mon, 28 Jun 2010) $ - -*****************************************************************************************/ - /****************************************************************************************/ /* */ /* Header file for the application layer interface of Concert Sound and Concert */ diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.c b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.c index b1d9408..3e48c7e 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.c +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.c @@ -15,14 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: beq06068 $ - $Revision: 1307 $ - $Date: 2010-07-22 17:41:25 +0200 (Thu, 22 Jul 2010) $ - -*************************************************************************************/ - /************************************************************************************/ /* */ /* Includes */ diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.h index 79dff41..d1ef70a 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.h +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.h @@ -15,14 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: beq07716 $ - $Revision: 1001 $ - $Date: 2010-06-28 13:23:02 +0200 (Mon, 28 Jun 2010) $ - -*************************************************************************************/ - #ifndef __LVCS_BYPASSMIX_H__ #define __LVCS_BYPASSMIX_H__ diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Control.c b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Control.c index 668b151..a3ba42b 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Control.c +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Control.c @@ -15,14 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: nxp007753 $ - $Revision: 1331 $ - $Date: 2010-07-27 12:26:23 +0200 (Tue, 27 Jul 2010) $ - -*************************************************************************************/ - /************************************************************************************/ /* */ /* Includes */ @@ -127,6 +119,8 @@ LVCS_ReturnStatus_en LVCS_Control(LVCS_Handle_t hInstance, pInstance->VolCorrect = pLVCS_VolCorrectTable[Offset]; + pInstance->CompressGain = pInstance->VolCorrect.CompMin; + LVC_Mixer_Init(&pInstance->BypassMix.Mixer_Instance.MixerStream[0],0,0); diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.c b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.c index d8023d6..25b0d86 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.c +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.c @@ -15,14 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: nxp007753 $ - $Revision: 1331 $ - $Date: 2010-07-27 12:26:23 +0200 (Tue, 27 Jul 2010) $ - -*************************************************************************************/ - /************************************************************************************/ /* */ /* Includes */ diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.h index 10b02cc..cf96f5b 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.h +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.h @@ -15,14 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: beq07716 $ - $Revision: 1001 $ - $Date: 2010-06-28 13:23:02 +0200 (Mon, 28 Jun 2010) $ - -*************************************************************************************/ - #ifndef __LVCS_EQUALISER_H__ #define __LVCS_EQUALISER_H__ diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Headphone_Coeffs.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Headphone_Coeffs.h index 1d55281..1d55281 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Headphone_Coeffs.h +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Headphone_Coeffs.h diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Init.c b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Init.c index 82a8db2..1904e46 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Init.c +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Init.c @@ -15,14 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: nxp007753 $ - $Revision: 1331 $ - $Date: 2010-07-27 12:26:23 +0200 (Tue, 27 Jul 2010) $ - -*************************************************************************************/ - /************************************************************************************/ /* */ /* Includes */ diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Private.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Private.h index a977690..f3adb8d 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Private.h +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Private.h @@ -15,14 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: beq06068 $ - $Revision: 1307 $ - $Date: 2010-07-22 17:41:25 +0200 (Thu, 22 Jul 2010) $ - -*************************************************************************************/ - /************************************************************************************/ /* */ /* Header file for the private layer interface of concert sound. */ @@ -65,6 +57,7 @@ extern "C" { #define LVCS_REVERBSWITCH 0x0002 /* Reverberation enable control */ #define LVCS_EQUALISERSWITCH 0x0004 /* Equaliser enable control */ #define LVCS_BYPASSMIXSWITCH 0x0008 /* Bypass mixer enable control */ +#define LVCS_COMPGAINFRAME 64 /* Compressor gain update interval */ /* Memory */ #define LVCS_SCRATCHBUFFERS 6 /* Number of buffers required for inplace processing */ @@ -120,6 +113,7 @@ typedef struct LVCS_OutputDevice_en OutputDevice; /* Selected output device type */ LVCS_VolCorrect_t VolCorrect; /* Volume correction settings */ LVM_INT16 TransitionGain; /* Transition gain */ + LVM_INT16 CompressGain; /* Last used compressor gain*/ /* Sub-block configurations */ LVCS_StereoEnhancer_t StereoEnhancer; /* Stereo enhancer configuration */ diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Process.c b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Process.c index 999b8bb..5d99461 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Process.c +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Process.c @@ -15,14 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: beq07716 $ - $Revision: 1001 $ - $Date: 2010-06-28 13:23:02 +0200 (Mon, 28 Jun 2010) $ - -*************************************************************************************/ - /************************************************************************************/ /* */ @@ -213,10 +205,80 @@ LVCS_ReturnStatus_en LVCS_Process(LVCS_Handle_t hInstance, - (((LVM_INT32)pInstance->VolCorrect.CompMin * (Current1)) >> 15) + (((LVM_INT32)pInstance->VolCorrect.CompFull * (Current1)) >> 15) ); - NonLinComp_D16(Gain, /* Compressor gain setting */ - pOutData, - pOutData, - (LVM_INT32)(2*NumSamples)); + if(NumSamples < LVCS_COMPGAINFRAME) + { + NonLinComp_D16(Gain, /* Compressor gain setting */ + pOutData, + pOutData, + (LVM_INT32)(2*NumSamples)); + } + else + { + LVM_INT16 GainStep; + LVM_INT16 FinalGain; + LVM_INT16 SampleToProcess = NumSamples; + LVM_INT16 *pOutPtr; + + /* Large changes in Gain can cause clicks in output + Split data into small blocks and use interpolated gain values */ + + GainStep = (LVM_INT16)(((Gain-pInstance->CompressGain) * LVCS_COMPGAINFRAME)/NumSamples); + + if((GainStep ==0)&&(pInstance->CompressGain < Gain)) + { + GainStep=1; + } + else + { + if((GainStep ==0)&&(pInstance->CompressGain > Gain)) + { + GainStep=-1; + } + } + + FinalGain = Gain; + Gain = pInstance->CompressGain; + pOutPtr = pOutData; + + while(SampleToProcess > 0) + { + Gain = (LVM_INT16)(Gain + GainStep); + if((GainStep > 0)&& (FinalGain <= Gain)) + { + Gain = FinalGain; + GainStep =0; + } + + if((GainStep < 0)&& (FinalGain > Gain)) + { + Gain = FinalGain; + GainStep =0; + } + + if(SampleToProcess > LVCS_COMPGAINFRAME) + { + NonLinComp_D16(Gain, /* Compressor gain setting */ + pOutPtr, + pOutPtr, + (LVM_INT32)(2*LVCS_COMPGAINFRAME)); + pOutPtr +=(2*LVCS_COMPGAINFRAME); + SampleToProcess = (LVM_INT16)(SampleToProcess-LVCS_COMPGAINFRAME); + } + else + { + NonLinComp_D16(Gain, /* Compressor gain setting */ + pOutPtr, + pOutPtr, + (LVM_INT32)(2*SampleToProcess)); + + SampleToProcess = 0; + } + + } + } + + /* Store gain value*/ + pInstance->CompressGain = Gain; } diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.c b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.c index 861bde6..ee257b8 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.c +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.c @@ -15,14 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: nxp007753 $ - $Revision: 1315 $ - $Date: 2010-07-23 11:52:08 +0200 (Fri, 23 Jul 2010) $ - -*************************************************************************************/ - /************************************************************************************/ /* */ /* Includes */ diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.h index 1164bce..6e026ff 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.h +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.h @@ -15,14 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: beq07716 $ - $Revision: 1001 $ - $Date: 2010-06-28 13:23:02 +0200 (Mon, 28 Jun 2010) $ - -*************************************************************************************/ - #ifndef __LVCS_REVERBGENERATOR_H__ #define __LVCS_REVERBGENERATOR_H__ diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.c b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.c index 83748e6..b9b8b05 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.c +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.c @@ -15,14 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: nxp007753 $ - $Revision: 1331 $ - $Date: 2010-07-27 12:26:23 +0200 (Tue, 27 Jul 2010) $ - -*************************************************************************************/ - /************************************************************************************/ /* */ /* Includes */ diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.h index c3f6296..15bc407 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.h +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.h @@ -15,14 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: beq07716 $ - $Revision: 1001 $ - $Date: 2010-06-28 13:23:02 +0200 (Mon, 28 Jun 2010) $ - -*************************************************************************************/ - #ifndef __LVCS_STEREOENHANCER_H__ #define __LVCS_STEREOENHANCER_H__ diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.c b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.c index ad4eb1e..974de21 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.c +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.c @@ -15,14 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: beq07716 $ - $Revision: 1001 $ - $Date: 2010-06-28 13:23:02 +0200 (Mon, 28 Jun 2010) $ - -*************************************************************************************/ - /************************************************************************************/ /* */ diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.h index 72d6855..3f6c4c8 100755..100644 --- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.h +++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.h @@ -15,13 +15,6 @@ * limitations under the License. */ -/************************************************************************************ - - $Author: nxp27078 $ - $Revision: 672 $ - $Date: 2010-06-08 19:39:38 +0200 (Tue, 08 Jun 2010) $ - -*************************************************************************************/ #ifndef __LVCS_TABLES_H__ #define __LVCS_TABLES_H__ |