From c5cd686a83c6ea65a68d98023d5527fe4373d4e4 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Mon, 17 Sep 2012 09:02:23 -0700 Subject: Fix THD with max user EQ preset volume again There was a problem with previous fix in 1b6c677c where the THD was good for max volume but bad for intermediate high volume values. This fix does not limit the band gains but apply a correction to the effect bundle volume to take into account not only the maximum band gain but also the average band gains weighted by the proximity of each band to the max gain band. Change-Id: Ibedd8da7fce1e163117f29b3da332da0e4fe8889 --- media/libeffects/lvm/wrapper/Bundle/EffectBundle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 9c58ecd..330bb32 100644 --- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.h +++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.h @@ -38,7 +38,6 @@ extern "C" { #define VOLUME_CUP_LOAD_ARM9E 0 // Expressed in 0.1 MIPS #define BUNDLE_MEM_USAGE 25 // Expressed in kB //#define LVM_PCM -#define MAX_BAND_GAIN_DB 4 #ifndef OPENSL_ES_H_ static const effect_uuid_t SL_IID_VOLUME_ = { 0x09e8ede0, 0xddde, 0x11db, 0xb4f6, @@ -97,6 +96,7 @@ struct BundledEffectContext{ LVM_INT16 *workBuffer; int frameCount; int32_t bandGaindB[FIVEBAND_NUMBANDS]; + int volume; #ifdef LVM_PCM FILE *PcmInPtr; FILE *PcmOutPtr; -- cgit v1.1