#include <SigProc/SigProcVector.h>
Static Public Member Functions | |
static int | VectorMultiply (short *restrict InA, float *restrict InB, float *restrict Out, int N, int StrideA, int StrideB, int StrideOut) |
static int | VectorMultiply (float *restrict InA, float *restrict InB, float *restrict Out, int N, int StrideA, int StrideB, int StrideOut) |
static int | ToFloat (short *restrict InA, float *restrict Out, int N, int StrideA, int StrideOut) |
static int | VecMulAdd (float *restrict InX, float *restrict InM, float InB, float *restrict Out, int N, int StrideX, int StrideM, int StrideOut) |
static int | VecAddMul (float *restrict InX, float *restrict InM, float InB, float *restrict Out, int N, int StrideX, int StrideM, int StrideOut) |
The tcSigProcVector class provides utility methods for handling math vectorized operations in an efficient manner.
int tcSigProcVector::VectorMultiply | ( | short *restrict | InA, | |
float *restrict | InB, | |||
float *restrict | Out, | |||
int | N, | |||
int | StrideA = 1 , |
|||
int | StrideB = 1 , |
|||
int | StrideOut = 1 | |||
) | [static] |
Performs a vector multiply according to:
Out[index] = InA[index]*InB[index]
InA | vector of N input elements | |
StrideA | Word increment needed to get to next item in A | |
InB | vector of N input elements | |
StrideB | Word increment needed to get to next item in B | |
Out | location to write the output buffer | |
StrideOut | Word increment needed to get to next item in Out | |
N | Number of words in the vectors. This must be a minimum of 20, must be divisible by 4. |
return -1 if N is less than 20 (no operations done) or 0 on success
int tcSigProcVector::VectorMultiply | ( | float *restrict | InA, | |
float *restrict | InB, | |||
float *restrict | Out, | |||
int | N, | |||
int | StrideA = 1 , |
|||
int | StrideB = 1 , |
|||
int | StrideOut = 1 | |||
) | [static] |
Performs a vector multiply according to:
Out[index] = InA[index]*InB[index]
InA | vector of N input elements | |
StrideA | Word increment needed to get to next item in A | |
InB | vector of N input elements | |
StrideB | Word increment needed to get to next item in B | |
Out | location to write the output buffer | |
StrideOut | Word increment needed to get to next item in Out | |
N | Number of words in the vectors. This must be a minimum of 20, must be divisible by 4. |
return -1 if N is less than 20 (no operations done) or 0 on success
int tcSigProcVector::ToFloat | ( | short *restrict | InA, | |
float *restrict | Out, | |||
int | N, | |||
int | StrideA = 1 , |
|||
int | StrideOut = 1 | |||
) | [static] |
Converts show data vector to floating point data vector:
Out[index] = (float)(InA[index])
InA | vector of N input elements | |
StrideA | Word increment needed to get to next item in A | |
Out | location to write the output buffer | |
StrideOut | Word increment needed to get to next item in Out | |
N | Number of words in the vectors. This must be a minimum of 20, must be divisible by 4. |
return -1 if N is less than 20 (no operations done) or 0 on success
int tcSigProcVector::VecMulAdd | ( | float *restrict | InX, | |
float *restrict | InM, | |||
float | InB, | |||
float *restrict | Out, | |||
int | N, | |||
int | StrideX = 1 , |
|||
int | StrideM = 1 , |
|||
int | StrideOut = 1 | |||
) | [static] |
Performs a vector multiply then add (to a constant) according to:
Out[index] = InX[index]*InM[index]+InB
InX | vector of N input elements | |
StrideX | Word increment needed to get to next item in X | |
InM | vector of N input elements | |
StrideM | Word increment needed to get to next item in M | |
InB | constant to be added per index | |
Out | location to write the output buffer | |
StrideOut | Word increment needed to get to next item in Out | |
N | Number of words in the vectors. This must be a minimum of 20, must be divisible by 4. |
return -1 if N is less than 20 (no operations done) or 0 on success
int tcSigProcVector::VecAddMul | ( | float *restrict | InX, | |
float *restrict | InM, | |||
float | InB, | |||
float *restrict | Out, | |||
int | N, | |||
int | StrideX = 1 , |
|||
int | StrideM = 1 , |
|||
int | StrideOut = 1 | |||
) | [static] |
Performs a vector add then multiply according to:
Out[index] = (InX[index]+InB)*InM[index]
InX | vector of N input elements | |
StrideX | Word increment needed to get to next item in X | |
InM | vector of N input elements | |
StrideM | Word increment needed to get to next item in M | |
InB | constant to be added per index | |
Out | location to write the output buffer | |
StrideOut | Word increment needed to get to next item in Out | |
N | Number of words in the vectors. This must be a minimum of 20, must be divisible by 4. |
return -1 if N is less than 20 (no operations done) or 0 on success