LIBDSP Version 4.1.9
LIBDSP Software Library
Loading...
Searching...
No Matches
tpt_math_dsp.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <limits.h>
#include <math.h>
#include <assert.h>
#include <float.h>
#include "libdsp/tpt_libdsp_version.h"
#include "libdsp/cosine_values.h"
#include "libdsp/tpt_math_f16.h"
#include "libdsp/tpt_math_fast.h"
#include "libdsp/tpt_math_vector.h"
#include "libdsp/tpt_math_support.h"
#include "libdsp/tpt_math_complex.h"
#include "libdsp/tpt_math_matrix.h"
#include "libdsp/tpt_math_transform.h"
#include "libdsp/tpt_math_filter.h"
#include "libdsp/tpt_math_controller.h"
#include "libdsp/tpt_math_statistics.h"
#include "libdsp/tpt_math_svm.h"
#include "libdsp/tpt_math_bayes.h"
#include "libdsp/tpt_math_qaternion.h"
#include "libdsp/tpt_math_window.h"
#include "libdsp/tpt_math_distance.h"
#include "libdsp/tpt_common_tables.h"
#include "libdsp/tpt_transform_internals.h"
#include "libdsp/tpt_math_config.h"
Include dependency graph for tpt_math_dsp.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  tpt_linear_interpolate_f32_s
 Instance structure for the floating-point Linear Interpolate function. More...
struct  tpt_bilinear_interpolate_f32_s
 Instance structure for the floating-point bilinear interpolation function. More...
struct  tpt_bilinear_interpolate_q7_s
 Instance structure for the Q7 bilinear interpolation function. More...
struct  tpt_bilinear_interpolate_q15_s
 Instance structure for the Q15 bilinear interpolation function. More...
struct  tpt_bilinear_interpolate_q31_s
 Instance structure for the Q31 bilinear interpolation function. More...

Macros

#define __FORCEINLINE   __attribute__((always_inline)) inline
#define __STATIC_FORCEINLINE   static inline __attribute__((always_inline))
#define LIKELY(EXPR)
#define UNLIKELY(EXPR)
#define SWAP(x, y, T)
#define SWAP_PAIR(x, y, T)
#define SQUARE(val)
#define OPT_BRANCH_PREDICTION   1
#define OPT_HIGHLY_ACCURATE   0
#define TPT_MATH_LOOPUNROLL   8
#define F64_MAX   ((f64_t)DBL_MAX)
#define F64_MIN   (-DBL_MAX)
#define F32_MAX   ((f32_t)FLT_MAX)
#define F32_MIN   (-FLT_MAX)
#define Q63_MAX   ((q63_t)(0x7FFFFFFFFFFFFFFFLL))
#define Q63_MIN   ((q63_t)(0x8000000000000000LL))
#define Q31_MAX   ((q31_t)(0x7FFFFFFFL))
#define Q31_MIN   ((q31_t)(0x80000000L))
#define Q15_MAX   ((q15_t)(0x7FFF))
#define Q15_MIN   ((q15_t)(0x8000))
#define Q7_MAX   ((q7_t)(0x7F))
#define Q7_MIN   ((q7_t)(0x80))
#define F64_ABSMAX   ((f64_t)DBL_MAX)
#define F64_ABSMIN   ((f64_t)0.0)
#define F32_ABSMAX   ((f32_t)FLT_MAX)
#define F32_ABSMIN   ((f32_t)0.0)
#define Q31_ABSMAX   ((q31_t)(0x7FFFFFFFL))
#define Q31_ABSMIN   ((q31_t)0)
#define Q15_ABSMAX   ((q15_t)(0x7FFF))
#define Q15_ABSMIN   ((q15_t)0)
#define Q7_ABSMAX   ((q7_t)(0x7F))
#define Q7_ABSMIN   ((q7_t)0)
#define ABS(val, bit)
#define CLIP(val, bit)
#define CLIPS(val, bit)
#define __CLZ   __DSP_CLZ
#define SCALE_COL_T(T, A, ROW, v, i, aRows, aCols)
#define __SSAT   __TPT_SSAT
#define __PKHBT(x, y, z)
#define __PKHTB(x, y, z)
#define __PACKq7(w, x, y, z)
#define mult_32x32_keep32(a, x, y)
#define multAcc_32x32_keep32(a, x, y)
#define multSub_32x32_keep32(a, x, y)
#define mult_32x32_keep32_R(a, x, y)
#define multAcc_32x32_keep32_R(a, x, y)
#define multSub_32x32_keep32_R(a, x, y)
#define SCALE_COL_F32(A, ROW, v, i, aRows, aCols)
#define SCALE_COL_F64(A, ROW, v, i, aRows, aCols)
#define F32_TO_Q7(val)
 Convert F32 to Q7 format This will use saturating arithmetic.
#define F32_TO_Q15(val)
 Convert F32 to Q15 format This will use saturating arithmetic.
#define F32_TO_Q31(val)
 Convert F32 to Q31 format This will use saturating arithmetic.
#define Q7_TO_F32(val)
 Convert Q7 to F32 format.
#define Q15_TO_F32(val)
 Convert Q15 to F32 format.
#define Q31_TO_F32(val)
 Convert Q31 to F32 format.
#define F64_TO_Q7(val)
 Convert F64 to Q7 format This will use saturating arithmetic.
#define F64_TO_Q15(val)
 Convert F64 to Q15 format This will use saturating arithmetic.
#define F64_TO_Q31(val)
 Convert F64 to Q31 format This will use saturating arithmetic.
#define Q7_TO_F64(val)
 Convert Q7 to F64 format.
#define Q15_TO_F64(val)
 Convert Q15 to F64 format.
#define Q31_TO_F64(val)
 Convert Q31 to F64 format.

Typedefs

typedef long double f128_t
 128-bit floating-point type definition.
typedef double f64_t
 64-bit floating-point type definition.
typedef float f32_t
 32-bit floating-point type definition.
typedef int64_t q63_t
 64-bit fractional data type in 1.63 format.
typedef int32_t q31_t
 32-bit fractional data type in 1.31 format.
typedef int16_t q15_t
 16-bit fractional data type in 1.15 format.
typedef int8_t q7_t
 8-bit fractional data type in 1.7 format.
typedef int16_t q1_14_t
 16-bit fractional data type in 2.14 format.
typedef int16_t q2_13_t
 16-bit fractional data type in 3.13 format.
typedef int16_t q3_12_t
 16-bit fractional data type in 4.12 format.
typedef int16_t q4_11_t
 16-bit fractional data type in 5.11 format.
typedef int16_t q5_10_t
 16-bit fractional data type in 6.10 format.
typedef int16_t q6_9_t
 16-bit fractional data type in 7.9 format.
typedef int32_t q1_30_t
 32-bit fractional data type in 2.30 format.
typedef int32_t q2_29_t
 32-bit fractional data type in 3.29 format.
typedef int32_t q3_28_t
 32-bit fractional data type in 4.28 format.
typedef int32_t q4_27_t
 32-bit fractional data type in 5.27 format.
typedef int32_t q5_26_t
 32-bit fractional data type in 6.26 format.
typedef int32_t q6_25_t
 32-bit fractional data type in 7.25 format.
typedef int32_t q7_24_t
 32-bit fractional data type in 8.24 format.
typedef int32_t q17_14_t
 32-bit fractional data type in 18.14 format.
typedef int64_t q1_62_t
 64-bit fractional data type in 2.62 format.
typedef int64_t q15_48_t
 64-bit fractional data type in 16.48 format.
typedef int64_t q33_30_t
 64-bit fractional data type in 34.30 format.
typedef enum tpt_status_e tpt_status
 Error status returned by some functions in the library.
typedef struct tpt_linear_interpolate_f32_s tpt_linear_interpolate_f32_t
 Instance structure for the floating-point Linear Interpolate function.
typedef struct tpt_bilinear_interpolate_f32_s tpt_bilinear_interpolate_f32_t
 Instance structure for the floating-point bilinear interpolation function.
typedef struct tpt_bilinear_interpolate_q7_s tpt_bilinear_interpolate_q7_t
 Instance structure for the Q7 bilinear interpolation function.
typedef struct tpt_bilinear_interpolate_q15_s tpt_bilinear_interpolate_q15_t
 Instance structure for the Q15 bilinear interpolation function.
typedef struct tpt_bilinear_interpolate_q31_s tpt_bilinear_interpolate_q31_t
 Instance structure for the Q31 bilinear interpolation function.

Enumerations

enum  tpt_status_e {
  TPT_MATH_SUCCESS = 0 , TPT_MATH_ARGUMENT_ERROR = -1 , TPT_MATH_LENGTH_ERROR = -2 , TPT_MATH_SIZE_MISMATCH = -3 ,
  TPT_MATH_NANINF = -4 , TPT_MATH_SINGULAR = -5 , TPT_MATH_TEST_FAILURE = -6 , TPT_MATH_DECOMPOSITION_FAILURE = -7
}
 Error status returned by some functions in the library. More...

Functions

static q7_t clip_q63_to_q7 (q63_t x)
 Clips Q63 to Q7 values.
static q15_t clip_q63_to_q15 (q63_t x)
 Clips Q63 to Q15 values.
static q31_t clip_q63_to_q31 (q63_t x)
 Clips Q63 to Q31 values.
static q7_t clip_q31_to_q7 (q31_t x)
 Clips Q31 to Q7 values.
static q15_t clip_q31_to_q15 (q31_t x)
 Clips Q31 to Q15 values.
static q7_t clip_q15_to_q7 (q15_t x)
 Clips Q15 to Q7 values.
static uint8_t __DSP_CLZ (uint32_t aData)
static uint8_t __CLZ32 (uint32_t aData)
static q63_t mult32x64 (q63_t x, q31_t y)
 Multiplies 32 X 64 and returns 32 bit result in 2.30 format.
static q31_t mult32x32_keep32 (q31_t acc, q31_t x, q31_t y)
 Multiplies 32 X 32 and returns 32 bit result in 1.31 format.
static int32_t __TPT_SSAT (int32_t aValue, uint32_t aBits)
static uint32_t __QADD8 (uint32_t aValue1, uint32_t aValue2)
static uint32_t __QSUB8 (uint32_t aValue1, uint32_t aValue2)
static uint32_t __QADD16 (uint32_t aValue1, uint32_t aValue2)
static uint32_t __SHADD16 (uint32_t aValue1, uint32_t aValue2)
static uint32_t __QSUB16 (uint32_t aValue1, uint32_t aValue2)
static uint32_t __SHSUB16 (uint32_t aValue1, uint32_t aValue2)
static uint32_t __QASX (uint32_t aValue1, uint32_t aValue2)
static uint32_t __SHASX (uint32_t aValue1, uint32_t aValue2)
static uint32_t __QSAX (uint32_t aValue1, uint32_t aValue2)
static uint32_t __SHSAX (uint32_t aValue1, uint32_t aValue2)
static uint32_t __SMUSDX (uint32_t aValue1, uint32_t aValue2)
static uint32_t __SMUADX (uint32_t aValue1, uint32_t aValue2)
static int32_t __QADD (int32_t aValue1, int32_t aValue2)
static int32_t __QSUB (int32_t aValue1, int32_t aValue2)
static uint32_t __SMLAD (uint32_t aValue1, uint32_t aValue2, uint32_t aSum)
static uint32_t __SMLADX (uint32_t aValue1, uint32_t aValue2, uint32_t aSum)
static uint32_t __SMLSDX (uint32_t aValue1, uint32_t aValue2, uint32_t aSum)
static uint64_t __SMLALD (uint32_t aValue1, uint32_t aValue2, uint32_t aSum)
static uint64_t __SMLALDX (uint32_t aValue1, uint32_t aValue2, uint64_t aSum)
static uint32_t __SMUAD (uint32_t aValue1, uint32_t aValue2)
static uint32_t __SMUSD (uint32_t aValue1, uint32_t aValue2)
static uint32_t __SXTB16 (uint32_t aValue)
static int32_t __SMMLA (uint32_t aValue1, uint32_t aValue2, int32_t aSum)
static f32_t tpt_linear_interpolate_f32 (tpt_linear_interpolate_f32_t *aFunction, f32_t aX)
 Process function for the floating-point Linear Interpolation Function.
static q31_t tpt_linear_interpolate_q31 (q31_t *pYData, q31_t aX, uint32_t nValues)
 Process function for the Q31 Linear Interpolation Function.
static q15_t tpt_linear_interpolate_q15 (q15_t *pYData, q31_t aX, uint32_t nValues)
 Process function for the Q15 Linear Interpolation Function.
static q7_t tpt_linear_interpolate_q7 (q7_t *pYData, q31_t aX, uint32_t nValues)
 Process function for the Q7 Linear Interpolation Function.
static f32_t tpt_bilinear_interpolate_f32 (const tpt_bilinear_interpolate_f32_t *aFunction, f32_t aX, f32_t aY)
 Floating-point bilinear interpolation.
static q31_t tpt_bilinear_interpolate_q31 (tpt_bilinear_interpolate_q31_t *aFunction, q31_t aX, q31_t aY)
 Q31 bilinear interpolation.
static q15_t tpt_bilinear_interpolate_q15 (tpt_bilinear_interpolate_q15_t *aFunction, q31_t aX, q31_t aY)
 Q15 bilinear interpolation.
static q7_t tpt_bilinear_interpolate_q7 (tpt_bilinear_interpolate_q7_t *aFunction, q31_t aX, q31_t aY)
 Q7 bilinear interpolation.

Macro Definition Documentation

◆ __CLZ

#define __CLZ   __DSP_CLZ

◆ __FORCEINLINE

#define __FORCEINLINE   __attribute__((always_inline)) inline

◆ __PACKq7

#define __PACKq7 ( w,
x,
y,
z )
Value:
(((int32_t)(z) & 0xFF) | (((int32_t)(y) << 8) & 0xFF00) | \
(((int32_t)(x) << 16) & 0xFF0000) | (((int32_t)(w) << 24) & 0xFF000000))

◆ __PKHBT

#define __PKHBT ( x,
y,
z )
Value:
(((int32_t)(x) & 0xFFFF) | (((int32_t)(y) << (z)) & 0xFFFF0000))

◆ __PKHTB

#define __PKHTB ( x,
y,
z )
Value:
(((int32_t)(x) & 0xFFFF0000) | (((int32_t)(y) >> (z)) & 0xFFFF))

◆ __SSAT

#define __SSAT   __TPT_SSAT

◆ __STATIC_FORCEINLINE

#define __STATIC_FORCEINLINE   static inline __attribute__((always_inline))

◆ ABS

#define ABS ( val,
bit )
Value:
(((val) > 0) ? (val) : (((val) == Q##bit##_MIN) ? Q##bit##_MAX : -(val)))

◆ CLIP

#define CLIP ( val,
bit )
Value:
((val) > UINT##bit##_MAX) ? UINT##bit##_MAX : ((val) < 0 ? 0U : (val))

◆ CLIPS

#define CLIPS ( val,
bit )
Value:
((val) < Q##bit##_MIN) ? Q##bit##_MIN \
: ((val) > Q##bit##_MAX) ? Q##bit##_MAX \
: (val)

◆ F32_ABSMAX

#define F32_ABSMAX   ((f32_t)FLT_MAX)

◆ F32_ABSMIN

#define F32_ABSMIN   ((f32_t)0.0)

◆ F32_MAX

#define F32_MAX   ((f32_t)FLT_MAX)

◆ F32_MIN

#define F32_MIN   (-FLT_MAX)

◆ F32_TO_Q15

#define F32_TO_Q15 ( val)
Value:
(q15_t)((fminf(fmaxf(val, -1.0f), 1.0f)) * (1LL << 15))
int16_t q15_t
16-bit fractional data type in 1.15 format.
Definition tpt_math_dsp.h:145

Convert F32 to Q15 format This will use saturating arithmetic.

◆ F32_TO_Q31

#define F32_TO_Q31 ( val)
Value:
(q31_t)((fminf(fmaxf(val, -1.0f), 1.0f)) * (1LL << 31))
int32_t q31_t
32-bit fractional data type in 1.31 format.
Definition tpt_math_dsp.h:141

Convert F32 to Q31 format This will use saturating arithmetic.

◆ F32_TO_Q7

#define F32_TO_Q7 ( val)
Value:
(q7_t)((fminf(fmaxf(val, -1.0f), 1.0f)) * (1LL << 7))
int8_t q7_t
8-bit fractional data type in 1.7 format.
Definition tpt_math_dsp.h:149

Convert F32 to Q7 format This will use saturating arithmetic.

◆ F64_ABSMAX

#define F64_ABSMAX   ((f64_t)DBL_MAX)

◆ F64_ABSMIN

#define F64_ABSMIN   ((f64_t)0.0)

◆ F64_MAX

#define F64_MAX   ((f64_t)DBL_MAX)

◆ F64_MIN

#define F64_MIN   (-DBL_MAX)

◆ F64_TO_Q15

#define F64_TO_Q15 ( val)
Value:
(q15_t)((fmin(fmax(val, -1.0), 1.0)) * (1LL << 15))

Convert F64 to Q15 format This will use saturating arithmetic.

◆ F64_TO_Q31

#define F64_TO_Q31 ( val)
Value:
(q31_t)((fmin(fmax(val, -1.0), 1.0)) * (1LL << 31))

Convert F64 to Q31 format This will use saturating arithmetic.

◆ F64_TO_Q7

#define F64_TO_Q7 ( val)
Value:
(q7_t)((fmin(fmax(val, -1.0), 1.0)) * (1LL << 7))

Convert F64 to Q7 format This will use saturating arithmetic.

◆ LIKELY

#define LIKELY ( EXPR)
Value:
(EXPR)

◆ mult_32x32_keep32

#define mult_32x32_keep32 ( a,
x,
y )
Value:
a = (q31_t)(((q63_t)x * y) >> 32)
int64_t q63_t
64-bit fractional data type in 1.63 format.
Definition tpt_math_dsp.h:137

◆ mult_32x32_keep32_R

#define mult_32x32_keep32_R ( a,
x,
y )
Value:
a = (q31_t)(((q63_t)x * y + 0x80000000LL) >> 32)

◆ multAcc_32x32_keep32

#define multAcc_32x32_keep32 ( a,
x,
y )
Value:
a += (q31_t)(((q63_t)x * y) >> 32)

◆ multAcc_32x32_keep32_R

#define multAcc_32x32_keep32_R ( a,
x,
y )
Value:
a = (q31_t)(((((q63_t)a) << 32) + ((q63_t)x * y) + 0x80000000LL) >> 32)

◆ multSub_32x32_keep32

#define multSub_32x32_keep32 ( a,
x,
y )
Value:
a -= (q31_t)(((q63_t)x * y) >> 32)

◆ multSub_32x32_keep32_R

#define multSub_32x32_keep32_R ( a,
x,
y )
Value:
a = (q31_t)(((((q63_t)a) << 32) - ((q63_t)x * y) + 0x80000000LL) >> 32)

◆ OPT_BRANCH_PREDICTION

#define OPT_BRANCH_PREDICTION   1

◆ OPT_HIGHLY_ACCURATE

#define OPT_HIGHLY_ACCURATE   0

◆ Q15_ABSMAX

#define Q15_ABSMAX   ((q15_t)(0x7FFF))

◆ Q15_ABSMIN

#define Q15_ABSMIN   ((q15_t)0)

◆ Q15_MAX

#define Q15_MAX   ((q15_t)(0x7FFF))

◆ Q15_MIN

#define Q15_MIN   ((q15_t)(0x8000))

◆ Q15_TO_F32

#define Q15_TO_F32 ( val)
Value:
((val) * 3.05175781e-05F)

Convert Q15 to F32 format.

◆ Q15_TO_F64

#define Q15_TO_F64 ( val)
Value:
((val) * 3.051757812500000000e-05)

Convert Q15 to F64 format.

◆ Q31_ABSMAX

#define Q31_ABSMAX   ((q31_t)(0x7FFFFFFFL))

◆ Q31_ABSMIN

#define Q31_ABSMIN   ((q31_t)0)

◆ Q31_MAX

#define Q31_MAX   ((q31_t)(0x7FFFFFFFL))

◆ Q31_MIN

#define Q31_MIN   ((q31_t)(0x80000000L))

◆ Q31_TO_F32

#define Q31_TO_F32 ( val)
Value:
((val) * 4.65661287e-10F)

Convert Q31 to F32 format.

◆ Q31_TO_F64

#define Q31_TO_F64 ( val)
Value:
((val) * 4.656612873077392578e-10)

Convert Q31 to F64 format.

◆ Q63_MAX

#define Q63_MAX   ((q63_t)(0x7FFFFFFFFFFFFFFFLL))

◆ Q63_MIN

#define Q63_MIN   ((q63_t)(0x8000000000000000LL))

◆ Q7_ABSMAX

#define Q7_ABSMAX   ((q7_t)(0x7F))

◆ Q7_ABSMIN

#define Q7_ABSMIN   ((q7_t)0)

◆ Q7_MAX

#define Q7_MAX   ((q7_t)(0x7F))

◆ Q7_MIN

#define Q7_MIN   ((q7_t)(0x80))

◆ Q7_TO_F32

#define Q7_TO_F32 ( val)
Value:
((val) * 7.81250000e-03F)

Convert Q7 to F32 format.

◆ Q7_TO_F64

#define Q7_TO_F64 ( val)
Value:
((val) * 7.812500000000000000e-03)

Convert Q7 to F64 format.

◆ SCALE_COL_F32

#define SCALE_COL_F32 ( A,
ROW,
v,
i,
aRows,
aCols )
Value:
SCALE_COL_T(f32_t, A, ROW, v, i, aRows, aCols)
#define SCALE_COL_T(T, A, ROW, v, i, aRows, aCols)
Definition tpt_math_dsp.h:459
float f32_t
32-bit floating-point type definition.
Definition tpt_math_dsp.h:132
#define A
Definition tpt_pow_f32.c:86

◆ SCALE_COL_F64

#define SCALE_COL_F64 ( A,
ROW,
v,
i,
aRows,
aCols )
Value:
SCALE_COL_T(f64_t, A, ROW, v, i, aRows, aCols)
#define f64_t
Definition tpt_fir_decimate_f64.c:34

◆ SCALE_COL_T

#define SCALE_COL_T ( T,
A,
ROW,
v,
i,
aRows,
aCols )
Value:
{ \
int32_t _w; \
T* data = A; \
const int32_t _numCols = aCols; \
const int32_t nb = aRows - ROW; \
\
data += i + _numCols * (ROW); \
\
for (_w = 0; _w < nb; _w++) \
{ \
*data *= v; \
data += _numCols; \
} \
}
#define T
Definition tpt_pow_f32.c:85

◆ SQUARE

#define SQUARE ( val)
Value:
((val) * (val))

◆ SWAP

#define SWAP ( x,
y,
T )
Value:
do \
{ \
T tmp = x; \
\
x = y; \
y = tmp; \
} while (0)

◆ SWAP_PAIR

#define SWAP_PAIR ( x,
y,
T )
Value:
do \
{ \
T* tmp_x = (T*)x; \
T* tmp_y = (T*)y; \
T tmp = *tmp_x; \
\
*tmp_x = *tmp_y; \
*tmp_y = tmp; \
} while (0)

◆ TPT_MATH_LOOPUNROLL

#define TPT_MATH_LOOPUNROLL   8

◆ UNLIKELY

#define UNLIKELY ( EXPR)
Value:
(EXPR)

Typedef Documentation

◆ f128_t

typedef long double f128_t

128-bit floating-point type definition.

◆ f32_t

typedef float f32_t

32-bit floating-point type definition.

◆ f64_t

typedef double f64_t

64-bit floating-point type definition.

◆ q15_48_t

typedef int64_t q15_48_t

64-bit fractional data type in 16.48 format.

◆ q15_t

typedef int16_t q15_t

16-bit fractional data type in 1.15 format.

◆ q17_14_t

typedef int32_t q17_14_t

32-bit fractional data type in 18.14 format.

◆ q1_14_t

typedef int16_t q1_14_t

16-bit fractional data type in 2.14 format.

◆ q1_30_t

typedef int32_t q1_30_t

32-bit fractional data type in 2.30 format.

◆ q1_62_t

typedef int64_t q1_62_t

64-bit fractional data type in 2.62 format.

◆ q2_13_t

typedef int16_t q2_13_t

16-bit fractional data type in 3.13 format.

◆ q2_29_t

typedef int32_t q2_29_t

32-bit fractional data type in 3.29 format.

◆ q31_t

typedef int32_t q31_t

32-bit fractional data type in 1.31 format.

◆ q33_30_t

typedef int64_t q33_30_t

64-bit fractional data type in 34.30 format.

◆ q3_12_t

typedef int16_t q3_12_t

16-bit fractional data type in 4.12 format.

◆ q3_28_t

typedef int32_t q3_28_t

32-bit fractional data type in 4.28 format.

◆ q4_11_t

typedef int16_t q4_11_t

16-bit fractional data type in 5.11 format.

◆ q4_27_t

typedef int32_t q4_27_t

32-bit fractional data type in 5.27 format.

◆ q5_10_t

typedef int16_t q5_10_t

16-bit fractional data type in 6.10 format.

◆ q5_26_t

typedef int32_t q5_26_t

32-bit fractional data type in 6.26 format.

◆ q63_t

typedef int64_t q63_t

64-bit fractional data type in 1.63 format.

◆ q6_25_t

typedef int32_t q6_25_t

32-bit fractional data type in 7.25 format.

◆ q6_9_t

typedef int16_t q6_9_t

16-bit fractional data type in 7.9 format.

◆ q7_24_t

typedef int32_t q7_24_t

32-bit fractional data type in 8.24 format.

◆ q7_t

typedef int8_t q7_t

8-bit fractional data type in 1.7 format.

◆ tpt_bilinear_interpolate_f32_t

Instance structure for the floating-point bilinear interpolation function.

◆ tpt_bilinear_interpolate_q15_t

Instance structure for the Q15 bilinear interpolation function.

◆ tpt_bilinear_interpolate_q31_t

Instance structure for the Q31 bilinear interpolation function.

◆ tpt_bilinear_interpolate_q7_t

Instance structure for the Q7 bilinear interpolation function.

◆ tpt_linear_interpolate_f32_t

Instance structure for the floating-point Linear Interpolate function.

◆ tpt_status

typedef enum tpt_status_e tpt_status

Error status returned by some functions in the library.

Enumeration Type Documentation

◆ tpt_status_e

Error status returned by some functions in the library.

Enumerator
TPT_MATH_SUCCESS 

No error.

TPT_MATH_ARGUMENT_ERROR 

One or more arguments are incorrect.

TPT_MATH_LENGTH_ERROR 

Length of data buffer is incorrect.

TPT_MATH_SIZE_MISMATCH 

Size of matrices is not compatible with the operation.

TPT_MATH_NANINF 

Not-a-number (NaN) or infinity is generated.

TPT_MATH_SINGULAR 

Input matrix is singular.

TPT_MATH_TEST_FAILURE 

Test Failed.

TPT_MATH_DECOMPOSITION_FAILURE 

Decomposition Failed.

Function Documentation

◆ __CLZ32()

uint8_t __CLZ32 ( uint32_t aData)
inlinestatic

◆ __DSP_CLZ()

uint8_t __DSP_CLZ ( uint32_t aData)
inlinestatic

◆ __QADD()

int32_t __QADD ( int32_t aValue1,
int32_t aValue2 )
inlinestatic

◆ __QADD16()

uint32_t __QADD16 ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __QADD8()

uint32_t __QADD8 ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __QASX()

uint32_t __QASX ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __QSAX()

uint32_t __QSAX ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __QSUB()

int32_t __QSUB ( int32_t aValue1,
int32_t aValue2 )
inlinestatic

◆ __QSUB16()

uint32_t __QSUB16 ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __QSUB8()

uint32_t __QSUB8 ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __SHADD16()

uint32_t __SHADD16 ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __SHASX()

uint32_t __SHASX ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __SHSAX()

uint32_t __SHSAX ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __SHSUB16()

uint32_t __SHSUB16 ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __SMLAD()

uint32_t __SMLAD ( uint32_t aValue1,
uint32_t aValue2,
uint32_t aSum )
inlinestatic

◆ __SMLADX()

uint32_t __SMLADX ( uint32_t aValue1,
uint32_t aValue2,
uint32_t aSum )
inlinestatic

◆ __SMLALD()

uint64_t __SMLALD ( uint32_t aValue1,
uint32_t aValue2,
uint32_t aSum )
inlinestatic

◆ __SMLALDX()

uint64_t __SMLALDX ( uint32_t aValue1,
uint32_t aValue2,
uint64_t aSum )
inlinestatic

◆ __SMLSDX()

uint32_t __SMLSDX ( uint32_t aValue1,
uint32_t aValue2,
uint32_t aSum )
inlinestatic

◆ __SMMLA()

int32_t __SMMLA ( uint32_t aValue1,
uint32_t aValue2,
int32_t aSum )
inlinestatic

◆ __SMUAD()

uint32_t __SMUAD ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __SMUADX()

uint32_t __SMUADX ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __SMUSD()

uint32_t __SMUSD ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __SMUSDX()

uint32_t __SMUSDX ( uint32_t aValue1,
uint32_t aValue2 )
inlinestatic

◆ __SXTB16()

uint32_t __SXTB16 ( uint32_t aValue)
inlinestatic

◆ __TPT_SSAT()

int32_t __TPT_SSAT ( int32_t aValue,
uint32_t aBits )
inlinestatic

◆ clip_q15_to_q7()

q7_t clip_q15_to_q7 ( q15_t x)
inlinestatic

Clips Q15 to Q7 values.

◆ clip_q31_to_q15()

q15_t clip_q31_to_q15 ( q31_t x)
inlinestatic

Clips Q31 to Q15 values.

◆ clip_q31_to_q7()

q7_t clip_q31_to_q7 ( q31_t x)
inlinestatic

Clips Q31 to Q7 values.

◆ clip_q63_to_q15()

q15_t clip_q63_to_q15 ( q63_t x)
inlinestatic

Clips Q63 to Q15 values.

◆ clip_q63_to_q31()

q31_t clip_q63_to_q31 ( q63_t x)
inlinestatic

Clips Q63 to Q31 values.

◆ clip_q63_to_q7()

q7_t clip_q63_to_q7 ( q63_t x)
inlinestatic

Clips Q63 to Q7 values.

◆ mult32x32_keep32()

q31_t mult32x32_keep32 ( q31_t acc,
q31_t x,
q31_t y )
inlinestatic

Multiplies 32 X 32 and returns 32 bit result in 1.31 format.

◆ mult32x64()

q63_t mult32x64 ( q63_t x,
q31_t y )
inlinestatic

Multiplies 32 X 64 and returns 32 bit result in 2.30 format.