sipxmedialib  Version 3.3
MpPlcSilence.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2008 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2008 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // $$
10 
11 // Author: Sergey Kostanbaev <Sergey DOT Kostanbaev AT sipez DOT com>
12 
13 #ifndef _MpPlcSilence_h_
14 #define _MpPlcSilence_h_
15 
16 #include <mp/MpPlcBase.h>
17 
23 class MpPlcSilence : public MpPlcBase
24 {
25 /* //////////////////////////// PUBLIC //////////////////////////////////// */
26 public:
27 
28  static const char *name;
29 
30 /* ============================ CREATORS ================================== */
32 
33 
35  OsStatus init(int samplesPerSec);
36 
38  ~MpPlcSilence();
39 
41  void reset();
42 
44  void fullReset();
45 
47 
48 /* ============================ MANIPULATORS ============================== */
50 
51 
53  OsStatus insertToHistory(int frameNum,
54  const MpSpeechParams &speechParams,
55  MpAudioSample* pBuf,
56  unsigned inSamplesNum);
57 
59  OsStatus processFrame(MpSpeechParams &speechParams,
60  MpAudioSample* pBuf,
61  unsigned bufferSize,
62  unsigned inSamplesNum,
63  unsigned outSamplesNum,
64  int wantedAdjustment,
65  int &madeAdjustment);
66 
68 
69 /* ============================ ACCESSORS ================================= */
71 
72 
74  int getMaxDelayedFramesNum() const;
75 
77  int getMaxFutureFramesNum() const;
78 
80  int getAlgorithmicDelay() const;
81 
83 
84 /* ============================ INQUIRY =================================== */
86 
87 
89 
90 /* //////////////////////////// PROTECTED ///////////////////////////////// */
91 protected:
92 
93 /* //////////////////////////// PRIVATE /////////////////////////////////// */
94 private:
95 
96 };
97 
98 #endif //_MpPlcSilence_h_
OsStatus processFrame(MpSpeechParams &speechParams, MpAudioSample *pBuf, unsigned bufferSize, unsigned inSamplesNum, unsigned outSamplesNum, int wantedAdjustment, int &madeAdjustment)
Process next frame - do PLC and/or adjustment if needed.
Definition: MpPlcSilence.cpp:64
Definition: MpPlcBase.h:40
Definition: MpPlcSilence.h:23
Definition: MpTypes.h:74
OsStatus init(int samplesPerSec)
Initialize PLC with given sample rate and frame size.
Definition: MpPlcSilence.cpp:33
void fullReset()
Full reset followed by init call.
Definition: MpPlcSilence.cpp:48
int16_t MpAudioSample
Definition: MpTypes.h:44
void reset()
Reset.
Definition: MpPlcSilence.cpp:43
~MpPlcSilence()
Destructor.
Definition: MpPlcSilence.cpp:38
int getAlgorithmicDelay() const
Return algorithmic delay in samples, should be called after init.
Definition: MpPlcSilence.cpp:113
int getMaxDelayedFramesNum() const
Return maximum offset for delayed frame with respect to current.
Definition: MpPlcSilence.cpp:103
static const char * name
Definition: MpPlcSilence.h:28
OsStatus insertToHistory(int frameNum, const MpSpeechParams &speechParams, MpAudioSample *pBuf, unsigned inSamplesNum)
Update PLC history with late/future frame.
Definition: MpPlcSilence.cpp:56
int getMaxFutureFramesNum() const
Return maximum offset for future frame with respect to current.
Definition: MpPlcSilence.cpp:108