From 02521e37c0494b83947c35160f3669de8adc9e5b Mon Sep 17 00:00:00 2001 From: Ricardo Garcia Date: Thu, 20 Nov 2014 08:54:51 -0800 Subject: Fix for Bundled Effects level compensation From the bundled effects, only the EQ had some sort of level compensation based on the settings of the effect. This patch takes into account all the status and levels of EQ, BassBoost and Virtualizer bundled effects and makes an informed decision on the overall level compensation. bug: 18213779 Change-Id: I23c7b94fe7da5482f0bbef0cbe715ea464631420 --- media/libeffects/lvm/wrapper/Bundle/EffectBundle.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'media/libeffects/lvm/wrapper/Bundle/EffectBundle.h') diff --git a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.h b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.h index 420f973..b3071f4 100644 --- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.h +++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.h @@ -142,6 +142,7 @@ static const uint32_t bandFreqRange[FIVEBAND_NUMBANDS][2] = { {1800001, 7000000}, {7000001, 1}}; +//Note: If these frequencies change, please update LimitLevel values accordingly. static const LVM_UINT16 EQNB_5BandPresetsFrequencies[] = { 60, /* Frequencies in Hz */ 230, @@ -192,6 +193,20 @@ static const PresetConfig gEqualizerPresets[] = { {"Pop"}, {"Rock"}}; +/* The following tables have been computed using the actual levels measured by the output of + * white noise or pink noise (IEC268-1) for the EQ and BassBoost Effects. These are estimates of + * the actual energy that 'could' be present in the given band. + * If the frequency values in EQNB_5BandPresetsFrequencies change, these values might need to be + * updated. + */ + +static const float LimitLevel_bandEnergyContribution[FIVEBAND_NUMBANDS] = { + 5.0, 6.5, 6.45, 4.8, 1.7 }; + +static const float LimitLevel_bassBoostEnergyContribution = 6.7; + +static const float LimitLevel_virtualizerContribution = 1.9; + #if __cplusplus } // extern "C" #endif -- cgit v1.1