sipxmedialib  Version 3.3
MpAgcSimple.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 _MpAgcSimple_h_
14 #define _MpAgcSimple_h_
15 
16 // SYSTEM INCLUDES
17 // APPLICATION INCLUDES
18 #include "utl/UtlString.h"
19 #include "mp/MpTypes.h"
20 
21 // DEFINES
22 // MACROS
23 // EXTERNAL FUNCTIONS
24 // EXTERNAL VARIABLES
25 // CONSTANTS
26 // STRUCTS
27 // TYPEDEFS
28 // FORWARD DECLARATIONS
29 
36 class MpAgcSimple : public MpAgcBase
37 {
38 /* //////////////////////////////// PUBLIC //////////////////////////////// */
39 public:
40 
41  const static UtlString name;
42 
43 /* =============================== CREATORS =============================== */
45 
46 
48  MpAgcSimple();
49 
51  OsStatus init(int samplerate);
52 
54  ~MpAgcSimple();
55 
57  void reset();
58 
60 
61 /* ============================= MANIPULATORS ============================= */
63 
64 
66  OsStatus processFrame(const MpAudioSample* data, int count);
67 
69 
70 /* ============================== ACCESSORS =============================== */
72 
73 
75  OsStatus getAmplitude(MpAudioSample& amp, UtlBoolean &isClipped);
76 
78 
79 /* =============================== INQUIRY ================================ */
81 
82 
83 
85 
86 /* ////////////////////////////// PROTECTED /////////////////////////////// */
87 protected:
88 
89 /* /////////////////////////////// PRIVATE //////////////////////////////// */
90 private:
91  float mAdaptation;
93  UtlBoolean mWasClipping;
94 };
95 
96 /* ============================ INLINE METHODS ============================ */
97 
98 #endif // _MpAgcSimple_h_
UtlBoolean mWasClipping
Definition: MpAgcSimple.h:93
MpAgcSimple()
Constructor.
Definition: MpAgcSimple.cpp:31
float mAdaptation
Definition: MpAgcSimple.h:91
Base class for AGC algorithm.
Definition: MpAgcBase.h:35
OsStatus getAmplitude(MpAudioSample &amp, UtlBoolean &isClipped)
Get amplitude of the last processed frame.
Definition: MpAgcSimple.cpp:73
int16_t MpAudioSample
Definition: MpTypes.h:44
MpAudioSample mAmplitude
Definition: MpAgcSimple.h:92
~MpAgcSimple()
Destructor.
Definition: MpAgcSimple.cpp:44
OsStatus processFrame(const MpAudioSample *data, int count)
Calculate amplitude of the frame.
Definition: MpAgcSimple.cpp:58
Simple class for AGC algorithm.
Definition: MpAgcSimple.h:36
void reset()
Reset.
Definition: MpAgcSimple.cpp:49
OsStatus init(int samplerate)
Initialize AGC with given sample rate.
Definition: MpAgcSimple.cpp:39
static const UtlString name
Name of this AGC algorithm.
Definition: MpAgcSimple.h:41