Loading media/libeffects/lvm/lib/Common/lib/VectorArithmetic.h +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ void Copy_Float_Mc_Stereo( const LVM_FLOAT *src, LVM_INT16 NrFrames, LVM_INT32 NrChannels); void Copy_Float_Stereo_Mc( const LVM_FLOAT *src, LVM_FLOAT *StereoOut, LVM_FLOAT *dst, LVM_INT16 NrFrames, LVM_INT32 NrChannels); Loading media/libeffects/lvm/lib/Common/src/Copy_16.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -116,30 +116,31 @@ void Copy_Float_Mc_Stereo(const LVM_FLOAT *src, } } // Merge a multichannel source with stereo contained in dst, to dst. // Merge a multichannel source with stereo contained in StereoOut, to dst. void Copy_Float_Stereo_Mc(const LVM_FLOAT *src, LVM_FLOAT *StereoOut, LVM_FLOAT *dst, LVM_INT16 NrFrames, /* Number of frames*/ LVM_INT32 NrChannels) { LVM_INT16 ii, jj; LVM_FLOAT *src_st = dst + 2 * (NrFrames - 1); // repack dst which carries stereo information // pack dst with stereo information of StereoOut // together with the upper channels of src. StereoOut += 2 * (NrFrames - 1); dst += NrChannels * (NrFrames - 1); src += NrChannels * (NrFrames - 1); for (ii = NrFrames; ii != 0; ii--) { dst[1] = src_st[1]; dst[0] = src_st[0]; // copy 1 before 0 is required for NrChannels == 3. dst[1] = StereoOut[1]; dst[0] = StereoOut[0]; // copy 1 before 0 is required for NrChannels == 3. for (jj = 2; jj < NrChannels; jj++) { dst[jj] = src[jj]; } dst -= NrChannels; src -= NrChannels; src_st -= 2; StereoOut -= 2; } } #endif Loading media/libeffects/lvm/lib/StereoWidening/src/LVCS_Private.h +4 −0 Original line number Diff line number Diff line Loading @@ -54,7 +54,11 @@ #define LVCS_COMPGAINFRAME 64 /* Compressor gain update interval */ /* Memory */ #ifdef SUPPORT_MC #define LVCS_SCRATCHBUFFERS 8 /* Number of buffers required for inplace processing */ #else #define LVCS_SCRATCHBUFFERS 6 /* Number of buffers required for inplace processing */ #endif #ifdef SUPPORT_MC /* * The Concert Surround module applies processing only on the first two Loading media/libeffects/lvm/lib/StereoWidening/src/LVCS_Process.cpp +45 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ LVCS_ReturnStatus_en LVCS_Process_CS(LVCS_Handle_t hInstance, * The Concert Surround module carries out processing only on L, R. */ pInput = pScratch + (2 * NrFrames); pStIn = pScratch + (LVCS_SCRATCHBUFFERS * NrFrames); pStIn = pScratch + ((LVCS_SCRATCHBUFFERS - 2) * NrFrames); /* The first two channel data is extracted from the input data and * copied into pInput buffer */ Loading Loading @@ -232,13 +232,45 @@ LVCS_ReturnStatus_en LVCS_Process(LVCS_Handle_t hInstance, */ if (pInstance->Params.OperatingMode != LVCS_OFF) { #ifdef SUPPORT_MC LVM_FLOAT *pStereoOut; /* * LVCS_Process_CS uses output buffer to store intermediate outputs of StereoEnhancer, * Equalizer, ReverbGenerator and BypassMixer. * So, to avoid i/o data overlapping, when i/o buffers are common, use scratch buffer * to store intermediate outputs. */ if (pOutData == pInData) { /* * Scratch memory is used in 4 chunks of (2 * NrFrames) size. * First chunk of memory is used by LVCS_StereoEnhancer and LVCS_ReverbGenerator, * second and fourth are used as input buffers by pInput and pStIn in LVCS_Process_CS. * Hence, pStereoOut is pointed to use unused third portion of scratch memory. */ pStereoOut = (LVM_FLOAT *) \ pInstance->MemoryTable. \ Region[LVCS_MEMREGION_TEMPORARY_FAST].pBaseAddress + ((LVCS_SCRATCHBUFFERS - 4) * NrFrames); } else { pStereoOut = pOutData; } /* * Call CS process function */ err = LVCS_Process_CS(hInstance, pInData, pStereoOut, NrFrames); #else err = LVCS_Process_CS(hInstance, pInData, pOutData, NumSamples); #endif /* * Compress to reduce expansion effect of Concert Sound and correct volume Loading @@ -257,10 +289,17 @@ LVCS_ReturnStatus_en LVCS_Process(LVCS_Handle_t hInstance, if(NumSamples < LVCS_COMPGAINFRAME) { #ifdef SUPPORT_MC NonLinComp_Float(Gain, /* Compressor gain setting */ pStereoOut, pStereoOut, (LVM_INT32)(2 * NrFrames)); #else NonLinComp_Float(Gain, /* Compressor gain setting */ pOutData, pOutData, (LVM_INT32)(2 * NumSamples)); #endif } else { Loading Loading @@ -289,7 +328,11 @@ LVCS_ReturnStatus_en LVCS_Process(LVCS_Handle_t hInstance, FinalGain = Gain; Gain = pInstance->CompressGain; #ifdef SUPPORT_MC pOutPtr = pStereoOut; #else pOutPtr = pOutData; #endif while(SampleToProcess > 0) { Loading Loading @@ -355,6 +398,7 @@ LVCS_ReturnStatus_en LVCS_Process(LVCS_Handle_t hInstance, } #ifdef SUPPORT_MC Copy_Float_Stereo_Mc(pInData, pStereoOut, pOutData, NrFrames, channels); Loading Loading
media/libeffects/lvm/lib/Common/lib/VectorArithmetic.h +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ void Copy_Float_Mc_Stereo( const LVM_FLOAT *src, LVM_INT16 NrFrames, LVM_INT32 NrChannels); void Copy_Float_Stereo_Mc( const LVM_FLOAT *src, LVM_FLOAT *StereoOut, LVM_FLOAT *dst, LVM_INT16 NrFrames, LVM_INT32 NrChannels); Loading
media/libeffects/lvm/lib/Common/src/Copy_16.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -116,30 +116,31 @@ void Copy_Float_Mc_Stereo(const LVM_FLOAT *src, } } // Merge a multichannel source with stereo contained in dst, to dst. // Merge a multichannel source with stereo contained in StereoOut, to dst. void Copy_Float_Stereo_Mc(const LVM_FLOAT *src, LVM_FLOAT *StereoOut, LVM_FLOAT *dst, LVM_INT16 NrFrames, /* Number of frames*/ LVM_INT32 NrChannels) { LVM_INT16 ii, jj; LVM_FLOAT *src_st = dst + 2 * (NrFrames - 1); // repack dst which carries stereo information // pack dst with stereo information of StereoOut // together with the upper channels of src. StereoOut += 2 * (NrFrames - 1); dst += NrChannels * (NrFrames - 1); src += NrChannels * (NrFrames - 1); for (ii = NrFrames; ii != 0; ii--) { dst[1] = src_st[1]; dst[0] = src_st[0]; // copy 1 before 0 is required for NrChannels == 3. dst[1] = StereoOut[1]; dst[0] = StereoOut[0]; // copy 1 before 0 is required for NrChannels == 3. for (jj = 2; jj < NrChannels; jj++) { dst[jj] = src[jj]; } dst -= NrChannels; src -= NrChannels; src_st -= 2; StereoOut -= 2; } } #endif Loading
media/libeffects/lvm/lib/StereoWidening/src/LVCS_Private.h +4 −0 Original line number Diff line number Diff line Loading @@ -54,7 +54,11 @@ #define LVCS_COMPGAINFRAME 64 /* Compressor gain update interval */ /* Memory */ #ifdef SUPPORT_MC #define LVCS_SCRATCHBUFFERS 8 /* Number of buffers required for inplace processing */ #else #define LVCS_SCRATCHBUFFERS 6 /* Number of buffers required for inplace processing */ #endif #ifdef SUPPORT_MC /* * The Concert Surround module applies processing only on the first two Loading
media/libeffects/lvm/lib/StereoWidening/src/LVCS_Process.cpp +45 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ LVCS_ReturnStatus_en LVCS_Process_CS(LVCS_Handle_t hInstance, * The Concert Surround module carries out processing only on L, R. */ pInput = pScratch + (2 * NrFrames); pStIn = pScratch + (LVCS_SCRATCHBUFFERS * NrFrames); pStIn = pScratch + ((LVCS_SCRATCHBUFFERS - 2) * NrFrames); /* The first two channel data is extracted from the input data and * copied into pInput buffer */ Loading Loading @@ -232,13 +232,45 @@ LVCS_ReturnStatus_en LVCS_Process(LVCS_Handle_t hInstance, */ if (pInstance->Params.OperatingMode != LVCS_OFF) { #ifdef SUPPORT_MC LVM_FLOAT *pStereoOut; /* * LVCS_Process_CS uses output buffer to store intermediate outputs of StereoEnhancer, * Equalizer, ReverbGenerator and BypassMixer. * So, to avoid i/o data overlapping, when i/o buffers are common, use scratch buffer * to store intermediate outputs. */ if (pOutData == pInData) { /* * Scratch memory is used in 4 chunks of (2 * NrFrames) size. * First chunk of memory is used by LVCS_StereoEnhancer and LVCS_ReverbGenerator, * second and fourth are used as input buffers by pInput and pStIn in LVCS_Process_CS. * Hence, pStereoOut is pointed to use unused third portion of scratch memory. */ pStereoOut = (LVM_FLOAT *) \ pInstance->MemoryTable. \ Region[LVCS_MEMREGION_TEMPORARY_FAST].pBaseAddress + ((LVCS_SCRATCHBUFFERS - 4) * NrFrames); } else { pStereoOut = pOutData; } /* * Call CS process function */ err = LVCS_Process_CS(hInstance, pInData, pStereoOut, NrFrames); #else err = LVCS_Process_CS(hInstance, pInData, pOutData, NumSamples); #endif /* * Compress to reduce expansion effect of Concert Sound and correct volume Loading @@ -257,10 +289,17 @@ LVCS_ReturnStatus_en LVCS_Process(LVCS_Handle_t hInstance, if(NumSamples < LVCS_COMPGAINFRAME) { #ifdef SUPPORT_MC NonLinComp_Float(Gain, /* Compressor gain setting */ pStereoOut, pStereoOut, (LVM_INT32)(2 * NrFrames)); #else NonLinComp_Float(Gain, /* Compressor gain setting */ pOutData, pOutData, (LVM_INT32)(2 * NumSamples)); #endif } else { Loading Loading @@ -289,7 +328,11 @@ LVCS_ReturnStatus_en LVCS_Process(LVCS_Handle_t hInstance, FinalGain = Gain; Gain = pInstance->CompressGain; #ifdef SUPPORT_MC pOutPtr = pStereoOut; #else pOutPtr = pOutData; #endif while(SampleToProcess > 0) { Loading Loading @@ -355,6 +398,7 @@ LVCS_ReturnStatus_en LVCS_Process(LVCS_Handle_t hInstance, } #ifdef SUPPORT_MC Copy_Float_Stereo_Mc(pInData, pStereoOut, pOutData, NrFrames, channels); Loading