Asterisk - The Open Source Telephony Project GIT-master-5782b03
Data Structures | Macros | Typedefs | Functions | Variables
codecs/gsm/inc/private.h File Reference
#include "proto.h"
#include "unproto.h"
Include dependency graph for codecs/gsm/inc/private.h:

Go to the source code of this file.

Data Structures

struct  gsm_state
 

Macros

#define GSM_ABS(a)   ((a) < 0 ? ((a) == MIN_WORD ? MAX_WORD : -(a)) : (a))
 
#define GSM_L_ADD(a, b)
 
#define GSM_L_MULT(a, b)
 
#define GSM_MULT(a, b)
 
#define GSM_MULT_R(a, b)
 
#define MAX_LONGWORD   2147483647
 
#define MAX_WORD   32767
 
#define MIN_LONGWORD   (-2147483647 - 1)
 
#define MIN_WORD   (-32767 - 1)
 
#define SASR(x, by)   ((x) >= 0 ? (x) >> (by) : (~(-((x) + 1) >> (by))))
 

Typedefs

typedef long longword
 
typedef unsigned long ulongword
 
typedef unsigned short uword
 
typedef short word
 

Functions

static word GSM_ADD (longword a, longword b)
 
static word GSM_SUB (longword a, longword b)
 
void gsm_debug_longwords P ((char *name, int, int, longword *))
 
void gsm_debug_words P ((char *name, int, int, word *))
 
void gsm_debug_longword P ((char *name, longword))
 
void gsm_debug_word P ((char *name, word))
 
word gsm_norm P ((longword a))
 
longword gsm_L_asl P ((longword a, int n))
 
longword gsm_L_add P ((longword a, longword b))
 
void Gsm_Long_Term_Predictor P ((struct gsm_state *S, word *d, word *dp, word *e, word *dpp, word *Nc, word *bc))
 
void Gsm_Encoding P ((struct gsm_state *S, word *e, word *ep, word *xmaxc, word *Mc, word *xMc))
 
void Gsm_RPE_Encoding P ((struct gsm_state *S, word *e, word *xmaxc, word *Mc, word *xMc))
 
void Gsm_Short_Term_Analysis_Filter P ((struct gsm_state *S, word *LARc, word *d))
 
void Gsm_Short_Term_Synthesis_Filter P ((struct gsm_state *S, word *LARcr, word *drp, word *s))
 
void Gsm_Decoder P ((struct gsm_state *S, word *LARcr, word *Ncr, word *bcr, word *Mcr, word *xmaxcr, word *xMcr, word *s))
 
void Gsm_LPC_Analysis P ((struct gsm_state *S, word *s, word *LARc))
 
void Gsm_Coder P ((struct gsm_state *S, word *s, word *LARc, word *Nc, word *bc, word *Mc, word *xmaxc, word *xMc))
 
void Gsm_Preprocess P ((struct gsm_state *S, word *s, word *so))
 
void Gsm_Long_Term_Synthesis_Filtering P ((struct gsm_state *S, word Ncr, word bcr, word *erp, word *drp))
 
void Gsm_Decoding P ((struct gsm_state *S, word xmaxcr, word Mcr, word *xMcr, word *erp))
 
void Gsm_Update_of_reconstructed_short_time_residual_signal P ((word *dpp, word *ep, word *dp))
 
word gsm_abs P ((word a))
 
word gsm_asl P ((word a, int n))
 
word gsm_mult P ((word a, word b))
 
word gsm_div P ((word num, word denum))
 

Variables

word gsm_A [8]
 
word gsm_B [8]
 
word gsm_DLB [4]
 
word gsm_FAC [8]
 
word gsm_H [11]
 
word gsm_INVA [8]
 
word gsm_MAC [8]
 
word gsm_MIC [8]
 
word gsm_NRFAC [8]
 
word gsm_QLB [4]
 

Macro Definition Documentation

◆ GSM_ABS

#define GSM_ABS (   a)    ((a) < 0 ? ((a) == MIN_WORD ? MAX_WORD : -(a)) : (a))

Definition at line 168 of file codecs/gsm/inc/private.h.

◆ GSM_L_ADD

#define GSM_L_ADD (   a,
  b 
)

Definition at line 144 of file codecs/gsm/inc/private.h.

◆ GSM_L_MULT

#define GSM_L_MULT (   a,
  b 
)
Value:
/* word a, word b */ \
(((longword)(a) * (longword)(b)) << 1)
long longword
static struct test_val b
static struct test_val a

Definition at line 98 of file codecs/gsm/inc/private.h.

◆ GSM_MULT

#define GSM_MULT (   a,
  b 
)
Value:
/* word a, word b, !(a == b == MIN_WORD) */ \
(SASR( ((longword)(a) * (longword)(b)), 15 ))
#define SASR(x, by)

Definition at line 95 of file codecs/gsm/inc/private.h.

◆ GSM_MULT_R

#define GSM_MULT_R (   a,
  b 
)
Value:
/* word a, word b, !(a == b == MIN_WORD) */ \
(SASR( ((longword)(a) * (longword)(b) + 16384), 15 ))

Definition at line 92 of file codecs/gsm/inc/private.h.

◆ MAX_LONGWORD

#define MAX_LONGWORD   2147483647

Definition at line 48 of file codecs/gsm/inc/private.h.

◆ MAX_WORD

#define MAX_WORD   32767

Definition at line 45 of file codecs/gsm/inc/private.h.

◆ MIN_LONGWORD

#define MIN_LONGWORD   (-2147483647 - 1)

Definition at line 47 of file codecs/gsm/inc/private.h.

◆ MIN_WORD

#define MIN_WORD   (-32767 - 1)

Definition at line 44 of file codecs/gsm/inc/private.h.

◆ SASR

#define SASR (   x,
  by 
)    ((x) >= 0 ? (x) >> (by) : (~(-((x) + 1) >> (by))))

Definition at line 54 of file codecs/gsm/inc/private.h.

Typedef Documentation

◆ longword

typedef long longword

Definition at line 13 of file codecs/gsm/inc/private.h.

◆ ulongword

typedef unsigned long ulongword

Definition at line 16 of file codecs/gsm/inc/private.h.

◆ uword

typedef unsigned short uword

Definition at line 15 of file codecs/gsm/inc/private.h.

◆ word

typedef short word

Definition at line 12 of file codecs/gsm/inc/private.h.

Function Documentation

◆ GSM_ADD()

static word GSM_ADD ( longword  a,
longword  b 
)
inlinestatic

Definition at line 152 of file codecs/gsm/inc/private.h.

153{
154 register longword ltmp;
155 ltmp = a + b;
156 return (word)((ulongword) (ltmp - MIN_WORD) > MAX_WORD - MIN_WORD ? (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp);
157};
short word
#define MIN_WORD
unsigned long ulongword
#define MAX_WORD

References a, b, MAX_WORD, and MIN_WORD.

Referenced by P1(), P2(), P3(), P4(), P5(), and P8().

◆ GSM_SUB()

static word GSM_SUB ( longword  a,
longword  b 
)
inlinestatic

Definition at line 159 of file codecs/gsm/inc/private.h.

160{
161 register longword ltmp;
162 ltmp = a - b;
163 return (word)(ltmp >= MAX_WORD ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp);
164};

References a, b, MAX_WORD, and MIN_WORD.

◆ P() [1/23]

void gsm_debug_longwords P ( (char *name, int, int, longword *)  )

◆ P() [2/23]

void gsm_debug_words P ( (char *name, int, int, word *)  )

◆ P() [3/23]

void gsm_debug_longword P ( (char *name, longword )

◆ P() [4/23]

void gsm_debug_word P ( (char *name, word )

◆ P() [5/23]

word gsm_norm P ( (longword a )

◆ P() [6/23]

longword gsm_L_asr P ( (longword a, int n)  )

◆ P() [7/23]

longword gsm_L_sub P ( (longword a, longword b )

◆ P() [8/23]

void Gsm_Long_Term_Predictor P ( (struct gsm_state *S, word *d, word *dp, word *e, word *dpp, word *Nc, word *bc )

◆ P() [9/23]

void Gsm_Encoding P ( (struct gsm_state *S, word *e, word *ep, word *xmaxc, word *Mc, word *xMc)  )

◆ P() [10/23]

void Gsm_RPE_Encoding P ( (struct gsm_state *S, word *e, word *xmaxc, word *Mc, word *xMc)  )

◆ P() [11/23]

void Gsm_Short_Term_Analysis_Filter P ( (struct gsm_state *S, word *LARc, word *d )

◆ P() [12/23]

void Gsm_Short_Term_Synthesis_Filter P ( (struct gsm_state *S, word *LARcr, word *drp, word *s)  )

◆ P() [13/23]

void Gsm_Decoder P ( (struct gsm_state *S, word *LARcr, word *Ncr, word *bcr, word *Mcr, word *xmaxcr, word *xMcr, word *s)  )

◆ P() [14/23]

void Gsm_LPC_Analysis P ( (struct gsm_state *S, word *s, word *LARc )

◆ P() [15/23]

void Gsm_Coder P ( (struct gsm_state *S, word *s, word *LARc, word *Nc, word *bc, word *Mc, word *xmaxc, word *xMc)  )

◆ P() [16/23]

void Gsm_Preprocess P ( (struct gsm_state *S, word *s, word *so)  )

◆ P() [17/23]

void Gsm_Long_Term_Synthesis_Filtering P ( (struct gsm_state *S, word Ncr, word bcr, word *erp, word *drp)  )

◆ P() [18/23]

void Gsm_RPE_Decoding P ( (struct gsm_state *S, word xmaxcr, word Mcr, word *xMcr, word *erp)  )

◆ P() [19/23]

void Gsm_Update_of_reconstructed_short_time_residual_signal P ( (word *dpp, word *ep, word *dp)  )

◆ P() [20/23]

word gsm_abs P ( (word a )

◆ P() [21/23]

word gsm_asr P ( (word a, int n)  )

◆ P() [22/23]

word gsm_sub P ( (word a, word b )

◆ P() [23/23]

word gsm_div P ( (word num, word denum)  )

Variable Documentation

◆ gsm_A

word gsm_A[8]
extern

Definition at line 25 of file table.c.

◆ gsm_B

word gsm_B[8]

Definition at line 282 of file codecs/gsm/inc/private.h.

◆ gsm_DLB

word gsm_DLB[4]
extern

Definition at line 39 of file table.c.

Referenced by P4().

◆ gsm_FAC

word gsm_FAC[8]
extern

Definition at line 63 of file table.c.

Referenced by P4().

◆ gsm_H

word gsm_H[11]
extern

Definition at line 51 of file table.c.

◆ gsm_INVA

word gsm_INVA[8]
extern

Definition at line 33 of file table.c.

◆ gsm_MAC

word gsm_MAC[8]

Definition at line 282 of file codecs/gsm/inc/private.h.

◆ gsm_MIC

word gsm_MIC[8]

Definition at line 282 of file codecs/gsm/inc/private.h.

◆ gsm_NRFAC

word gsm_NRFAC[8]
extern

Definition at line 57 of file table.c.

Referenced by P5().

◆ gsm_QLB

word gsm_QLB[4]

Definition at line 284 of file codecs/gsm/inc/private.h.

Referenced by P5().