arch.h
Go to the documentation of this file.00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
#ifndef ARCH_H
00036
#define ARCH_H
00037
00038 #define ABS(x) ((x) < 0 ? (-(x)) : (x))
00039
00040
#ifdef FIXED_POINT
00041
00042
typedef signed short spx_word16_t;
00043
typedef signed int spx_word32_t;
00044
typedef long long spx_word64_t;
00045
typedef spx_word32_t spx_mem_t;
00046
typedef spx_word16_t spx_coef_t;
00047
typedef spx_word16_t spx_lsp_t;
00048
typedef spx_word32_t spx_sig_t;
00049
00050
#define LPC_SCALING 8192
00051
#define SIG_SCALING 16384
00052
#define LSP_SCALING 8192.
00053
#define GAMMA_SCALING 32768.
00054
#define GAIN_SCALING 64
00055
#define GAIN_SCALING_1 0.015625
00056
00057
#define LPC_SHIFT 13
00058
#define SIG_SHIFT 14
00059
00060
#define VERY_SMALL 0
00061
00062
00063
#ifdef ARM_ASM
00064
#include "fixed_arm.h"
00065
#elif defined (FIXED_DEBUG)
00066
#include "fixed_debug.h"
00067
#else
00068
#include "fixed_generic.h"
00069
#endif
00070
00071
00072
00073
#else
00074
00075 typedef float spx_mem_t;
00076 typedef float spx_coef_t;
00077 typedef float spx_lsp_t;
00078 typedef float spx_sig_t;
00079 typedef float spx_word16_t;
00080 typedef float spx_word32_t;
00081 typedef float spx_word64_t;
00082
00083 #define LPC_SCALING 1.
00084 #define SIG_SCALING 1.
00085 #define LSP_SCALING 1.
00086 #define GAMMA_SCALING 1.
00087 #define GAIN_SCALING 1.
00088 #define GAIN_SCALING_1 1.
00089
00090 #define LPC_SHIFT 0
00091 #define SIG_SHIFT 0
00092
00093 #define VERY_SMALL 1e-30
00094
00095 #define PSHR(a,shift) (a)
00096 #define SHR(a,shift) (a)
00097 #define SHL(a,shift) (a)
00098 #define SATURATE(x,a) (x)
00099
00100 #define ADD16(a,b) ((a)+(b))
00101 #define SUB16(a,b) ((a)-(b))
00102 #define ADD32(a,b) ((a)+(b))
00103 #define SUB32(a,b) ((a)-(b))
00104 #define ADD64(a,b) ((a)+(b))
00105 #define MULT16_16_16(a,b) ((a)*(b))
00106 #define MULT16_16(a,b) ((a)*(b))
00107 #define MAC16_16(c,a,b) ((c)+(a)*(b))
00108
00109 #define MULT16_32_Q11(a,b) ((a)*(b))
00110 #define MULT16_32_Q13(a,b) ((a)*(b))
00111 #define MULT16_32_Q14(a,b) ((a)*(b))
00112 #define MULT16_32_Q15(a,b) ((a)*(b))
00113
00114 #define MAC16_32_Q11(c,a,b) ((c)+(a)*(b))
00115 #define MAC16_32_Q15(c,a,b) ((c)+(a)*(b))
00116
00117 #define MAC16_16_Q11(c,a,b) ((c)+(a)*(b))
00118 #define MULT16_16_Q11(a,b) ((a)*(b))
00119 #define MULT16_16_Q13(a,b) ((a)*(b))
00120 #define MULT16_16_Q14(a,b) ((a)*(b))
00121 #define MULT16_16_Q15(a,b) ((a)*(b))
00122
00123 #define DIV32_16(a,b) ((a)/(b))
00124 #define DIV32(a,b) ((a)/(b))
00125
00126
00127
#endif
00128
00129
00130
00131
#endif
Generated on Thu Aug 12 11:55:01 2004 for speex by
1.3.8