The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
Double-buffering class. More...
Public Member Functions | |
doublebuffer_t (unsigned int nchannels_in, unsigned int nchannels_out, unsigned int outer_fragsize, unsigned int inner_fragsize) | |
Constructor of double buffer. More... | |
virtual | ~doublebuffer_t () |
mha_wave_t * | outer_process (mha_wave_t *s) |
Method to pass audio fragments into the inner layer. More... | |
Protected Member Functions | |
virtual mha_wave_t * | inner_process (mha_wave_t *s)=0 |
Method to realize inner processing callback. More... | |
Private Member Functions | |
unsigned int | min (unsigned int a, unsigned int b) |
Private Attributes | |
waveform_t | outer_out |
mha_wave_t | this_outer_out |
waveform_t | inner_in |
waveform_t | inner_out |
unsigned int | k_inner |
unsigned int | k_outer |
unsigned int | ch |
Double-buffering class.
This class has two layers: The outer layer, with an outer fragment size, and an inner layer, with its own fragment size. Data is passed into the inner layer through the doublebuffer_t::outr_process() callback. The pure virtual method doublebuffer_t::inner_process() is called whenever enough data is available.
MHASignal::doublebuffer_t::doublebuffer_t | ( | unsigned int | nchannels_in, |
unsigned int | nchannels_out, | ||
unsigned int | outer_fragsize, | ||
unsigned int | inner_fragsize | ||
) |
Constructor of double buffer.
nchannels_in | Number of channels at the input (both layers). |
nchannels_out | Number of channels at the output (both layers). |
outer_fragsize | Fragment size of the outer layer (e.g., hardware fragment size) |
inner_fragsize | Fragment size of the inner layer (e.g., software fragment size) |
|
virtual |
mha_wave_t * MHASignal::doublebuffer_t::outer_process | ( | mha_wave_t * | s | ) |
Method to pass audio fragments into the inner layer.
s | Pointer to input waveform fragment. |
|
protectedpure virtual |
Method to realize inner processing callback.
To be overwritten by derived classes.
s | Pointer to input waveform fragment. |
Implemented in db_t.
|
inlineprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |