SAF
Loading...
Searching...
No Matches
matrixconv_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 __MATRIXCONV_INTERNAL_H_INCLUDED__
26#define __MATRIXCONV_INTERNAL_H_INCLUDED__
27
28#include "matrixconv.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 )
42#define MAX_NUM_CHANNELS_FOR_WAV ( 1024 )
44/* ========================================================================== */
45/* Structures */
46/* ========================================================================== */
47
49typedef struct _matrixconv
50{
51 /* FIFO buffers */
53 float** inFIFO;
54 float** outFIFO;
56 /* input/output buffers */
57 float** inputFrameTD;
58 float** outputFrameTD;
60 /* internal */
64 float* filters;
69 int host_fs;
73 /* user parameters */
78
79
80#ifdef __cplusplus
81} /* extern "C" { */
82#endif /* __cplusplus */
83
84#endif /* __MATRIXCONV_INTERNAL_H_INCLUDED__ */
A standard matrix convolver.
Main include header for the Spatial_Audio_Framework (SAF)
Include header for SAF externals.
Main structure for matrixconv.
float * filters
the matrix of filters; FLAT: nOutputChannels x nInputChannels x filter_length
float ** outputFrameTD
Output buffer; MAX_NUM_CHANNELS x hostBlockSize_clamped.
int nOutputChannels
number of output channels (same as the number of channels in the loaded wav)
int input_wav_length
length of the wav files loaded in samples (inputs are concatenated)
float ** inFIFO
Input FIFO buffer.
int host_fs
current samplerate of the host
int enablePartitionedConv
0: disabled, 1: enabled
float ** inputFrameTD
Input buffer; MAX_NUM_CHANNELS x hostBlockSize_clamped.
void * hMatrixConv
saf_matrixConv handle
int nfilters
the number of filters (nOutputChannels x nInputChannels)
float ** outFIFO
Output FIFO buffer.
int hostBlockSize_clamped
Clamped between MIN_FRAME_SIZE and MAX_FRAME_SIZE.
int hostBlockSize
current host block size
int reInitFilters
FLAG: 0: do not reinit, 1: reinit, 2: reinit in progress.
int filter_length
length of the filters (input_wav_length/nInputChannels)
int nInputChannels
number of input channels
int FIFO_idx
FIFO buffer index.
int filter_fs
current samplerate of the filters