SAF
Loading...
Searching...
No Matches
multiconv_internal.h
Go to the documentation of this file.
1/*
2 * Copyright 2019 Leo McCormack
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
25#ifndef __MULTICONV_INTERNAL_H_INCLUDED__
26#define __MULTICONV_INTERNAL_H_INCLUDED__
27
28#include "multiconv.h" /* Include header for this example */
29#include "saf.h" /* Main include header for SAF */
30#include "saf_externals.h" /* To also include SAF dependencies (cblas etc.) */
31
32#ifdef __cplusplus
33extern "C" {
34#endif /* __cplusplus */
35
36/* ========================================================================== */
37/* Internal Parameters */
38/* ========================================================================== */
39
40#define MIN_FRAME_SIZE ( 512 )
41#define MAX_FRAME_SIZE ( 8192 )
43/* ========================================================================== */
44/* Structures */
45/* ========================================================================== */
46
48typedef struct _multiconv
49{
50 /* FIFO buffers */
52 float** inFIFO;
53 float** outFIFO;
55 /* Internal buffers */
56 float** inputFrameTD;
57 float** outputFrameTD;
59 /* internal */
60 void* hMultiConv;
63 float* filters;
67 int host_fs;
70 /* user parameters */
75
76
77#ifdef __cplusplus
78} /* extern "C" { */
79#endif /* __cplusplus */
80
81#endif /* __MULTICONV_INTERNAL_H_INCLUDED__ */
A multi-channel convolver.
Main include header for the Spatial_Audio_Framework (SAF)
Include header for SAF externals.
Main structure for multiconv.
int hostBlockSize_clamped
Clamped between MIN_FRAME_SIZE and MAX_FRAME_SIZE.
int nfilters
Current number of FIR filters.
void * hMultiConv
convolver handle
float ** outFIFO
Output FIFO buffer.
int nChannels
Current number of input/output channels.
int filter_length
length of the filters (input_wav_length/nInputChannels)
int host_fs
current samplerate of the host
int filter_fs
current samplerate of the filters
int FIFO_idx
FIFO buffer index.
int hostBlockSize
current host block size
float * filters
FLAT: nfilters x filter_length.
float ** inputFrameTD
Input buffer; MAX_NUM_CHANNELS x hostBlockSize_clamped.
float ** outputFrameTD
Output buffer; MAX_NUM_CHANNELS x hostBlockSize_clamped.
float ** inFIFO
Input FIFO buffer.
int enablePartitionedConv
1: enable partitioned convolution, 0: regular convolution (fft over the length of the filter)
int reInitFilters
FLAG: 0: do not reinit, 1: reinit, 2: reinit in progress.