Asterisk - The Open Source Telephony Project
18.5.0
|
Generic fixed-point operations. More...
Go to the source code of this file.
Macros | |
#define | ADD16(a, b) ((spx_word16_t)((spx_word16_t)(a)+(spx_word16_t)(b))) |
#define | ADD32(a, b) ((spx_word32_t)(a)+(spx_word32_t)(b)) |
#define | DIV32(a, b) (((spx_word32_t)(a))/((spx_word32_t)(b))) |
#define | DIV32_16(a, b) ((spx_word16_t)(((spx_word32_t)(a))/((spx_word16_t)(b)))) |
#define | EXTEND32(x) ((spx_word32_t)(x)) |
#define | EXTRACT16(x) ((spx_word16_t)(x)) |
#define | MAC16_16(c, a, b) (ADD32((c),MULT16_16((a),(b)))) |
#define | MAC16_16_P13(c, a, b) (ADD32((c),SHR(ADD32(4096,MULT16_16((a),(b))),13))) |
#define | MAC16_16_Q11(c, a, b) (ADD32((c),SHR(MULT16_16((a),(b)),11))) |
#define | MAC16_16_Q13(c, a, b) (ADD32((c),SHR(MULT16_16((a),(b)),13))) |
#define | MAC16_32_Q11(c, a, b) ADD32(c,ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11))) |
#define | MAC16_32_Q15(c, a, b) ADD32(c,ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15))) |
#define | MUL_16_32_R15(a, bh, bl) ADD32(MULT16_16((a),(bh)), SHR(MULT16_16((a),(bl)),15)) |
#define | MULT16_16(a, b) (((spx_word32_t)(spx_word16_t)(a))*((spx_word32_t)(spx_word16_t)(b))) |
#define | MULT16_16_16(a, b) ((((spx_word16_t)(a))*((spx_word16_t)(b)))) |
#define | MULT16_16_P13(a, b) (SHR(ADD32(4096,MULT16_16((a),(b))),13)) |
#define | MULT16_16_P14(a, b) (SHR(ADD32(8192,MULT16_16((a),(b))),14)) |
#define | MULT16_16_P15(a, b) (SHR(ADD32(16384,MULT16_16((a),(b))),15)) |
#define | MULT16_16_Q11_32(a, b) (SHR(MULT16_16((a),(b)),11)) |
#define | MULT16_16_Q13(a, b) (SHR(MULT16_16((a),(b)),13)) |
#define | MULT16_16_Q14(a, b) (SHR(MULT16_16((a),(b)),14)) |
#define | MULT16_16_Q15(a, b) (SHR(MULT16_16((a),(b)),15)) |
#define | MULT16_32_P15(a, b) ADD32(MULT16_16((a),SHR((b),15)), PSHR(MULT16_16((a),((b)&0x00007fff)),15)) |
#define | MULT16_32_Q11(a, b) ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11)) |
#define | MULT16_32_Q12(a, b) ADD32(MULT16_16((a),SHR((b),12)), SHR(MULT16_16((a),((b)&0x00000fff)),12)) |
#define | MULT16_32_Q13(a, b) ADD32(MULT16_16((a),SHR((b),13)), SHR(MULT16_16((a),((b)&0x00001fff)),13)) |
#define | MULT16_32_Q14(a, b) ADD32(MULT16_16((a),SHR((b),14)), SHR(MULT16_16((a),((b)&0x00003fff)),14)) |
#define | MULT16_32_Q15(a, b) ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15)) |
#define | NEG16(x) (-(x)) |
#define | NEG32(x) (-(x)) |
#define | PDIV32(a, b) (((spx_word32_t)(a)+((spx_word16_t)(b)>>1))/((spx_word32_t)(b))) |
#define | PDIV32_16(a, b) ((spx_word16_t)(((spx_word32_t)(a)+((spx_word16_t)(b)>>1))/((spx_word16_t)(b)))) |
#define | PSHR(a, shift) (SHR((a)+((EXTEND32(1)<<((shift))>>1)),shift)) |
#define | PSHR16(a, shift) (SHR16((a)+((1<<((shift))>>1)),shift)) |
#define | PSHR32(a, shift) (SHR32((a)+((EXTEND32(1)<<((shift))>>1)),shift)) |
#define | QCONST16(x, bits) ((spx_word16_t)(.5+(x)*(((spx_word32_t)1)<<(bits)))) |
#define | QCONST32(x, bits) ((spx_word32_t)(.5+(x)*(((spx_word32_t)1)<<(bits)))) |
#define | SATURATE(x, a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) |
#define | SATURATE16(x, a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) |
#define | SATURATE32(x, a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) |
#define | SATURATE32PSHR(x, shift, a) |
#define | SHL(a, shift) ((spx_word32_t)(a) << (shift)) |
#define | SHL16(a, shift) ((a) << (shift)) |
#define | SHL32(a, shift) ((a) << (shift)) |
#define | SHR(a, shift) ((a) >> (shift)) |
#define | SHR16(a, shift) ((a) >> (shift)) |
#define | SHR32(a, shift) ((a) >> (shift)) |
#define | SUB16(a, b) ((spx_word16_t)(a)-(spx_word16_t)(b)) |
#define | SUB32(a, b) ((spx_word32_t)(a)-(spx_word32_t)(b)) |
#define | VSHR32(a, shift) (((shift)>0) ? SHR32(a, shift) : SHL32(a, -(shift))) |
Generic fixed-point operations.
Definition in file fixed_generic.h.
#define ADD16 | ( | a, | |
b | |||
) | ((spx_word16_t)((spx_word16_t)(a)+(spx_word16_t)(b))) |
Definition at line 65 of file fixed_generic.h.
#define ADD32 | ( | a, | |
b | |||
) | ((spx_word32_t)(a)+(spx_word32_t)(b)) |
Definition at line 67 of file fixed_generic.h.
#define DIV32 | ( | a, | |
b | |||
) | (((spx_word32_t)(a))/((spx_word32_t)(b))) |
Definition at line 107 of file fixed_generic.h.
#define DIV32_16 | ( | a, | |
b | |||
) | ((spx_word16_t)(((spx_word32_t)(a))/((spx_word16_t)(b)))) |
Definition at line 105 of file fixed_generic.h.
#define EXTEND32 | ( | x | ) | ((spx_word32_t)(x)) |
Definition at line 44 of file fixed_generic.h.
Referenced by cubic_coef().
#define EXTRACT16 | ( | x | ) | ((spx_word16_t)(x)) |
Definition at line 43 of file fixed_generic.h.
Referenced by cubic_coef().
Definition at line 77 of file fixed_generic.h.
Definition at line 92 of file fixed_generic.h.
Definition at line 90 of file fixed_generic.h.
Definition at line 91 of file fixed_generic.h.
#define MAC16_32_Q11 | ( | c, | |
a, | |||
b | |||
) | ADD32(c,ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11))) |
Definition at line 83 of file fixed_generic.h.
#define MAC16_32_Q15 | ( | c, | |
a, | |||
b | |||
) | ADD32(c,ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15))) |
Definition at line 87 of file fixed_generic.h.
Definition at line 103 of file fixed_generic.h.
#define MULT16_16 | ( | a, | |
b | |||
) | (((spx_word32_t)(spx_word16_t)(a))*((spx_word32_t)(spx_word16_t)(b))) |
Definition at line 75 of file fixed_generic.h.
Referenced by cubic_coef(), resampler_basic_direct_single(), and resampler_basic_interpolate_single().
#define MULT16_16_16 | ( | a, | |
b | |||
) | ((((spx_word16_t)(a))*((spx_word16_t)(b)))) |
Definition at line 72 of file fixed_generic.h.
Definition at line 99 of file fixed_generic.h.
Definition at line 100 of file fixed_generic.h.
Definition at line 101 of file fixed_generic.h.
Referenced by cubic_coef().
Definition at line 94 of file fixed_generic.h.
Definition at line 95 of file fixed_generic.h.
Definition at line 96 of file fixed_generic.h.
Definition at line 97 of file fixed_generic.h.
#define MULT16_32_P15 | ( | a, | |
b | |||
) | ADD32(MULT16_16((a),SHR((b),15)), PSHR(MULT16_16((a),((b)&0x00007fff)),15)) |
Definition at line 85 of file fixed_generic.h.
#define MULT16_32_Q11 | ( | a, | |
b | |||
) | ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11)) |
Definition at line 82 of file fixed_generic.h.
#define MULT16_32_Q12 | ( | a, | |
b | |||
) | ADD32(MULT16_16((a),SHR((b),12)), SHR(MULT16_16((a),((b)&0x00000fff)),12)) |
Definition at line 78 of file fixed_generic.h.
#define MULT16_32_Q13 | ( | a, | |
b | |||
) | ADD32(MULT16_16((a),SHR((b),13)), SHR(MULT16_16((a),((b)&0x00001fff)),13)) |
Definition at line 79 of file fixed_generic.h.
#define MULT16_32_Q14 | ( | a, | |
b | |||
) | ADD32(MULT16_16((a),SHR((b),14)), SHR(MULT16_16((a),((b)&0x00003fff)),14)) |
Definition at line 80 of file fixed_generic.h.
#define MULT16_32_Q15 | ( | a, | |
b | |||
) | ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15)) |
Definition at line 86 of file fixed_generic.h.
Referenced by resampler_basic_interpolate_single().
#define NEG16 | ( | x | ) | (-(x)) |
Definition at line 41 of file fixed_generic.h.
#define NEG32 | ( | x | ) | (-(x)) |
Definition at line 42 of file fixed_generic.h.
#define PDIV32 | ( | a, | |
b | |||
) | (((spx_word32_t)(a)+((spx_word16_t)(b)>>1))/((spx_word32_t)(b))) |
Definition at line 108 of file fixed_generic.h.
Referenced by resampler_basic_interpolate_single().
#define PDIV32_16 | ( | a, | |
b | |||
) | ((spx_word16_t)(((spx_word32_t)(a)+((spx_word16_t)(b)>>1))/((spx_word16_t)(b)))) |
Definition at line 106 of file fixed_generic.h.
Definition at line 61 of file fixed_generic.h.
Definition at line 49 of file fixed_generic.h.
Definition at line 50 of file fixed_generic.h.
Referenced by cubic_coef(), resampler_basic_direct_single(), and resampler_basic_interpolate_single().
#define QCONST16 | ( | x, | |
bits | |||
) | ((spx_word16_t)(.5+(x)*(((spx_word32_t)1)<<(bits)))) |
Definition at line 38 of file fixed_generic.h.
Referenced by cubic_coef().
#define QCONST32 | ( | x, | |
bits | |||
) | ((spx_word32_t)(.5+(x)*(((spx_word32_t)1)<<(bits)))) |
Definition at line 39 of file fixed_generic.h.
Definition at line 62 of file fixed_generic.h.
Definition at line 52 of file fixed_generic.h.
Definition at line 53 of file fixed_generic.h.
#define SATURATE32PSHR | ( | x, | |
shift, | |||
a | |||
) |
Definition at line 55 of file fixed_generic.h.
Referenced by resampler_basic_direct_single(), and resampler_basic_interpolate_single().
#define SHL | ( | a, | |
shift | |||
) | ((spx_word32_t)(a) << (shift)) |
Definition at line 60 of file fixed_generic.h.
Definition at line 46 of file fixed_generic.h.
Definition at line 48 of file fixed_generic.h.
Referenced by resampler_basic_interpolate_single().
Definition at line 59 of file fixed_generic.h.
Definition at line 45 of file fixed_generic.h.
Definition at line 47 of file fixed_generic.h.
Referenced by cubic_coef(), and resampler_basic_interpolate_single().
#define SUB16 | ( | a, | |
b | |||
) | ((spx_word16_t)(a)-(spx_word16_t)(b)) |
Definition at line 66 of file fixed_generic.h.
#define SUB32 | ( | a, | |
b | |||
) | ((spx_word32_t)(a)-(spx_word32_t)(b)) |
Definition at line 68 of file fixed_generic.h.
Referenced by cubic_coef().