summaryrefslogtreecommitdiffstats
path: root/media/libeffects/lvm/wrapper/Bundle/EffectBundle.h
diff options
context:
space:
mode:
authorRicardo Garcia <rago@google.com>2014-11-20 08:54:51 -0800
committerRicardo Garcia <rago@google.com>2014-12-09 14:13:09 -0800
commit02521e37c0494b83947c35160f3669de8adc9e5b (patch)
treeb1da6be2aaee6e241bae52e10170f2a7b936f03d /media/libeffects/lvm/wrapper/Bundle/EffectBundle.h
parent9257000c453c1a6f6bf073ff0bf3ba7ef9baf183 (diff)
downloadframeworks_av-02521e37c0494b83947c35160f3669de8adc9e5b.zip
frameworks_av-02521e37c0494b83947c35160f3669de8adc9e5b.tar.gz
frameworks_av-02521e37c0494b83947c35160f3669de8adc9e5b.tar.bz2
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
Diffstat (limited to 'media/libeffects/lvm/wrapper/Bundle/EffectBundle.h')
-rw-r--r--media/libeffects/lvm/wrapper/Bundle/EffectBundle.h15
1 files changed, 15 insertions, 0 deletions
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