LIBML  Version 3.2.4
LIBML DSP Software Library
Functions
tpt_math_vector.h File Reference
This graph shows which files directly or indirectly include this file:

Functions

void tpt_abs_f32 (f32_t *__restrict aOutData, const f32_t *__restrict aInData, uint32_t aCount)
 Floating-point vector absolute value. More...
 
void tpt_abs_f64 (f64_t *__restrict aOutData, const f64_t *__restrict aInData, uint32_t aCount)
 Floating-point vector absolute value. More...
 
void tpt_abs_q7 (q7_t *__restrict aOutData, const q7_t *__restrict aInData, uint32_t aCount)
 Q7 vector absolute value. More...
 
void tpt_abs_q15 (q15_t *__restrict aOutData, const q15_t *__restrict aInData, uint32_t aCount)
 Q15 vector absolute value. More...
 
void tpt_abs_q31 (q31_t *__restrict aOutData, const q31_t *__restrict aInData, uint32_t aCount)
 Q31 vector absolute value. More...
 
void tpt_add_f32 (f32_t *__restrict aOutData, const f32_t *__restrict aInDataA, const f32_t *__restrict aInDataB, uint32_t aCount)
 Floating-point vector addition. More...
 
void tpt_add_f64 (f64_t *__restrict aOutData, const f64_t *__restrict aInDataA, const f64_t *__restrict aInDataB, uint32_t aCount)
 Floating-point vector addition. More...
 
void tpt_add_q7 (q7_t *__restrict aOutData, const q7_t *__restrict aInDataA, const q7_t *__restrict aInDataB, uint32_t aCount)
 Q7 vector addition. More...
 
void tpt_add_q15 (q15_t *__restrict aOutData, const q15_t *__restrict aInDataA, const q15_t *__restrict aInDataB, uint32_t aCount)
 Q15 vector addition. More...
 
void tpt_add_q31 (q31_t *__restrict aOutData, const q31_t *__restrict aInDataA, const q31_t *__restrict aInDataB, uint32_t aCount)
 Q31 vector addition. More...
 
void tpt_sub_f32 (f32_t *__restrict aOutData, const f32_t *__restrict aInDataA, const f32_t *__restrict aInDataB, uint32_t aCount)
 Floating-point vector subtraction. More...
 
void tpt_sub_f64 (f64_t *__restrict aOutData, const f64_t *__restrict aInDataA, const f64_t *__restrict aInDataB, uint32_t aCount)
 Floating-point vector subtraction. More...
 
void tpt_sub_q7 (q7_t *__restrict aOutData, const q7_t *__restrict aInDataA, const q7_t *__restrict aInDataB, uint32_t aCount)
 Q7 vector subtraction. More...
 
void tpt_sub_q15 (q15_t *__restrict aOutData, const q15_t *__restrict aInDataA, const q15_t *__restrict aInDataB, uint32_t aCount)
 Q15 vector subtraction. More...
 
void tpt_sub_q31 (q31_t *__restrict aOutData, const q31_t *__restrict aInDataA, const q31_t *__restrict aInDataB, uint32_t aCount)
 Q31 vector subtraction. More...
 
void tpt_sub_u8_q7 (q7_t *__restrict aOutData, const uint8_t *__restrict aInDataA, const uint8_t *__restrict aInDataB, uint32_t aCount)
 U8 vector subtraction. More...
 
void tpt_div_f32 (f32_t *aOutData, const f32_t *aInDataA, const f32_t *aInDataB, uint32_t aCount)
 Division of floating-point vectors. More...
 
void tpt_div_f64 (f64_t *aOutData, const f64_t *aInDataA, const f64_t *aInDataB, uint32_t aCount)
 Division of floating-point vectors. More...
 
q31_t tpt_div_q31 (const q31_t aInDataA, const q31_t aInDataB)
 Division of q31 inputs. More...
 
int tpt_divide_q31 (q31_t *aQuotient, int16_t *aShift, q31_t aNumerator, q31_t aDenominator)
 Fixed point division for q31. More...
 
int tpt_divide_q15 (q15_t *aQuotient, int16_t *aShift, q15_t aNumerator, q15_t aDenominator)
 Fixed point division for q15. More...
 
void tpt_clip_f32 (f32_t *aOutData, const f32_t *aInData, const f32_t aLow, const f32_t aHigh, uint32_t aCount)
 Elementwise clipping of f32 function. More...
 
void tpt_clip_f64 (f64_t *aOutData, const f64_t *aInData, const f64_t aLow, const f64_t aHigh, uint32_t aCount)
 Elementwise clipping of f32 function. More...
 
void tpt_clip_q31 (q31_t *aOutData, const q31_t *aInData, q31_t aLow, q31_t aHigh, uint32_t aCount)
 Elementwise clipping of q31 function. More...
 
void tpt_clip_q15 (q15_t *aOutData, const q15_t *aInData, q15_t aLow, q15_t aHigh, uint32_t aCount)
 Elementwise clipping of q15 function. More...
 
void tpt_clip_q7 (q7_t *aOutData, const q7_t *aInDataA, q7_t aLow, q7_t aHigh, uint32_t aCount)
 Elementwise clipping of q7 function. More...
 
void tpt_negate_f32 (f32_t *__restrict aOutData, const f32_t *__restrict aInData, uint32_t aCount)
 Negates the elements of a floating-point vector. More...
 
void tpt_negate_f64 (f64_t *__restrict aOutData, const f64_t *__restrict aInData, uint32_t aCount)
 Negates the elements of a floating-point vector. More...
 
void tpt_negate_q7 (q7_t *__restrict aOutData, const q7_t *__restrict aInData, uint32_t aCount)
 Negates the elements of a Q7 vector. More...
 
void tpt_negate_q15 (q15_t *__restrict aOutData, const q15_t *__restrict aInData, uint32_t aCount)
 Negates the elements of a Q15 vector. More...
 
void tpt_negate_q31 (q31_t *__restrict aOutData, const q31_t *__restrict aInData, uint32_t aCount)
 Negates the elements of a Q31 vector. More...
 
void tpt_offset_f32 (f32_t *__restrict aOutData, const f32_t *__restrict aInData, f32_t aOffset, uint32_t aCount)
 Adds a constant offset to a floating-point vector. More...
 
void tpt_offset_f64 (f64_t *__restrict aOutData, const f64_t *__restrict aInData, f64_t aOffset, uint32_t aCount)
 Adds a constant offset to a floating-point vector. More...
 
void tpt_offset_q7 (q7_t *__restrict aOutData, const q7_t *__restrict aInData, q7_t aOffset, uint32_t aCount)
 Adds a constant offset to a Q7 vector. More...
 
void tpt_offset_q15 (q15_t *__restrict aOutData, const q15_t *__restrict aInData, q15_t aOffset, uint32_t aCount)
 Adds a constant offset to a Q15 vector. More...
 
void tpt_offset_q31 (q31_t *__restrict aOutData, const q31_t *__restrict aInData, q31_t aOffset, uint32_t aCount)
 Adds a constant offset to a Q31 vector. More...
 
void tpt_offset_u8 (uint8_t *__restrict aOutData, const uint8_t *__restrict aInData, q7_t aOffset, uint32_t aCount)
 Adds a constant offset to a U8 vector. More...
 
void tpt_mult_f32 (f32_t *__restrict aOutData, const f32_t *__restrict aInDataA, const f32_t *__restrict aInDataB, uint32_t aCount)
 Floating-point vector multiplication. More...
 
void tpt_mult_f64 (f64_t *__restrict aOutData, const f64_t *__restrict aInDataA, const f64_t *__restrict aInDataB, uint32_t aCount)
 Floating-point vector multiplication. More...
 
void tpt_mult_q7 (q7_t *__restrict aOutData, const q7_t *__restrict aInDataA, const q7_t *__restrict aInDataB, uint32_t aCount)
 Q7 vector multiplication. More...
 
void tpt_mult_q15 (q15_t *__restrict aOutData, const q15_t *__restrict aInDataA, const q15_t *__restrict aInDataB, uint32_t aCount)
 Q15 vector multiplication. More...
 
void tpt_mult_q31 (q31_t *__restrict aOutData, const q31_t *__restrict aInDataA, const q31_t *__restrict aInDataB, uint32_t aCount)
 Q31 vector multiplication. More...
 
void tpt_mult_u8_u16 (uint16_t *__restrict aOuData, uint8_t *__restrict aInDataA, uint8_t *__restrict aInDataB, uint32_t aCount)
 U8 vector multiplication. More...
 
void tpt_scale_f32 (f32_t *__restrict aOutData, const f32_t *__restrict aInData, f32_t aScale, uint32_t aCount)
 Multiplies a floating-point vector by a scalar. More...
 
void tpt_scale_f64 (f64_t *__restrict aOutData, const f64_t *__restrict aInData, f64_t aScale, uint32_t aCount)
 Multiplies a floating-point vector by a scalar. More...
 
void tpt_scale_q7 (q7_t *__restrict aOutData, const q7_t *__restrict aInData, q7_t aScaleFract, int8_t aShift, uint32_t aCount)
 Multiplies a Q7 vector by a scalar. More...
 
void tpt_scale_q15 (q15_t *__restrict aOutData, const q15_t *__restrict aInData, q15_t aScaleFract, int8_t aShift, uint32_t aCount)
 Multiplies a Q15 vector by a scalar. More...
 
void tpt_scale_q31 (q31_t *__restrict aOutData, const q31_t *__restrict aInData, q31_t aScaleFract, int8_t aShift, uint32_t aCount)
 Multiplies a Q31 vector by a scalar. More...
 
void tpt_scale_u8 (uint8_t *__restrict aOutData, const uint8_t *__restrict aInData, q7_t aScaleFract, int8_t aShift, uint32_t aCount)
 To multiply a u8 vectors by a q7 scale. More...
 
void tpt_dot_prod_f32 (f32_t *aResult, const f32_t *aInDataA, const f32_t *aInDataB, uint32_t aCount)
 Dot product of floating-point vectors. More...
 
void tpt_dot_prod_f64 (f64_t *aResult, const f64_t *aInDataA, const f64_t *aInDataB, uint32_t aCount)
 Dot product of floating-point vectors. More...
 
void tpt_dot_prod_q7 (q17_14_t *aResult, const q7_t *aInDataA, const q7_t *aInDataB, uint32_t aCount)
 Dot product of Q7 vectors. More...
 
void tpt_dot_prod_q15 (q33_30_t *aResult, const q15_t *aInDataA, const q15_t *aInDataB, uint32_t aCount)
 Dot product of Q15 vectors. More...
 
void tpt_dot_prod_q31 (q15_48_t *aResult, const q31_t *aInDataA, const q31_t *aInDataB, uint32_t aCount)
 Dot product of Q31 vectors. More...
 
q31_t tpt_dot_prod_q7xq15 (q7_t *aInDataA, q15_t *aInDataB, uint32_t aCount)
 Dot product of Q7 * Q15 vectors. More...
 
uint32_t tpt_dot_prod_u8 (uint8_t *aInDataA, uint8_t *aInDataB, uint32_t aCount)
 Dot production of U8 vectors. More...
 
q31_t tpt_dot_prod_u8xq15 (uint8_t *aInDataA, q15_t *aInDataB, uint32_t aCount)
 Dot production of U8xQ15 vectors. More...
 
void tpt_shift_q7 (q7_t *aOutData, const q7_t *aInData, int8_t aShiftBits, uint32_t aCount)
 Shifts the elements of a Q7 vector a specified number of bits. More...
 
void tpt_shift_q15 (q15_t *aOutData, const q15_t *aInData, int8_t aShiftBits, uint32_t aCount)
 Shifts the elements of a Q15 vector a specified number of bits. More...
 
void tpt_shift_q31 (q31_t *aOutData, const q31_t *aInData, int8_t aShiftBits, uint32_t aCount)
 Shifts the elements of a Q15 vector a specified number of bits. More...
 
void tpt_shift_u8 (uint8_t *__restrict aOutData, const uint8_t *__restrict aInData, int8_t aShiftBits, uint32_t aCount)
 Shifts the elements of a U8 vector a specified number of bits. More...
 
void tpt_and_8bit (uint8_t *aOutData, const uint8_t *aInDataA, const uint8_t *aInDataB, uint32_t aCount)
 8-bit vector logic and operation. More...
 
void tpt_and_16bit (uint16_t *aOutData, const uint16_t *aInDataA, const uint16_t *aInDataB, uint32_t aCount)
 16-bit vector logic and operation. More...
 
void tpt_and_32bit (uint32_t *aOutData, const uint32_t *aInDataA, const uint32_t *aInDataB, uint32_t aCount)
 32-bit vector logic and operation. More...
 
void tpt_and_64bit (uint64_t *aOutData, const uint64_t *aInDataA, const uint64_t *aInDataB, uint32_t aCount)
 64-bit vector logic and operation. More...
 
void tpt_or_8bit (uint8_t *aOutData, const uint8_t *aInDataA, const uint8_t *aInDataB, uint32_t aCount)
 8-bit vector logic or operation. More...
 
void tpt_or_16bit (uint16_t *aOutData, const uint16_t *aInDataA, const uint16_t *aInDataB, uint32_t aCount)
 16-bit vector logic or operation. More...
 
void tpt_or_32bit (uint32_t *aOutData, const uint32_t *aInDataA, const uint32_t *aInDataB, uint32_t aCount)
 32-bit vector logic or operation. More...
 
void tpt_or_64bit (uint64_t *aOutData, const uint64_t *aInDataA, const uint64_t *aInDataB, uint32_t aCount)
 64-bit vector logic or operation. More...
 
void tpt_not_8bit (uint8_t *aOutData, const uint8_t *aInData, uint32_t aCount)
 8-bit vector logic not operation. More...
 
void tpt_not_16bit (uint16_t *aOutData, const uint16_t *aInDataB, uint32_t aCount)
 16-bit vector logic not operation. More...
 
void tpt_not_32bit (uint32_t *aOutData, const uint32_t *aInData, uint32_t aCount)
 32-bit vector logic not operation. More...
 
void tpt_not_64bit (uint64_t *aOutData, const uint64_t *aInData, uint32_t aCount)
 64-bit vector logic not operation. More...
 
void tpt_xor_8bit (uint8_t *aOutData, const uint8_t *aInDataA, const uint8_t *aInDataB, uint32_t aCount)
 8-bit vector logic xor operation. More...
 
void tpt_xor_16bit (uint16_t *aOutData, const uint16_t *aInDataA, const uint16_t *aInDataB, uint32_t aCount)
 16-bit vector logic xor operation. More...
 
void tpt_xor_32bit (uint32_t *aOutData, const uint32_t *aInDataA, const uint32_t *aInDataB, uint32_t aCount)
 32-bit vector logic xor operation. More...
 
void tpt_xor_64bit (uint64_t *aOutData, const uint64_t *aInDataA, const uint64_t *aInDataB, uint32_t aCount)
 64-bit vector logic xor operation. More...
 
int32_t tpt_div_s64_u32 (int64_t aInDataA, uint32_t aInDataB)
 Division of int64_t inputs divided by a positive 32 bits. More...
 
uint32_t tpt_div_u64_u32 (int64_t aInDataA, uint32_t aInDataB)
 Division of positive 64-bits inputs divided by a positive 32-bits. More...
 
void tpt_add_u8_u16 (uint16_t *__restrict aOutData, uint8_t *__restrict aInDataA, uint8_t *__restrict aInDataB, uint32_t aCount)
 Addition of U8 vectors. More...
 

Function Documentation

◆ tpt_add_u8_u16()

void tpt_add_u8_u16 ( uint16_t *__restrict  aOutData,
uint8_t *__restrict  aInDataA,
uint8_t *__restrict  aInDataB,
uint32_t  aCount 
)

Addition of U8 vectors.

Parameters
aOutDatapoints to the first input vector.
aInDataApoints to the second input vector.
aInDataBpoints to the output vector.
aCountsize of the vectors.
Returns
none

◆ tpt_div_s64_u32()

int32_t tpt_div_s64_u32 ( int64_t  aInDataA,
uint32_t  aInDataB 
)

Division of int64_t inputs divided by a positive 32 bits.

Parameters
aInDataAthe int64_t input1 value.
aInDataBthe positive 32 bits input value.
Returns
int32_t division of two inputs.

◆ tpt_div_u64_u32()

uint32_t tpt_div_u64_u32 ( int64_t  aInDataA,
uint32_t  aInDataB 
)

Division of positive 64-bits inputs divided by a positive 32-bits.

Parameters
aInDataAhe positive 64-bits input value.
aInDataBthe positive 32-bits input value.
Returns
uint32_t division of two inputs.

◆ tpt_dot_prod_q7xq15()

q31_t tpt_dot_prod_q7xq15 ( q7_t aInDataA,
q15_t aInDataB,
uint32_t  aCount 
)

Dot product of Q7 * Q15 vectors.

Parameters
[in]aInDataApoints to first input vector.
[in]aInDataBpoints to second input vector.
[in]aCountnumber of samples in each vector
Returns
dot product of two input vectors.

Dot product of Q7 * Q15 vectors.

Parameters
aInDataAPoints to the q7_t format input vector.
aInDataBPoints to the q15 format input vector.
aCountSize of the vectors.
Returns
q31_t dot product of two input vectors.

y = x1[0] * x2[0] + x1[1] * x2[1] + x1[2] * x2[2] + ..... + x1[size-1] * x2[size-1]

◆ tpt_dot_prod_u8()

uint32_t tpt_dot_prod_u8 ( uint8_t *  aInDataA,
uint8_t *  aInDataB,
uint32_t  aCount 
)

Dot production of U8 vectors.

Parameters
aInDataAPoints to the U8 format input vector.
aInDataBPoints to the U8 format input vector.
aCountSize of the vectors.
Returns
uint32_t dot product of two input vectors.
Parameters
aInDataAPoints to the U8 format input vector.
aInDataBPoints to the U8 format input vector.
aCountSize of the vectors.
Returns
uint32_t dot product of two input vectors.

The output of multiplications is in 0.16 format and then added to an accumulator in 16.16 format. The return result is in 16.16 format.When the size of the vectors less than (2^15)-1, there is no risk to overflow.

◆ tpt_dot_prod_u8xq15()

q31_t tpt_dot_prod_u8xq15 ( uint8_t *  aInDataA,
q15_t aInDataB,
uint32_t  aCount 
)

Dot production of U8xQ15 vectors.

Parameters
aInDataAPoints to the U8 format input vector.
aInDataBPoints to the Q15 format input vector.
aCountSize of the vectors.
Returns
q31_t dot product of two input vectors.
Parameters
aInDataAPoints to the U8 format input vector.
aInDataBPoints to the Q15 format input vector.
aCountSize of the vectors.
Returns
q31_t dot product of two input vectors.

The output of multiplications is in 1.23 format and then added to an accumulator in 9.23 format. The return result is in 9.23 format.When the size of the vectors less than (2^8)-1, there is no risk to overflow.