CreateLevelsForAllConChannels shall call CStereoSignalLevelMeter::CalcLogResult

This commit is contained in:
Volker Fischer 2020-04-10 16:56:45 +02:00
parent 9503630c4a
commit 631c473acc
3 changed files with 8 additions and 18 deletions

View File

@ -11,8 +11,7 @@
* fixed column widths are slightly too narrow for "Ping Time" and "Musicians" and typos * fixed column widths are slightly too narrow for "Ping Time" and "Musicians" and typos
TODO fix UpdateCurLevel() for new 64 samples frame size
TODO in CreateLevelsForAllConChannels we should call CStereoSignalLevelMeter::CalcLogResult instead -> make it public and static
TODO auto jitter buffer performance not good at 64 samples frame size TODO auto jitter buffer performance not good at 64 samples frame size

View File

@ -1715,17 +1715,7 @@ void CServer::CreateLevelsForAllConChannels ( const int i
vecChannels[iChId].SetPrevLevel ( dCurLevel ); vecChannels[iChId].SetPrevLevel ( dCurLevel );
// logarithmic measure // logarithmic measure
// TODO we should call CStereoSignalLevelMeter::CalcLogResult instead -> make it public and static double dCurSigLevel = CStereoSignalLevelMeter::CalcLogResult ( dCurLevel );
const double dNormChanLevel = dCurLevel / _MAXSHORT;
double dCurSigLevel;
if ( dNormChanLevel > 0 )
{
dCurSigLevel = 20.0 * log10 ( dNormChanLevel );
}
else
{
dCurSigLevel = -100000.0; // large negative value
}
// map to signal level meter // map to signal level meter
dCurSigLevel -= LOW_BOUND_SIG_METER; dCurSigLevel -= LOW_BOUND_SIG_METER;

View File

@ -594,17 +594,18 @@ class CStereoSignalLevelMeter
public: public:
CStereoSignalLevelMeter() { Reset(); } CStereoSignalLevelMeter() { Reset(); }
void Update ( const CVector<short>& vecsAudio ); void Update ( const CVector<short>& vecsAudio );
double MicLevelLeft() { return CalcLogResult ( dCurLevelL ); } double MicLevelLeft() { return CalcLogResult ( dCurLevelL ); }
double MicLevelRight() { return CalcLogResult ( dCurLevelR ); } double MicLevelRight() { return CalcLogResult ( dCurLevelR ); }
void Reset() static double CalcLogResult ( const double& dLinearLevel );
void Reset()
{ {
dCurLevelL = 0.0; dCurLevelL = 0.0;
dCurLevelR = 0.0; dCurLevelR = 0.0;
} }
protected: protected:
double CalcLogResult ( const double& dLinearLevel );
double UpdateCurLevel ( double dCurLevel, double UpdateCurLevel ( double dCurLevel,
const short& sMax ); const short& sMax );