Loading media/libeffects/dynamicsproc/EffectDynamicsProcessing.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <new> #include <log/log.h> #include <sys/param.h> #include <audio_effects/effect_dynamicsprocessing.h> #include <dsp/DPBase.h> Loading Loading @@ -225,10 +226,6 @@ void DP_changeVariant(DynamicsProcessingContext *pContext, int newVariant) { } //switch } static inline bool isPowerOf2(unsigned long n) { return (n & (n - 1)) == 0; } void DP_configureVariant(DynamicsProcessingContext *pContext, int newVariant) { ALOGV("DP_configureVariant %d", newVariant); switch(newVariant) { Loading @@ -242,7 +239,7 @@ void DP_configureVariant(DynamicsProcessingContext *pContext, int newVariant) { desiredBlock); if (desiredBlock < minBlockSize) { currentBlock = minBlockSize; } else if (!isPowerOf2(desiredBlock)) { } else if (!powerof2(desiredBlock)) { //find next highest power of 2. currentBlock = 1 << (32 - __builtin_clz(desiredBlock)); } Loading Loading @@ -1297,4 +1294,3 @@ audio_effect_library_t AUDIO_EFFECT_LIBRARY_INFO_SYM = { }; }; // extern "C" media/libeffects/dynamicsproc/dsp/DPFrequency.cpp +2 −5 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <log/log.h> #include "DPFrequency.h" #include <algorithm> #include <sys/param.h> namespace dp_fx { Loading @@ -30,10 +31,6 @@ using Eigen::MatrixXd; #define CIRCULAR_BUFFER_UPSAMPLE 4 //4 times buffer size static constexpr float MIN_ENVELOPE = 1e-6f; //-120 dB //helper functionS static inline bool isPowerOf2(unsigned long n) { return (n & (n - 1)) == 0; } static constexpr float EPSILON = 0.0000001f; static inline bool isZero(float f) { Loading Loading @@ -151,7 +148,7 @@ void DPFrequency::configure(size_t blockSize, size_t overlapSize, } else if (mBlockSize < MIN_BLOCKSIZE) { mBlockSize = MIN_BLOCKSIZE; } else { if (!isPowerOf2(blockSize)) { if (!powerof2(blockSize)) { //find next highest power of 2. mBlockSize = 1 << (32 - __builtin_clz(blockSize)); } Loading Loading
media/libeffects/dynamicsproc/EffectDynamicsProcessing.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <new> #include <log/log.h> #include <sys/param.h> #include <audio_effects/effect_dynamicsprocessing.h> #include <dsp/DPBase.h> Loading Loading @@ -225,10 +226,6 @@ void DP_changeVariant(DynamicsProcessingContext *pContext, int newVariant) { } //switch } static inline bool isPowerOf2(unsigned long n) { return (n & (n - 1)) == 0; } void DP_configureVariant(DynamicsProcessingContext *pContext, int newVariant) { ALOGV("DP_configureVariant %d", newVariant); switch(newVariant) { Loading @@ -242,7 +239,7 @@ void DP_configureVariant(DynamicsProcessingContext *pContext, int newVariant) { desiredBlock); if (desiredBlock < minBlockSize) { currentBlock = minBlockSize; } else if (!isPowerOf2(desiredBlock)) { } else if (!powerof2(desiredBlock)) { //find next highest power of 2. currentBlock = 1 << (32 - __builtin_clz(desiredBlock)); } Loading Loading @@ -1297,4 +1294,3 @@ audio_effect_library_t AUDIO_EFFECT_LIBRARY_INFO_SYM = { }; }; // extern "C"
media/libeffects/dynamicsproc/dsp/DPFrequency.cpp +2 −5 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <log/log.h> #include "DPFrequency.h" #include <algorithm> #include <sys/param.h> namespace dp_fx { Loading @@ -30,10 +31,6 @@ using Eigen::MatrixXd; #define CIRCULAR_BUFFER_UPSAMPLE 4 //4 times buffer size static constexpr float MIN_ENVELOPE = 1e-6f; //-120 dB //helper functionS static inline bool isPowerOf2(unsigned long n) { return (n & (n - 1)) == 0; } static constexpr float EPSILON = 0.0000001f; static inline bool isZero(float f) { Loading Loading @@ -151,7 +148,7 @@ void DPFrequency::configure(size_t blockSize, size_t overlapSize, } else if (mBlockSize < MIN_BLOCKSIZE) { mBlockSize = MIN_BLOCKSIZE; } else { if (!isPowerOf2(blockSize)) { if (!powerof2(blockSize)) { //find next highest power of 2. mBlockSize = 1 << (32 - __builtin_clz(blockSize)); } Loading