44#define MIN_WORD (-32767 - 1)
47#define MIN_LONGWORD (-2147483647 - 1)
48#define MAX_LONGWORD 2147483647
52#define SASR(x, by) ((x) >> (by))
54#define SASR(x, by) ((x) >= 0 ? (x) >> (by) : (~(-((x) + 1) >> (by))))
92#define GSM_MULT_R(a, b) \
93 (SASR( ((longword)(a) * (longword)(b) + 16384), 15 ))
95# define GSM_MULT(a,b) \
96 (SASR( ((longword)(a) * (longword)(b)), 15 ))
98# define GSM_L_MULT(a, b) \
99 (((longword)(a) * (longword)(b)) << 1)
101#if defined(__GNUC__) && defined(__i386__)
105 __asm__ __volatile__(
107 "addl %2,%0; jno 0f; movl $0x7fffffff,%0; adcl $0,%0; 0:"
115static __inline__
short GSM_ADD(
short a,
short b)
117 __asm__ __volatile__(
118 "addw %2,%0; jno 0f; movw $0x7fff,%0; adcw $0,%0; 0:"
126static __inline__
short GSM_SUB(
short a,
short b)
128 __asm__ __volatile__(
129 "subw %2,%0; jno 0f; movw $0x7fff,%0; adcw $0,%0; 0:"
140#define inline __inline
141#define __inline__ __inline
144# define GSM_L_ADD(a, b) \
145 ( (a) < 0 ? ( (b) >= 0 ? (a) + (b) \
146 : (utmp = (ulongword)-((a) + 1) + (ulongword)-((b) + 1)) \
147 >= MAX_LONGWORD ? MIN_LONGWORD : -(longword)utmp-2 ) \
148 : ((b) <= 0 ? (a) + (b) \
149 : (utmp = (ulongword)(a) + (ulongword)(b)) >= MAX_LONGWORD \
150 ? MAX_LONGWORD : utmp))
168# define GSM_ABS(a) ((a) < 0 ? ((a) == MIN_WORD ? MAX_WORD : -(a)) : (a))
187extern void Gsm_Coder
P((
197extern void Gsm_Long_Term_Predictor
P((
206extern void Gsm_LPC_Analysis
P((
211extern void Gsm_Preprocess
P((
215extern void Gsm_Encoding
P((
223extern void Gsm_Short_Term_Analysis_Filter
P((
228extern void Gsm_Decoder
P((
238extern void Gsm_Decoding
P((
245extern void Gsm_Long_Term_Synthesis_Filtering
P((
252void Gsm_RPE_Decoding
P((
259void Gsm_RPE_Encoding
P((
266extern void Gsm_Short_Term_Synthesis_Filter
P((
272extern void Gsm_Update_of_reconstructed_short_time_residual_signal
P((
296# define gsm_debug_words(a, b, c, d)
297# define gsm_debug_longwords(a, b, c, d)
298# define gsm_debug_word(a, b)
299# define gsm_debug_longword(a, b)
303 extern void gsm_debug_words
P((
char *
name,
int,
int,
word *));
word gsm_mult P((word a, word b))
static word GSM_ADD(longword a, longword b)
static word GSM_SUB(longword a, longword b)
unsigned char frame_chain
unsigned char frame_index