diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2012-12-19 17:34:57 -0500 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2013-05-04 13:43:33 -0400 |
commit | 78a45b47dede5ddf35dfc53e965b486a79177b18 (patch) | |
tree | edb3ad7c101e600a7cc3be4b40380430cbeb3e55 /lib/rbcodec/dsp/dsp_sample_io.h | |
parent | cdb71c707bb434f44368b72f2db3becc37b7a46c (diff) | |
download | rockbox-78a45b47dede5ddf35dfc53e965b486a79177b18.tar.gz rockbox-78a45b47dede5ddf35dfc53e965b486a79177b18.zip |
Cleanup and simplify latest DSP code incarnation.
Some things can just be a bit simpler in handling the list of stages
and some things, especially format change handling, can be simplified
for each stage implementation. Format changes are sent through the
configure() callback.
Hide some internal details and variables from processing stages and
let the core deal with it.
Do some miscellaneous cleanup and keep things a bit better factored.
Change-Id: I19dd8ce1d0b792ba914d426013088a49a52ecb7e
Diffstat (limited to 'lib/rbcodec/dsp/dsp_sample_io.h')
-rw-r--r-- | lib/rbcodec/dsp/dsp_sample_io.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/rbcodec/dsp/dsp_sample_io.h b/lib/rbcodec/dsp/dsp_sample_io.h index 0afe75c6ca..22b7a4a3f4 100644 --- a/lib/rbcodec/dsp/dsp_sample_io.h +++ b/lib/rbcodec/dsp/dsp_sample_io.h | |||
@@ -42,16 +42,25 @@ typedef void (*sample_output_fn_type)(struct sample_io_data *this, | |||
42 | /* This becomes part of the DSP aggregate */ | 42 | /* This becomes part of the DSP aggregate */ |
43 | struct sample_io_data | 43 | struct sample_io_data |
44 | { | 44 | { |
45 | int outcount; /* 00h: Output count */ | 45 | int outcount; /* 00h: Output count */ |
46 | struct sample_format format; /* General format info */ | 46 | struct sample_format format; /* Format for next dsp_process call */ |
47 | int sample_depth; /* Codec-specified sample depth */ | 47 | int sample_depth; /* Codec-specified sample depth */ |
48 | int stereo_mode; /* Codec-specified input format */ | 48 | int stereo_mode; /* Codec-specified channel format */ |
49 | sample_input_fn_type input_samples[2]; /* input functions */ | 49 | sample_input_fn_type input_samples; /* Initial input function */ |
50 | struct dsp_buffer sample_buf; /* Buffer descriptor for converted samples */ | 50 | struct dsp_buffer sample_buf; /* Buffer descriptor for converted samples */ |
51 | int32_t *sample_buf_arr[2]; /* Internal format buffer pointers */ | 51 | int32_t *sample_buf_p[2]; /* Internal format buffer pointers */ |
52 | sample_output_fn_type output_samples[2]; /* Final output functions */ | 52 | sample_output_fn_type output_samples; /* Final output function */ |
53 | uint8_t format_dirty; /* Format change set, avoids superfluous | ||
54 | increments before carrying it out */ | ||
55 | uint8_t output_version; /* Format version of src buffer at output */ | ||
53 | }; | 56 | }; |
54 | 57 | ||
58 | void dsp_sample_input_format_change(struct sample_io_data *this, | ||
59 | struct sample_format *format); | ||
60 | |||
61 | void dsp_sample_output_format_change(struct sample_io_data *this, | ||
62 | struct sample_format *format); | ||
63 | |||
55 | /* Sample IO watches the format setting from the codec */ | 64 | /* Sample IO watches the format setting from the codec */ |
56 | void dsp_sample_io_configure(struct sample_io_data *this, | 65 | void dsp_sample_io_configure(struct sample_io_data *this, |
57 | unsigned int setting, | 66 | unsigned int setting, |