summaryrefslogtreecommitdiff
path: root/apps/dsp.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dsp.h')
-rw-r--r--apps/dsp.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/apps/dsp.h b/apps/dsp.h
index c42e712a5a..2a00f649f8 100644
--- a/apps/dsp.h
+++ b/apps/dsp.h
@@ -57,6 +57,44 @@ enum
57 DSP_CROSSFEED 57 DSP_CROSSFEED
58}; 58};
59 59
60
61/****************************************************************************
62 * NOTE: Any assembly routines that use these structures must be updated
63 * if current data members are moved or changed.
64 */
65struct resample_data
66{
67 uint32_t delta; /* 00h */
68 uint32_t phase; /* 04h */
69 int32_t last_sample[2]; /* 08h */
70 /* 10h */
71};
72
73/* This is for passing needed data to external dsp routines. If another
74 * dsp parameter needs to be passed, add to the end of the structure
75 * and remove from dsp_config.
76 * If another function type becomes assembly/external and requires dsp
77 * config info, add a pointer paramter of type "struct dsp_data *".
78 * If removing something from other than the end, reserve the spot or
79 * else update every implementation for every target.
80 * Be sure to add the offset of the new member for easy viewing as well. :)
81 * It is the first member of dsp_config and all members can be accessesed
82 * through the main aggregate but this is intended to make a safe haven
83 * for these items whereas the c part can be rearranged at will. dsp_data
84 * could even moved within dsp_config without disurbing the order.
85 */
86struct dsp_data
87{
88 int output_scale; /* 00h */
89 int num_channels; /* 04h */
90 struct resample_data resample_data; /* 08h */
91 int32_t clip_min; /* 18h */
92 int32_t clip_max; /* 1ch */
93 int32_t gain; /* 20h - Note that this is in S8.23 format. */
94 int frac_bits; /* 24h */
95 /* 28h */
96};
97
60struct dsp_config; 98struct dsp_config;
61 99
62int dsp_process(struct dsp_config *dsp, char *dest, 100int dsp_process(struct dsp_config *dsp, char *dest,