From a8e4b3a1906f05f6ab7fc1ee94e0be513cb2c86a Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Thu, 12 Oct 2017 05:51:46 -0400 Subject: PBE+Surround: Localize some variables and fixup some flush ops Change-Id: I9fba5b8cbf69d261a7ca1c66e080c08d2fc6d9db --- lib/rbcodec/dsp/pbe.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'lib/rbcodec/dsp/pbe.c') diff --git a/lib/rbcodec/dsp/pbe.c b/lib/rbcodec/dsp/pbe.c index 3e2183a302..8fb893a661 100644 --- a/lib/rbcodec/dsp/pbe.c +++ b/lib/rbcodec/dsp/pbe.c @@ -40,7 +40,6 @@ static int pbe_strength = 0; static int pbe_precut = 0; static int32_t tcoef1, tcoef2, tcoef3; -static int32_t *b0[2], *b2[2], *b3[2]; static int b0_r[2],b2_r[2],b3_r[2],b0_w[2],b2_w[2],b3_w[2]; int32_t temp_buffer; static struct dsp_filter pbe_filter[5]; @@ -63,18 +62,6 @@ static void pbe_buffer_free(void) handle = -1; } -static void pbe_buffer_get_data(void) -{ - if (handle < 0) - return; - b0[0] = core_get_data(handle); - b0[1] = b0[0] + B0_SIZE; - b2[0] = b0[1] + B0_SIZE; - b2[1] = b2[0] + B2_SIZE; - b3[0] = b2[1] + B2_SIZE; - b3[1] = b3[0] + B3_SIZE; -} - static void dsp_pbe_flush(void) { memset(core_get_data(handle), 0, PBE_BUFSIZE); @@ -153,7 +140,14 @@ static void pbe_process(struct dsp_proc_entry *this, int b0_level = (B0_DLY * pbe_strength) / 100; int32_t x; - pbe_buffer_get_data(); + int32_t *b0[2], *b2[2], *b3[2]; + + b0[0] = core_get_data(handle); + b0[1] = b0[0] + B0_SIZE; + b2[0] = b0[1] + B0_SIZE; + b2[1] = b2[0] + B2_SIZE; + b3[0] = b2[1] + B2_SIZE; + b3[1] = b3[0] + B3_SIZE; for(int ch = 0; ch < num_channels; ch++) { -- cgit v1.2.3