Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b4243d8 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Make loudness estimation rise-time instantenous" into gingerbread

parents 1688f6f4 02ccdedc
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -249,14 +249,9 @@ int32_t EffectEqualizer::process(audio_buffer_t *in, audio_buffer_t *out)
            float signalPowerDb = logf(mPowerSquared / mNextUpdateInterval / float(int64_t(1) << 48) + 1e-10f) / logf(10.0f) * 10.0f;
            signalPowerDb += 96.0f - 6.0f;

            /* Limit automatic EQ to small adjustments to limit the noise
             * introduced by updates of EQ bands. Additionally, we bias
	     * the loudness estimate strongly towards the highest seen
	     * values, to avoid pumping artifacts. */
            if (mLoudness < signalPowerDb - 1.0f) {
                mLoudness += 1.0f;
            } else if (mLoudness > signalPowerDb - 0.1f) {
                mLoudness -= 0.1f;
	    /* Immediate rise-time, and linear 10 dB/s decay */
            if (mLoudness > signalPowerDb + 0.1) {
                mLoudness -= 0.1;
            } else {
                mLoudness = signalPowerDb;
	    }