summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChiwen Chang <rock1104.tw@yahoo.com.tw>2015-01-22 13:24:15 +1100
committerChiwen Chang <rock1104.tw@yahoo.com.tw>2015-01-22 13:28:34 +1100
commit30784cc262a4ee34f73c25704e19905c1be9998e (patch)
treef52d9ca9022e856de10f95e9281959220c6906be
parent5732e3e32d5b707b75aea494a49f7947d2e963a1 (diff)
downloadrockbox-30784cc262a4ee34f73c25704e19905c1be9998e.tar.gz
rockbox-30784cc262a4ee34f73c25704e19905c1be9998e.zip
fix pbe/haas surround dsps: surround_enabled, redo flush functions.
surround_enabled was never true, end up dsp_surround_flush didn't work; Thats why a cracking noise occurs in right channel when moving track positions. redo pbe/surround flush in a much simpler way suits the current single buffer style. Change-Id: I394054ddfb164b82c90b3dcf49df4442db87d8d2
-rw-r--r--lib/rbcodec/dsp/pbe.c22
-rw-r--r--lib/rbcodec/dsp/surround.c15
2 files changed, 11 insertions, 26 deletions
diff --git a/lib/rbcodec/dsp/pbe.c b/lib/rbcodec/dsp/pbe.c
index 49665880c0..28cdbb2084 100644
--- a/lib/rbcodec/dsp/pbe.c
+++ b/lib/rbcodec/dsp/pbe.c
@@ -79,20 +79,14 @@ static void dsp_pbe_flush(void)
if (pbe_strength == 0)
return; /* Not currently enabled */
- pbe_buffer_get_data();
-
- memset(b0[0], 0, B0_DLY * sizeof(int32_t));
- memset(b0[1], 0, B0_DLY * sizeof(int32_t));
- memset(b2[0], 0, B2_DLY * sizeof(int32_t));
- memset(b2[1], 0, B2_DLY * sizeof(int32_t));
- memset(b3[0], 0, B3_DLY * sizeof(int32_t));
- memset(b3[1], 0, B3_DLY * sizeof(int32_t));
- b0_r[0] = 0; b0_w[0] = B0_DLY;
- b0_r[1] = 0; b0_w[1] = B0_DLY;
- b2_r[0] = 0; b2_w[0] = B2_DLY;
- b2_r[1] = 0; b2_w[1] = B2_DLY;
- b3_r[0] = 0; b3_w[0] = B3_DLY;
- b3_r[1] = 0; b3_w[1] = B3_DLY;
+ unsigned int total_len = (B0_SIZE + B2_SIZE + B3_SIZE) * 2;
+ memset(core_get_data(handle),0,sizeof(int32_t) * total_len);
+ b0_r[0] = 0; b0_w[0] = 0;
+ b0_r[1] = 0; b0_w[1] = 0;
+ b2_r[0] = 0; b2_w[0] = 0;
+ b2_r[1] = 0; b2_w[1] = 0;
+ b3_r[0] = 0; b3_w[0] = 0;
+ b3_r[1] = 0; b3_w[1] = 0;
for (int i = 0; i < 5; i++)
filter_flush(&pbe_filter[i]);
diff --git a/lib/rbcodec/dsp/surround.c b/lib/rbcodec/dsp/surround.c
index f420bf4cf5..26d12b1952 100644
--- a/lib/rbcodec/dsp/surround.c
+++ b/lib/rbcodec/dsp/surround.c
@@ -96,18 +96,8 @@ static void dsp_surround_flush(void)
if (!surround_enabled)
return;
- surround_buffer_get_data();
-
- memset(b0,0,MAX_DLY/8 * sizeof(int32_t));
- memset(b2,0,MAX_DLY * sizeof(int32_t));
- memset(bb,0,MAX_DLY/4 * sizeof(int32_t));
- memset(hh,0,MAX_DLY/2 * sizeof(int32_t));
- memset(cl,0,MAX_DLY * sizeof(int32_t));
- b0_r = 0;b0_w = dly_size/8 - 1;
- b2_r = 0;b2_w = dly_size - 1;
- bb_r = 0;bb_w = dly_size/4 - 1;
- hh_r = 0;hh_w = dly_size/2 - 1;
- cl_r = 0;cl_w = dly_size - 1;
+ unsigned int total_len = B0_DLY + B2_DLY + BB_DLY + HH_DLY + CL_DLY;
+ memset(core_get_data(handle),0,sizeof(int32_t) * total_len);
}
static void surround_update_filter(unsigned int fout)
@@ -186,6 +176,7 @@ void dsp_surround_enable(int var)
core_free(handle);
handle = -1;
}
+ surround_enabled = now_enabled;
struct dsp_config *dsp = dsp_get_config(CODEC_IDX_AUDIO);
dsp_proc_enable(dsp, DSP_PROC_SURROUND, now_enabled);