Loading media/libeffects/lvm/benchmarks/lvm_benchmark.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -53,8 +53,6 @@ constexpr audio_channel_mask_t kChMasks[] = { constexpr size_t kNumChMasks = std::size(kChMasks); constexpr int kSampleRate = 44100; // TODO(b/131240940) Remove once effects are updated to produce mono output constexpr size_t kMinOutputChannelCount = 2; /******************************************************************* * A test result running on Pixel 3 for comparison. Loading @@ -64,6 +62,10 @@ constexpr size_t kMinOutputChannelCount = 2; * ----------------------------------------------------- * Benchmark Time CPU Iterations * ----------------------------------------------------- * BM_LVM/1/0 52123 ns 51971 ns 13437 * BM_LVM/1/1 75397 ns 75175 ns 9382 * BM_LVM/1/2 40253 ns 40140 ns 17418 * BM_LVM/1/3 19918 ns 19860 ns 35230 * BM_LVM/2/0 62455 ns 62283 ns 11214 * BM_LVM/2/1 110086 ns 109751 ns 6350 * BM_LVM/2/2 44017 ns 43890 ns 15982 Loading Loading @@ -203,7 +205,7 @@ static void BM_LVM(benchmark::State& state) { // Run the test for (auto _ : state) { std::vector<float> output(kFrameCount * std::max(channelCount, kMinOutputChannelCount)); std::vector<float> output(kFrameCount * channelCount); benchmark::DoNotOptimize(input.data()); benchmark::DoNotOptimize(output.data()); Loading @@ -224,8 +226,7 @@ static void BM_LVM(benchmark::State& state) { } static void LVMArgs(benchmark::internal::Benchmark* b) { // TODO(b/131240940) Test single channel once effects are updated to process mono data for (int i = 2; i <= kNumChMasks; i++) { for (int i = FCC_1; i <= kNumChMasks; i++) { for (int j = 0; j < kNumEffectUuids; ++j) { b->Args({i, j}); } Loading media/libeffects/lvm/lib/Bass/src/LVDBE_Control.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -277,8 +277,8 @@ LVDBE_ReturnStatus_en LVDBE_Control(LVDBE_Handle_t hInstance, LVDBE_Params_t* pP /* * Create biquad instance */ pInstance->pHPFBiquad.reset(new android::audio_utils::BiquadFilter<LVM_FLOAT>( (FCC_1 == pParams->NrChannels) ? FCC_2 : pParams->NrChannels)); pInstance->pHPFBiquad.reset( new android::audio_utils::BiquadFilter<LVM_FLOAT>(pParams->NrChannels)); /* * Update the filters Loading media/libeffects/lvm/lib/Bass/src/LVDBE_Process.cpp +1 −5 Original line number Diff line number Diff line Loading @@ -79,11 +79,7 @@ LVDBE_ReturnStatus_en LVDBE_Process( const LVM_UINT16 NrFrames) // updated to use samples = frames * channels. { LVDBE_Instance_t* pInstance = (LVDBE_Instance_t*)hInstance; /*Extract number of Channels info*/ // Mono passed in as stereo const LVM_INT32 NrChannels = pInstance->Params.NrChannels == 1 ? 2 : pInstance->Params.NrChannels; const LVM_INT32 NrChannels = pInstance->Params.NrChannels; const LVM_INT32 NrSamples = NrChannels * NrFrames; /* Space to store DBE path computation */ Loading media/libeffects/lvm/lib/Bundle/src/LVM_Buffers.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -487,10 +487,6 @@ void LVM_BufferManagedOut(LVM_Handle_t hInstance, LVM_FLOAT* pOutData, LVM_UINT1 void LVM_BufferUnmanagedOut(LVM_Handle_t hInstance, LVM_UINT16* pNumSamples) { LVM_Instance_t* pInstance = (LVM_Instance_t*)hInstance; LVM_INT16 NumChannels = pInstance->NrChannels; if (NumChannels == 1) { /* Mono input is processed as stereo by LVM module */ NumChannels = 2; } #undef NrFrames #define NrFrames (*pNumSamples) // alias for clarity Loading media/libeffects/lvm/lib/Bundle/src/LVM_Process.cpp +0 −13 Original line number Diff line number Diff line Loading @@ -110,19 +110,6 @@ LVM_ReturnStatus_en LVM_Process(LVM_Handle_t hInstance, const LVM_FLOAT* pInData } } /* * Convert from Mono if necessary */ if (pInstance->Params.SourceFormat == LVM_MONO) { MonoTo2I_Float(pInData, /* Source */ pOutData, /* Destination */ (LVM_INT16)NumSamples); /* Number of input samples */ pInput = pOutData; pToProcess = pOutData; NrChannels = 2; ChMask = AUDIO_CHANNEL_OUT_STEREO; } /* * Process the data with managed buffers */ Loading Loading
media/libeffects/lvm/benchmarks/lvm_benchmark.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -53,8 +53,6 @@ constexpr audio_channel_mask_t kChMasks[] = { constexpr size_t kNumChMasks = std::size(kChMasks); constexpr int kSampleRate = 44100; // TODO(b/131240940) Remove once effects are updated to produce mono output constexpr size_t kMinOutputChannelCount = 2; /******************************************************************* * A test result running on Pixel 3 for comparison. Loading @@ -64,6 +62,10 @@ constexpr size_t kMinOutputChannelCount = 2; * ----------------------------------------------------- * Benchmark Time CPU Iterations * ----------------------------------------------------- * BM_LVM/1/0 52123 ns 51971 ns 13437 * BM_LVM/1/1 75397 ns 75175 ns 9382 * BM_LVM/1/2 40253 ns 40140 ns 17418 * BM_LVM/1/3 19918 ns 19860 ns 35230 * BM_LVM/2/0 62455 ns 62283 ns 11214 * BM_LVM/2/1 110086 ns 109751 ns 6350 * BM_LVM/2/2 44017 ns 43890 ns 15982 Loading Loading @@ -203,7 +205,7 @@ static void BM_LVM(benchmark::State& state) { // Run the test for (auto _ : state) { std::vector<float> output(kFrameCount * std::max(channelCount, kMinOutputChannelCount)); std::vector<float> output(kFrameCount * channelCount); benchmark::DoNotOptimize(input.data()); benchmark::DoNotOptimize(output.data()); Loading @@ -224,8 +226,7 @@ static void BM_LVM(benchmark::State& state) { } static void LVMArgs(benchmark::internal::Benchmark* b) { // TODO(b/131240940) Test single channel once effects are updated to process mono data for (int i = 2; i <= kNumChMasks; i++) { for (int i = FCC_1; i <= kNumChMasks; i++) { for (int j = 0; j < kNumEffectUuids; ++j) { b->Args({i, j}); } Loading
media/libeffects/lvm/lib/Bass/src/LVDBE_Control.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -277,8 +277,8 @@ LVDBE_ReturnStatus_en LVDBE_Control(LVDBE_Handle_t hInstance, LVDBE_Params_t* pP /* * Create biquad instance */ pInstance->pHPFBiquad.reset(new android::audio_utils::BiquadFilter<LVM_FLOAT>( (FCC_1 == pParams->NrChannels) ? FCC_2 : pParams->NrChannels)); pInstance->pHPFBiquad.reset( new android::audio_utils::BiquadFilter<LVM_FLOAT>(pParams->NrChannels)); /* * Update the filters Loading
media/libeffects/lvm/lib/Bass/src/LVDBE_Process.cpp +1 −5 Original line number Diff line number Diff line Loading @@ -79,11 +79,7 @@ LVDBE_ReturnStatus_en LVDBE_Process( const LVM_UINT16 NrFrames) // updated to use samples = frames * channels. { LVDBE_Instance_t* pInstance = (LVDBE_Instance_t*)hInstance; /*Extract number of Channels info*/ // Mono passed in as stereo const LVM_INT32 NrChannels = pInstance->Params.NrChannels == 1 ? 2 : pInstance->Params.NrChannels; const LVM_INT32 NrChannels = pInstance->Params.NrChannels; const LVM_INT32 NrSamples = NrChannels * NrFrames; /* Space to store DBE path computation */ Loading
media/libeffects/lvm/lib/Bundle/src/LVM_Buffers.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -487,10 +487,6 @@ void LVM_BufferManagedOut(LVM_Handle_t hInstance, LVM_FLOAT* pOutData, LVM_UINT1 void LVM_BufferUnmanagedOut(LVM_Handle_t hInstance, LVM_UINT16* pNumSamples) { LVM_Instance_t* pInstance = (LVM_Instance_t*)hInstance; LVM_INT16 NumChannels = pInstance->NrChannels; if (NumChannels == 1) { /* Mono input is processed as stereo by LVM module */ NumChannels = 2; } #undef NrFrames #define NrFrames (*pNumSamples) // alias for clarity Loading
media/libeffects/lvm/lib/Bundle/src/LVM_Process.cpp +0 −13 Original line number Diff line number Diff line Loading @@ -110,19 +110,6 @@ LVM_ReturnStatus_en LVM_Process(LVM_Handle_t hInstance, const LVM_FLOAT* pInData } } /* * Convert from Mono if necessary */ if (pInstance->Params.SourceFormat == LVM_MONO) { MonoTo2I_Float(pInData, /* Source */ pOutData, /* Destination */ (LVM_INT16)NumSamples); /* Number of input samples */ pInput = pOutData; pToProcess = pOutData; NrChannels = 2; ChMask = AUDIO_CHANNEL_OUT_STEREO; } /* * Process the data with managed buffers */ Loading