SAF
Loading...
Searching...
No Matches
arch.h File Reference

Various architecture definitions Speex. More...

#include "speexdsp_types.h"

Go to the source code of this file.

Macros

#define FLOATING_POINT
 
#define ABS(x)   ((x) < 0 ? (-(x)) : (x))
 Absolute integer value.
 
#define ABS16(x)   ((x) < 0 ? (-(x)) : (x))
 Absolute 16-bit value.
 
#define MIN16(a, b)   ((a) < (b) ? (a) : (b))
 Maximum 16-bit value.
 
#define MAX16(a, b)   ((a) > (b) ? (a) : (b))
 Maximum 16-bit value.
 
#define ABS32(x)   ((x) < 0 ? (-(x)) : (x))
 Absolute 32-bit value.
 
#define MIN32(a, b)   ((a) < (b) ? (a) : (b))
 Maximum 32-bit value.
 
#define MAX32(a, b)   ((a) > (b) ? (a) : (b))
 Maximum 32-bit value.
 
#define Q15ONE   1.0f
 
#define LPC_SCALING   1.f
 
#define SIG_SCALING   1.f
 
#define LSP_SCALING   1.f
 
#define GAMMA_SCALING   1.f
 
#define GAIN_SCALING   1.f
 
#define GAIN_SCALING_1   1.f
 
#define VERY_SMALL   1e-15f
 
#define VERY_LARGE32   1e15f
 
#define VERY_LARGE16   1e15f
 
#define Q15_ONE   ((spx_word16_t)1.f)
 
#define QCONST16(x, bits)   (x)
 
#define QCONST32(x, bits)   (x)
 
#define NEG16(x)   (-(x))
 
#define NEG32(x)   (-(x))
 
#define EXTRACT16(x)   (x)
 
#define EXTEND32(x)   (x)
 
#define SHR16(a, shift)   (a)
 
#define SHL16(a, shift)   (a)
 
#define SHR32(a, shift)   (a)
 
#define SHL32(a, shift)   (a)
 
#define PSHR16(a, shift)   (a)
 
#define PSHR32(a, shift)   (a)
 
#define VSHR32(a, shift)   (a)
 
#define SATURATE16(x, a)   (x)
 
#define SATURATE32(x, a)   (x)
 
#define SATURATE32PSHR(x, shift, a)   (x)
 
#define PSHR(a, shift)   (a)
 
#define SHR(a, shift)   (a)
 
#define SHL(a, shift)   (a)
 
#define SATURATE(x, a)   (x)
 
#define ADD16(a, b)   ((a)+(b))
 
#define SUB16(a, b)   ((a)-(b))
 
#define ADD32(a, b)   ((a)+(b))
 
#define SUB32(a, b)   ((a)-(b))
 
#define MULT16_16_16(a, b)   ((a)*(b))
 
#define MULT16_32_32(a, b)   ((a)*(b))
 
#define MULT16_16(a, b)   ((spx_word32_t)(a)*(spx_word32_t)(b))
 
#define MAC16_16(c, a, b)   ((c)+(spx_word32_t)(a)*(spx_word32_t)(b))
 
#define MULT16_32_Q15(a, b)   ((a)*(b))
 
#define MULT16_32_P15(a, b)   ((a)*(b))
 
#define MAC16_32_Q15(c, a, b)   ((c)+(a)*(b))
 
#define MAC16_16_Q11(c, a, b)   ((c)+(a)*(b))
 
#define MAC16_16_Q13(c, a, b)   ((c)+(a)*(b))
 
#define MAC16_16_P13(c, a, b)   ((c)+(a)*(b))
 
#define MULT16_16_Q11_32(a, b)   ((a)*(b))
 
#define MULT16_16_Q13(a, b)   ((a)*(b))
 
#define MULT16_16_Q14(a, b)   ((a)*(b))
 
#define MULT16_16_Q15(a, b)   ((a)*(b))
 
#define MULT16_16_P15(a, b)   ((a)*(b))
 
#define MULT16_16_P13(a, b)   ((a)*(b))
 
#define MULT16_16_P14(a, b)   ((a)*(b))
 
#define DIV32_16(a, b)   (((spx_word32_t)(a))/(spx_word16_t)(b))
 
#define PDIV32_16(a, b)   (((spx_word32_t)(a))/(spx_word16_t)(b))
 
#define DIV32(a, b)   (((spx_word32_t)(a))/(spx_word32_t)(b))
 
#define PDIV32(a, b)   (((spx_word32_t)(a))/(spx_word32_t)(b))
 
#define WORD2INT(x)
 
#define BYTES_PER_CHAR   1
 
#define BITS_PER_CHAR   8
 
#define LOG2_BITS_PER_CHAR   3
 

Typedefs

typedef float spx_mem_t
 
typedef float spx_coef_t
 
typedef float spx_lsp_t
 
typedef float spx_sig_t
 
typedef float spx_word16_t
 
typedef float spx_word32_t
 

Detailed Description

Various architecture definitions Speex.

License
BSD 3-Clause

Definition in file arch.h.

Macro Definition Documentation

◆ ABS

#define ABS ( x)    ((x) < 0 ? (-(x)) : (x))

Absolute integer value.

Definition at line 76 of file arch.h.

◆ ABS16

#define ABS16 ( x)    ((x) < 0 ? (-(x)) : (x))

Absolute 16-bit value.


Definition at line 77 of file arch.h.

◆ ABS32

#define ABS32 ( x)    ((x) < 0 ? (-(x)) : (x))

Absolute 32-bit value.


Definition at line 80 of file arch.h.

◆ ADD16

#define ADD16 ( a,
b )   ((a)+(b))

Definition at line 178 of file arch.h.

◆ ADD32

#define ADD32 ( a,
b )   ((a)+(b))

Definition at line 180 of file arch.h.

◆ BITS_PER_CHAR

#define BITS_PER_CHAR   8

Definition at line 223 of file arch.h.

◆ BYTES_PER_CHAR

#define BYTES_PER_CHAR   1

Definition at line 222 of file arch.h.

◆ DIV32

#define DIV32 ( a,
b )   (((spx_word32_t)(a))/(spx_word32_t)(b))

Definition at line 205 of file arch.h.

◆ DIV32_16

#define DIV32_16 ( a,
b )   (((spx_word32_t)(a))/(spx_word16_t)(b))

Definition at line 203 of file arch.h.

◆ EXTEND32

#define EXTEND32 ( x)    (x)

Definition at line 161 of file arch.h.

◆ EXTRACT16

#define EXTRACT16 ( x)    (x)

Definition at line 160 of file arch.h.

◆ FLOATING_POINT

#define FLOATING_POINT

Definition at line 39 of file arch.h.

◆ GAIN_SCALING

#define GAIN_SCALING   1.f

Definition at line 146 of file arch.h.

◆ GAIN_SCALING_1

#define GAIN_SCALING_1   1.f

Definition at line 147 of file arch.h.

◆ GAMMA_SCALING

#define GAMMA_SCALING   1.f

Definition at line 145 of file arch.h.

◆ LOG2_BITS_PER_CHAR

#define LOG2_BITS_PER_CHAR   3

Definition at line 224 of file arch.h.

◆ LPC_SCALING

#define LPC_SCALING   1.f

Definition at line 142 of file arch.h.

◆ LSP_SCALING

#define LSP_SCALING   1.f

Definition at line 144 of file arch.h.

◆ MAC16_16

#define MAC16_16 ( c,
a,
b )   ((c)+(spx_word32_t)(a)*(spx_word32_t)(b))

Definition at line 185 of file arch.h.

◆ MAC16_16_P13

#define MAC16_16_P13 ( c,
a,
b )   ((c)+(a)*(b))

Definition at line 194 of file arch.h.

◆ MAC16_16_Q11

#define MAC16_16_Q11 ( c,
a,
b )   ((c)+(a)*(b))

Definition at line 192 of file arch.h.

◆ MAC16_16_Q13

#define MAC16_16_Q13 ( c,
a,
b )   ((c)+(a)*(b))

Definition at line 193 of file arch.h.

◆ MAC16_32_Q15

#define MAC16_32_Q15 ( c,
a,
b )   ((c)+(a)*(b))

Definition at line 190 of file arch.h.

◆ MAX16

#define MAX16 ( a,
b )   ((a) > (b) ? (a) : (b))

Maximum 16-bit value.


Definition at line 79 of file arch.h.

◆ MAX32

#define MAX32 ( a,
b )   ((a) > (b) ? (a) : (b))

Maximum 32-bit value.


Definition at line 82 of file arch.h.

◆ MIN16

#define MIN16 ( a,
b )   ((a) < (b) ? (a) : (b))

Maximum 16-bit value.


Definition at line 78 of file arch.h.

◆ MIN32

#define MIN32 ( a,
b )   ((a) < (b) ? (a) : (b))

Maximum 32-bit value.


Definition at line 81 of file arch.h.

◆ MULT16_16

#define MULT16_16 ( a,
b )   ((spx_word32_t)(a)*(spx_word32_t)(b))

Definition at line 184 of file arch.h.

◆ MULT16_16_16

#define MULT16_16_16 ( a,
b )   ((a)*(b))

Definition at line 182 of file arch.h.

◆ MULT16_16_P13

#define MULT16_16_P13 ( a,
b )   ((a)*(b))

Definition at line 200 of file arch.h.

◆ MULT16_16_P14

#define MULT16_16_P14 ( a,
b )   ((a)*(b))

Definition at line 201 of file arch.h.

◆ MULT16_16_P15

#define MULT16_16_P15 ( a,
b )   ((a)*(b))

Definition at line 199 of file arch.h.

◆ MULT16_16_Q11_32

#define MULT16_16_Q11_32 ( a,
b )   ((a)*(b))

Definition at line 195 of file arch.h.

◆ MULT16_16_Q13

#define MULT16_16_Q13 ( a,
b )   ((a)*(b))

Definition at line 196 of file arch.h.

◆ MULT16_16_Q14

#define MULT16_16_Q14 ( a,
b )   ((a)*(b))

Definition at line 197 of file arch.h.

◆ MULT16_16_Q15

#define MULT16_16_Q15 ( a,
b )   ((a)*(b))

Definition at line 198 of file arch.h.

◆ MULT16_32_32

#define MULT16_32_32 ( a,
b )   ((a)*(b))

Definition at line 183 of file arch.h.

◆ MULT16_32_P15

#define MULT16_32_P15 ( a,
b )   ((a)*(b))

Definition at line 188 of file arch.h.

◆ MULT16_32_Q15

#define MULT16_32_Q15 ( a,
b )   ((a)*(b))

Definition at line 187 of file arch.h.

◆ NEG16

#define NEG16 ( x)    (-(x))

Definition at line 158 of file arch.h.

◆ NEG32

#define NEG32 ( x)    (-(x))

Definition at line 159 of file arch.h.

◆ PDIV32

#define PDIV32 ( a,
b )   (((spx_word32_t)(a))/(spx_word32_t)(b))

Definition at line 206 of file arch.h.

◆ PDIV32_16

#define PDIV32_16 ( a,
b )   (((spx_word32_t)(a))/(spx_word16_t)(b))

Definition at line 204 of file arch.h.

◆ PSHR

#define PSHR ( a,
shift )   (a)

Definition at line 173 of file arch.h.

◆ PSHR16

#define PSHR16 ( a,
shift )   (a)

Definition at line 166 of file arch.h.

◆ PSHR32

#define PSHR32 ( a,
shift )   (a)

Definition at line 167 of file arch.h.

◆ Q15_ONE

#define Q15_ONE   ((spx_word16_t)1.f)

Definition at line 153 of file arch.h.

◆ Q15ONE

#define Q15ONE   1.0f

Definition at line 141 of file arch.h.

◆ QCONST16

#define QCONST16 ( x,
bits )   (x)

Definition at line 155 of file arch.h.

◆ QCONST32

#define QCONST32 ( x,
bits )   (x)

Definition at line 156 of file arch.h.

◆ SATURATE

#define SATURATE ( x,
a )   (x)

Definition at line 176 of file arch.h.

◆ SATURATE16

#define SATURATE16 ( x,
a )   (x)

Definition at line 169 of file arch.h.

◆ SATURATE32

#define SATURATE32 ( x,
a )   (x)

Definition at line 170 of file arch.h.

◆ SATURATE32PSHR

#define SATURATE32PSHR ( x,
shift,
a )   (x)

Definition at line 171 of file arch.h.

◆ SHL

#define SHL ( a,
shift )   (a)

Definition at line 175 of file arch.h.

◆ SHL16

#define SHL16 ( a,
shift )   (a)

Definition at line 163 of file arch.h.

◆ SHL32

#define SHL32 ( a,
shift )   (a)

Definition at line 165 of file arch.h.

◆ SHR

#define SHR ( a,
shift )   (a)

Definition at line 174 of file arch.h.

◆ SHR16

#define SHR16 ( a,
shift )   (a)

Definition at line 162 of file arch.h.

◆ SHR32

#define SHR32 ( a,
shift )   (a)

Definition at line 164 of file arch.h.

◆ SIG_SCALING

#define SIG_SCALING   1.f

Definition at line 143 of file arch.h.

◆ SUB16

#define SUB16 ( a,
b )   ((a)-(b))

Definition at line 179 of file arch.h.

◆ SUB32

#define SUB32 ( a,
b )   ((a)-(b))

Definition at line 181 of file arch.h.

◆ VERY_LARGE16

#define VERY_LARGE16   1e15f

Definition at line 152 of file arch.h.

◆ VERY_LARGE32

#define VERY_LARGE32   1e15f

Definition at line 151 of file arch.h.

◆ VERY_SMALL

#define VERY_SMALL   1e-15f

Definition at line 150 of file arch.h.

◆ VSHR32

#define VSHR32 ( a,
shift )   (a)

Definition at line 168 of file arch.h.

◆ WORD2INT

#define WORD2INT ( x)
Value:
((x) < -32767.5f ? -32768 : \
((x) > 32766.5f ? 32767 : (spx_int16_t)floor(.5 + (x))))

Definition at line 208 of file arch.h.

Typedef Documentation

◆ spx_coef_t

typedef float spx_coef_t

Definition at line 135 of file arch.h.

◆ spx_lsp_t

typedef float spx_lsp_t

Definition at line 136 of file arch.h.

◆ spx_mem_t

typedef float spx_mem_t

Definition at line 134 of file arch.h.

◆ spx_sig_t

typedef float spx_sig_t

Definition at line 137 of file arch.h.

◆ spx_word16_t

typedef float spx_word16_t

Definition at line 138 of file arch.h.

◆ spx_word32_t

typedef float spx_word32_t

Definition at line 139 of file arch.h.