Class for fractional delay filter bank storage and calculation.
More...
#include <lancir.h>
|
const float * | getFilter (const double x) |
| Filter acquisition function.
|
|
bool | update (const double la0, const double k0, const int ElCount0) |
| Function updates the filter bank.
|
|
|
int | KernelLen |
| Resampling filter kernel's length, taps. Available after the update() function call. Always an even value, should not be lesser than 4.
|
|
|
void | makeFilterNorm (float *op, const double FracDelay) const |
| Filter calculation function.
|
|
void | setBuf (const int bi) |
| Current buffer (filter batch) repositioning function.
|
|
|
static void | replicateFilter (float *const p, const int kl, const int erp) |
| Filter tap replication function, for SIMD operations.
|
|
|
float * | Bufs [BufCount] |
| Address-aligned Bufs0 .
|
|
float * | Bufs0 [BufCount] |
| Buffers that hold all filters, original.
|
|
int | Bufs0Len [BufCount] |
| Allocated lengthes in Bufs0 , in float elements.
|
|
int | CurBuf |
| Filter buffer currently being filled.
|
|
int | CurBufFill |
| The number of fractional positions filled in the current filter buffer.
|
|
int | ElCount |
| Current ElCount .
|
|
int | ElRepl |
| The number of repetitions of each filter tap.
|
|
float ** | Filters |
| Fractional delay filters for all positions. A particular pointer equals NULL if a filter for such position has not been created yet.
|
|
int | FiltersLen |
| Allocated length of Filters, in elements.
|
|
int | fl2 |
| Half resampling filter's length, integer.
|
|
int | FracCount |
| The number of fractional positions for which filters can be created.
|
|
double | Freq |
| Circular frequency of the filter.
|
|
double | FreqA |
| Circular frequency of the window function.
|
|
double | k |
| Current k .
|
|
int | KernelLenA |
| SIMD-aligned and replicated filter kernel's length.
|
|
double | la |
| Current la .
|
|
double | Len2 |
| Half resampling filter's length, unrounded.
|
|
|
static const int | BufCount = 4 |
| The maximal number of buffers (filter batches) that can be in use.
|
|
static const int | BufLen = 256 |
| The number of fractional filters a single buffer (filter batch) may contain. Both the BufLen and BufCount should correspond to the FracCount used.
|
|
Class for fractional delay filter bank storage and calculation.
◆ getFilter()
const float * avir::CLancIR::CResizeFilters::getFilter |
( |
const double | x | ) |
|
Filter acquisition function.
Function returns filter at the specified fractional offset. This function can only be called after a prior update() function call.
- Parameters
-
x | Fractional offset, [0; 1]. |
- Returns
- Pointer to a previously-calculated or a new filter.
◆ makeFilterNorm()
void avir::CLancIR::CResizeFilters::makeFilterNorm |
( |
float * | op, |
|
|
const double | FracDelay ) const |
|
protected |
Filter calculation function.
Function creates a filter for the specified fractional delay. The update() function should be called prior to calling this function. The created filter is normalized (DC gain=1).
- Parameters
-
[out] | op | Output filter buffer. |
| FracDelay | Fractional delay, 0 to 1, inclusive. |
◆ replicateFilter()
static void avir::CLancIR::CResizeFilters::replicateFilter |
( |
float *const | p, |
|
|
const int | kl, |
|
|
const int | erp ) |
|
staticprotected |
Filter tap replication function, for SIMD operations.
Function replicates taps of the specified filter so that it can be used with SIMD loading instructions. This function works "in-place".
- Parameters
-
[in,out] | p | Filter buffer pointer, should be sized to contain kl * erp elements. |
| kl | Filter kernel's length, in taps. |
| erp | The number of repetitions to apply. |
◆ setBuf()
void avir::CLancIR::CResizeFilters::setBuf |
( |
const int | bi | ) |
|
|
protected |
Current buffer (filter batch) repositioning function.
Function changes the buffer currently being filled, checks its size and reallocates it, if necessary, then resets its fill counter.
- Parameters
-
bi | A new current buffer index. |
◆ update()
bool avir::CLancIR::CResizeFilters::update |
( |
const double | la0, |
|
|
const double | k0, |
|
|
const int | ElCount0 ) |
Function updates the filter bank.
- Parameters
-
la0 | Lanczos a parameter value (greater or equal to 2.0), can be fractional. |
k0 | Resizing step. |
ElCount0 | Image's element count, may be used for SIMD filter tap replication. |
- Returns
true
if an update occured and scanline resizing positions should be updated unconditionally.