From f324f3f68f30f1bc578d148c63f9756c890b1052 Mon Sep 17 00:00:00 2001 From: Adam Moss Date: Wed, 7 Jan 2015 10:24:25 +0000 Subject: [PATCH 1/3] Audio: Fix subwoofer output in software 5.1 decoding The FIR filter was only using the first sample of each input packet. --- Source/Core/AudioCommon/DPL2Decoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/AudioCommon/DPL2Decoder.cpp b/Source/Core/AudioCommon/DPL2Decoder.cpp index 680d193c45..df1bb76fd5 100644 --- a/Source/Core/AudioCommon/DPL2Decoder.cpp +++ b/Source/Core/AudioCommon/DPL2Decoder.cpp @@ -361,7 +361,7 @@ void DPL2Decode(float *samples, int numsamples, float *out) out[cur + 0] = lf[k]; out[cur + 1] = rf[k]; out[cur + 2] = cf[k]; - LFE_buf[lfe_pos] = (out[0] + out[1]) / 2; + LFE_buf[lfe_pos] = (out[cur + 0] + out[cur + 1]) / 2; out[cur + 3] = FIRFilter(LFE_buf, lfe_pos, len125, len125, filter_coefs_lfe); lfe_pos++; if (lfe_pos == len125) From 7580069deaf0455b9dc0fe4a576b5ad5cbd8120b Mon Sep 17 00:00:00 2001 From: Adam Moss Date: Wed, 7 Jan 2015 11:58:02 +0000 Subject: [PATCH 2/3] Audio: Fuller subwoofer processing for software 5.1 decode Code was only using front-left and front-right to calculate bass, but HRTF code - which this was once based on - uses all five channels and this sounds fuller. --- Source/Core/AudioCommon/DPL2Decoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/AudioCommon/DPL2Decoder.cpp b/Source/Core/AudioCommon/DPL2Decoder.cpp index df1bb76fd5..93a041d136 100644 --- a/Source/Core/AudioCommon/DPL2Decoder.cpp +++ b/Source/Core/AudioCommon/DPL2Decoder.cpp @@ -361,7 +361,7 @@ void DPL2Decode(float *samples, int numsamples, float *out) out[cur + 0] = lf[k]; out[cur + 1] = rf[k]; out[cur + 2] = cf[k]; - LFE_buf[lfe_pos] = (out[cur + 0] + out[cur + 1]) / 2; + LFE_buf[lfe_pos] = (lf[k] + rf[k] + 2.0 * cf[k] + lr[k] + rr[k]) / 2.0; out[cur + 3] = FIRFilter(LFE_buf, lfe_pos, len125, len125, filter_coefs_lfe); lfe_pos++; if (lfe_pos == len125) From b1c9f56acd967d4c06bb85c4e85c1706876f6c8d Mon Sep 17 00:00:00 2001 From: Adam Moss Date: Thu, 8 Jan 2015 10:48:30 +0000 Subject: [PATCH 3/3] Audio: Fix warning in DPL2 subwoofer change --- Source/Core/AudioCommon/DPL2Decoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/AudioCommon/DPL2Decoder.cpp b/Source/Core/AudioCommon/DPL2Decoder.cpp index 93a041d136..da16ee4af8 100644 --- a/Source/Core/AudioCommon/DPL2Decoder.cpp +++ b/Source/Core/AudioCommon/DPL2Decoder.cpp @@ -361,7 +361,7 @@ void DPL2Decode(float *samples, int numsamples, float *out) out[cur + 0] = lf[k]; out[cur + 1] = rf[k]; out[cur + 2] = cf[k]; - LFE_buf[lfe_pos] = (lf[k] + rf[k] + 2.0 * cf[k] + lr[k] + rr[k]) / 2.0; + LFE_buf[lfe_pos] = (lf[k] + rf[k] + 2.0f * cf[k] + lr[k] + rr[k]) / 2.0f; out[cur + 3] = FIRFilter(LFE_buf, lfe_pos, len125, len125, filter_coefs_lfe); lfe_pos++; if (lfe_pos == len125)