summaryrefslogtreecommitdiff
path: root/lib/rbcodec/dsp/dsp_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/dsp/dsp_core.c')
-rw-r--r--lib/rbcodec/dsp/dsp_core.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/rbcodec/dsp/dsp_core.c b/lib/rbcodec/dsp/dsp_core.c
index 14bf228bd6..5108c9ef47 100644
--- a/lib/rbcodec/dsp/dsp_core.c
+++ b/lib/rbcodec/dsp/dsp_core.c
@@ -24,6 +24,9 @@
24#include "dsp_core.h" 24#include "dsp_core.h"
25#include "dsp_sample_io.h" 25#include "dsp_sample_io.h"
26 26
27#include "tdspeed.h"
28#include "resample.h"
29
27/* Define LOGF_ENABLE to enable logf output in this file */ 30/* Define LOGF_ENABLE to enable logf output in this file */
28/*#define LOGF_ENABLE*/ 31/*#define LOGF_ENABLE*/
29#include "logf.h" 32#include "logf.h"
@@ -70,6 +73,11 @@ dsp_proc_slot_arr[DSP_NUM_PROC_STAGES+DSP_VOICE_NUM_PROC_STAGES] IBSS_ATTR;
70/* General DSP config */ 73/* General DSP config */
71static struct dsp_config dsp_conf[DSP_COUNT] IBSS_ATTR; 74static struct dsp_config dsp_conf[DSP_COUNT] IBSS_ATTR;
72 75
76static const dsp_proc_init_fn_type dsp_init_fn[] INITDATA_ATTR = {
77 &dsp_timestretch_init,
78 &dsp_resample_init,
79};
80
73/** Processing stages support functions **/ 81/** Processing stages support functions **/
74static const struct dsp_proc_db_entry * 82static const struct dsp_proc_db_entry *
75proc_db_entry(const struct dsp_proc_slot *s) 83proc_db_entry(const struct dsp_proc_slot *s)
@@ -517,12 +525,15 @@ void dsp_init(void)
517 count = slot_count[i]; 525 count = slot_count[i];
518 dsp->slot_free_mask = MASK_N(uint32_t, count, shift); 526 dsp->slot_free_mask = MASK_N(uint32_t, count, shift);
519 527
520 intptr_t value = i; 528 dsp_sample_io_init(&dsp->io_data, i);
521 dsp_sample_io_configure(&dsp->io_data, DSP_INIT, &value); 529
530 /* Enable misc handler by default for the audio DSP */
531 if (i == CODEC_IDX_AUDIO)
532 dsp_proc_enable(dsp, DSP_PROC_MISC_HANDLER, true);
522 533
523 /* Notify each db entry of global init for each DSP */ 534 /* Call global init for DSPs that need it */
524 for (unsigned int j = 0; j < DSP_NUM_PROC_STAGES; j++) 535 for (unsigned int j = 0; j < ARRAYLEN(dsp_init_fn); ++j)
525 dsp_proc_database[j]->configure(NULL, dsp, DSP_INIT, i); 536 dsp_init_fn[j](dsp, i);
526 537
527 dsp_configure(dsp, DSP_RESET, 0); 538 dsp_configure(dsp, DSP_RESET, 0);
528 } 539 }