sipxmedialib  Version 3.3
dsplib.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2004-2006 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
9 // Licensed to SIPfoundry under a Contributor Agreement.
10 //
11 // $$
13 
14 #ifndef __INCdsplib_h /* [ */
15 #define __INCdsplib_h
16 
17 #include "mp/MpBuf.h"
18 #include "mp/MpTypes.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 /* comfort noise generator assume the max size of processing frame is 80 */
25 #define SAMPLES_PER_FRAME 80
26 
27 // -----------------------------------------------------
28 // Comfort Noise Generator module used by MprDecode
29 // -----------------------------------------------------
30 extern void init_CNG();
31 
32 extern void white_noise_generator(MpAudioSample *shpSamples,
33  int iLength,
34  uint32_t ulNoiseLevelAve);
35 
36 extern void comfort_noise_generator(MpAudioSample *shpSamples,
37  int iLength,
38  uint32_t ulNoiseLevelAve);
39 
40 extern void background_noise_level_estimation(uint32_t &shNoiseLevel,
41  MpAudioSample *shpSamples,
42  int iLength);
43 
45 
46 #ifdef NEVER_GOT_USED /* [ */
47 extern void dspCopy32Sto16S(const int* src, short* dst, int count);
48 
49 extern void dspCopy16Sto32S(const short* src, int* dst, int count);
50 
51 /* dot product of an array of 32 bit samples by 32 bit coefficients */
52 extern int64_t dspDotProd32x32(const int* v1, const int* v2,
53  int count, int64_t* res = 0);
54 
55 #endif /* NEVER_GOT_USED ] */
56 
57 #define dspDotProd32S dspDotProd16x32
58 
59 /* dot product of an array of 16 bit samples by 32 bit coefficients */
60 extern int64_t dspDotProd16x32(const short* v1, const int* v2,
61  int count, int64_t* res = 0);
62 
63 /* special version that skips every other item in v1 */
64 extern int64_t dspDotProd16skip32(const short* v1, const int* v2,
65  int count, int64_t* res = 0);
66 
67 /* Coefficient update routines */
68 extern void dspCoeffUpdate16x32(const short* v1, int* v2,
69  int count, int factor);
70 
71 extern void dspCoeffUpdate16skip32(const short* v1, int* v2,
72  int count, int factor);
73 
74 
75 typedef struct
76  {
77  int r;
78  int i;
79  } icomplex;
80 
81 extern int imagsq(icomplex* x, int PreRightShift);
82 
83 extern void complexInnerProduct(icomplex *ResultPtr,
84  icomplex *CoeffPtr, icomplex *DLPtr, int EcIndex);
85 
86 extern void complexCoefUpdate5(icomplex *NormedErrPtr,
87  icomplex *CoeffPtr, icomplex *DLPtr, int EcIndex, int* Shifts);
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif /* __INCdsplib_h ] */
int r
Definition: dsplib.h:77
void background_noise_level_estimation(uint32_t &shNoiseLevel, MpAudioSample *shpSamples, int iLength)
Definition: DSPlib.cpp:126
int i
Definition: dsplib.h:78
void complexCoefUpdate5(icomplex *NormedErrPtr, icomplex *CoeffPtr, icomplex *DLPtr, int EcIndex, int *Shifts)
void white_noise_generator(MpAudioSample *shpSamples, int iLength, uint32_t ulNoiseLevelAve)
Definition: DSPlib.cpp:61
void complexInnerProduct(icomplex *ResultPtr, icomplex *CoeffPtr, icomplex *DLPtr, int EcIndex)
Definition: dsplib.h:75
int imagsq(icomplex *x, int PreRightShift)
Definition: HandsetFilterBank.cpp:1488
int16_t MpAudioSample
Definition: MpTypes.h:44
void comfort_noise_generator(MpAudioSample *shpSamples, int iLength, uint32_t ulNoiseLevelAve)
Definition: DSPlib.cpp:78
int64_t dspDotProd16skip32(const short *v1, const int *v2, int count, int64_t *res=0)
Definition: DSPlib.cpp:490
void dspCoeffUpdate16x32(const short *v1, int *v2, int count, int factor)
Definition: DSPlib.cpp:526
void init_CNG()
Definition: DSPlib.cpp:55
int64_t dspDotProd16x32(const short *v1, const int *v2, int count, int64_t *res=0)
Definition: DSPlib.cpp:474
void dspCoeffUpdate16skip32(const short *v1, int *v2, int count, int factor)
Definition: DSPlib.cpp:536