|
/opt/src/beast/bse/bseresamplerimpl.hh
DESCRIPTION
Bse::Resampler::AlignedArray | | /opt/src/beast/bse/bseresamplerimpl.hh:154 |
Bse::Resampler::Downsampler2 | | /opt/src/beast/bse/bseresamplerimpl.hh:413 |
class Bse::Resampler::Downsampler2
{
vector< float > taps;
AlignedArray< float, 16 > history_even;
AlignedArray< float, 16 > history_odd;
AlignedArray< float, 16 > sse_taps;
| void
| process_4samples_aligned
| (input_even, input_odd, output); |
| float
| process_sample_unaligned
| (input_even, input_odd); |
| void
| process_block_aligned
| (input_even, input_odd, output, n_output_samples); |
| void
| process_block_unaligned
| (input_even, input_odd, output, n_output_samples); |
| void
| deinterleave2
| (data, n_data_values, output); |
|
| Downsampler2
| (init_taps); |
| void
| process_block
| (input, n_input_samples, output); |
| guint
| order
| (); |
| double
| delay
| (); |
}; |
Factor 2 downsampling of a data stream
Template arguments:
ORDER number of resampling filter coefficients
USE_SSE whether to use SSE (vectorized) instructions or not
|
|
Constructs a Downsampler2 class using a given set of filter coefficients.
init_taps: coefficients for the downsampling FIR halfband filter
The function process_block() takes a block of input samples and produces
a block with half the length, containing downsampled output samples.
Returns the filter order.
|
Bse::Resampler::Upsampler2 | | /opt/src/beast/bse/bseresamplerimpl.hh:286 |
Factor 2 upsampling of a data stream
Template arguments:
ORDER number of resampling filter coefficients
USE_SSE whether to use SSE (vectorized) instructions or not
|
|
Constructs an Upsampler2 object with a given set of filter coefficients.
init_taps: coefficients for the upsampling FIR halfband filter
The function process_block() takes a block of input samples and produces a
block with twice the length, containing interpolated output samples.
Returns the FIR filter order.
|
Resampler2 | | /opt/src/beast/bse/bseresamplerimpl.hh:413 |
fir_compute_sse_taps | | /opt/src/beast/bse/bseresamplerimpl.hh:138 |
fir_compute_sse_taps takes a normal vector of FIR taps as argument and
computes a specially scrambled version of these taps, ready to be used
for SSE operations (by fir_process_4samples_sse).
we require a special ordering of the FIR taps, to get maximum benefit of the SSE operations
example: suppose the FIR taps are [ x1 x2 x3 x4 x5 x6 x7 x8 x9 ], then the SSE taps become
[ x1 x2 x3 x4 0 x1 x2 x3 0 0 x1 x2 0 0 0 x1 <- for input[ 0]
x5 x6 x7 x8 x4 x5 x6 x7 x3 x4 x5 x6 x2 x3 x4 x5 <- for input[ 1]
x9 0 0 0 x8 x9 0 0 x7 x8 x9 0 x6 x7 x8 x9 ] <- for input[ 2]
\------------/\-----------/\-----------/\-----------/
for out0 for out1 for out2 for out3
so that we can compute out0, out1, out2 and out3 simultaneously
from input[ 0]..input[ 2]
fir_process_4samples_sse | | /opt/src/beast/bse/bseresamplerimpl.hh:88 |
FIR filter routine for 4 samples simultaneously
This routine produces (approximately) the same result as fir_process_one_sample
but computes four consecutive output values at once using vectorized SSE
instructions. Note that input and sse_taps need to be 16-byte aligned here.
Also note that sse_taps is not a plain impulse response here, but a special
version that needs to be computed with fir_compute_sse_taps.
fir_process_one_sample | | /opt/src/beast/bse/bseresamplerimpl.hh:63 |
FIR filter routine
A FIR filter has the characteristic that it has a finite impulse response,
and can be computed by convolution of the input signal with that finite
impulse response.
Thus, we use this for computing the output of the FIR filter
output = input[ 0] * taps[ 0] + input[ 1] * taps[ 1] + ... + input[N-1] * taps[N-1]
where input is the input signal, taps are the filter coefficients, in
other texts sometimes called h[ 0]..h[N-1] (impulse response) or a[ 0]..a[N-1]
(non recursive part of a digital filter), and N is the filter order.
fir_test_filter_sse | | /opt/src/beast/bse/bseresamplerimpl.hh:221 |
This function tests the SSEified FIR filter code (that is, the reordering
done by fir_compute_sse_taps and the actual computation implemented in
fir_process_4samples_sse).
It prints diagnostic information, and returns true if the filter
implementation works correctly, and false otherwise. The maximum filter
order to be tested can be optionally specified as argument.
|
|