diff options
Diffstat (limited to 'Src/replicant/nsmp3dec/meanvalue.h')
-rw-r--r-- | Src/replicant/nsmp3dec/meanvalue.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/Src/replicant/nsmp3dec/meanvalue.h b/Src/replicant/nsmp3dec/meanvalue.h new file mode 100644 index 00000000..5f1a3e58 --- /dev/null +++ b/Src/replicant/nsmp3dec/meanvalue.h @@ -0,0 +1,61 @@ +/***************************************************************************\ + * +* MPEG Layer3-Audio Decoder +* © 1997-2006 by Fraunhofer IIS + * All Rights Reserved + * + * filename: meanvalue.h + * project : --- + * author : Martin Sieler + * date : 1998-02-14 + * contents/description: HEADER - calc mean value + * + * +\***************************************************************************/ + +/* + * $Date: 2010/11/17 20:46:03 $ + * $Id: meanvalue.h,v 1.1 2010/11/17 20:46:03 audiodsp Exp $ + */ + +#ifndef __MEANVALUE_H__ +#define __MEANVALUE_H__ + +/* ------------------------ includes --------------------------------------*/ + +/*-------------------------- defines --------------------------------------*/ + +/*-------------------------------------------------------------------------*/ + +class CMeanValue +{ +public: + + CMeanValue() { Reset(); } + + void Reset(); + CMeanValue& operator+= (int nValue); + + operator int() const { return m_Count ? m_Sum/m_Count : 0; } + operator float() const { return m_Count ? float(m_Sum)/float(m_Count) : 0.0f; } + + int GetSum() const { return m_Sum; } + int GetCount() const { return m_Count; } + int GetMin() const { return m_Min; } + int GetMax() const { return m_Max; } + bool IsFixed() const { return m_bFixed; } + +protected: + +private: + + int m_Count; + int m_Sum; + int m_FirstValue; + int m_Min; + int m_Max; + bool m_bFixed; +}; + +/*-------------------------------------------------------------------------*/ +#endif |