rename SYSTEM_FRAME_SIZE_SAMPLES_SMALL to SYSTEM_FRAME_SIZE_SAMPLES

This commit is contained in:
Volker Fischer 2020-04-15 15:29:43 +02:00
parent f51dd662c4
commit b335321950
6 changed files with 93 additions and 93 deletions

View File

@ -166,7 +166,7 @@ void CChannel::SetAudioStreamProperties ( const EAudComprType eNewAudComprType,
}
else
{
iAudioFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES_SMALL;
iAudioFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES;
}
MutexSocketBuf.lock();
@ -387,7 +387,7 @@ void CChannel::OnNetTranspPropsReceived ( CNetworkTransportProps NetworkTranspor
else
{
iFadeInCntMax = FADE_IN_NUM_FRAMES / iNetwFrameSizeFact;
iAudioFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES_SMALL;
iAudioFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES;
}
MutexSocketBuf.lock();

View File

@ -83,7 +83,7 @@ CClient::CClient ( const quint16 iPortNumber,
&iOpusError );
Opus64Mode = opus_custom_mode_create ( SYSTEM_SAMPLE_RATE_HZ,
SYSTEM_FRAME_SIZE_SAMPLES_SMALL,
SYSTEM_FRAME_SIZE_SAMPLES,
&iOpusError );
// init audio encoders and decoders
@ -669,16 +669,16 @@ void CClient::Stop()
void CClient::Init()
{
// check if possible frame size factors are supported
const int iFraSizePreffered = SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_PREFERRED;
const int iFraSizeDefault = SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_DEFAULT;
const int iFraSizeSafe = SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_SAFE;
const int iFraSizePreffered = SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_PREFERRED;
const int iFraSizeDefault = SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_DEFAULT;
const int iFraSizeSafe = SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_SAFE;
bFraSiFactPrefSupported = ( Sound.Init ( iFraSizePreffered ) == iFraSizePreffered );
bFraSiFactDefSupported = ( Sound.Init ( iFraSizeDefault ) == iFraSizeDefault );
bFraSiFactSafeSupported = ( Sound.Init ( iFraSizeSafe ) == iFraSizeSafe );
// translate block size index in actual block size
const int iPrefMonoFrameSize = iSndCrdPrefFrameSizeFactor * SYSTEM_FRAME_SIZE_SAMPLES_SMALL;
const int iPrefMonoFrameSize = iSndCrdPrefFrameSizeFactor * SYSTEM_FRAME_SIZE_SAMPLES;
// get actual sound card buffer size using preferred size
iMonoBlockSizeSam = Sound.Init ( iPrefMonoFrameSize );
@ -686,12 +686,12 @@ void CClient::Init()
// Calculate the current sound card frame size factor. In case
// the current mono block size is not a multiple of the system
// frame size, we have to use a sound card conversion buffer.
if ( ( iMonoBlockSizeSam == ( SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_PREFERRED ) ) ||
( iMonoBlockSizeSam == ( SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_DEFAULT ) ) ||
( iMonoBlockSizeSam == ( SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_SAFE ) ) )
if ( ( iMonoBlockSizeSam == ( SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_PREFERRED ) ) ||
( iMonoBlockSizeSam == ( SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_DEFAULT ) ) ||
( iMonoBlockSizeSam == ( SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_SAFE ) ) )
{
// regular case: one of our predefined buffer sizes is available
iSndCrdFrameSizeFactor = iMonoBlockSizeSam / SYSTEM_FRAME_SIZE_SAMPLES_SMALL;
iSndCrdFrameSizeFactor = iMonoBlockSizeSam / SYSTEM_FRAME_SIZE_SAMPLES;
// no sound card conversion buffer required
bSndCrdConversionBufferRequired = false;
@ -715,7 +715,7 @@ void CClient::Init()
{
if ( iSndCardMonoBlockSizeSamConvBuff < DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES )
{
iMonoBlockSizeSam = SYSTEM_FRAME_SIZE_SAMPLES_SMALL;
iMonoBlockSizeSam = SYSTEM_FRAME_SIZE_SAMPLES;
eAudioCompressionType = CT_OPUS64;
}
else
@ -773,7 +773,7 @@ void CClient::Init()
}
else /* CT_OPUS64 */
{
iOPUSFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES_SMALL;
iOPUSFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES;
if ( eAudioChannelConf == CC_MONO )
{

View File

@ -347,14 +347,14 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
// set text for sound card buffer delay radio buttons
rbtBufferDelayPreferred->setText ( GenSndCrdBufferDelayString (
FRAME_SIZE_FACTOR_PREFERRED * SYSTEM_FRAME_SIZE_SAMPLES_SMALL,
FRAME_SIZE_FACTOR_PREFERRED * SYSTEM_FRAME_SIZE_SAMPLES,
", preferred" ) );
rbtBufferDelayDefault->setText ( GenSndCrdBufferDelayString (
FRAME_SIZE_FACTOR_DEFAULT * SYSTEM_FRAME_SIZE_SAMPLES_SMALL ) );
FRAME_SIZE_FACTOR_DEFAULT * SYSTEM_FRAME_SIZE_SAMPLES ) );
rbtBufferDelaySafe->setText ( GenSndCrdBufferDelayString (
FRAME_SIZE_FACTOR_SAFE * SYSTEM_FRAME_SIZE_SAMPLES_SMALL ) );
FRAME_SIZE_FACTOR_SAFE * SYSTEM_FRAME_SIZE_SAMPLES ) );
// sound card buffer delay inits
SndCrdBufferDelayButtonGroup.addButton ( rbtBufferDelayPreferred );
@ -472,9 +472,9 @@ void CClientSettingsDlg::UpdateSoundCardFrame()
const int iCurActualBufSize = pClient->GetSndCrdActualMonoBlSize();
// check which predefined size is used (it is possible that none is used)
const bool bPreferredChecked = ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_PREFERRED );
const bool bDefaultChecked = ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_DEFAULT );
const bool bSafeChecked = ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES_SMALL * FRAME_SIZE_FACTOR_SAFE );
const bool bPreferredChecked = ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_PREFERRED );
const bool bDefaultChecked = ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_DEFAULT );
const bool bSafeChecked = ( iCurActualBufSize == SYSTEM_FRAME_SIZE_SAMPLES * FRAME_SIZE_FACTOR_SAFE );
// Set radio buttons according to current value (To make it possible
// to have all radio buttons unchecked, we have to disable the

View File

@ -98,8 +98,8 @@ LED bar: lbr
// System block size, this is the block size on which the audio coder works.
// All other block sizes must be a multiple of this size.
// Note that the UpdateAutoSetting() function assumes a value of 128.
#define SYSTEM_FRAME_SIZE_SAMPLES_SMALL 64 // TODO this is temporary and shall be replaced by SYSTEM_FRAME_SIZE_SAMPLES later on
#define DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES ( 2 * SYSTEM_FRAME_SIZE_SAMPLES_SMALL )
#define SYSTEM_FRAME_SIZE_SAMPLES 64
#define DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES ( 2 * SYSTEM_FRAME_SIZE_SAMPLES )
// default server address
#define DEFAULT_SERVER_ADDRESS "jamulus.fischvolk.de"

View File

@ -118,7 +118,7 @@ int main ( int argc, char** argv )
"--fastupdate" ) )
{
bUseDoubleSystemFrameSize = false; // 64 samples frame size
tsConsole << "- using " << SYSTEM_FRAME_SIZE_SAMPLES_SMALL << " samples frame size mode" << endl;
tsConsole << "- using " << SYSTEM_FRAME_SIZE_SAMPLES << " samples frame size mode" << endl;
continue;
}

View File

@ -32,7 +32,7 @@ CHighPrecisionTimer::CHighPrecisionTimer ( const bool bNewUseDoubleSystemFrameSi
{
// add some error checking, the high precision timer implementation only
// supports 64 and 128 samples frame size at 48 kHz sampling rate
#if ( SYSTEM_FRAME_SIZE_SAMPLES_SMALL != 64 ) && ( DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES != 128 )
#if ( SYSTEM_FRAME_SIZE_SAMPLES != 64 ) && ( DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES != 128 )
# error "Only system frame size of 64 and 128 samples is supported by this module"
#endif
#if ( SYSTEM_SAMPLE_RATE_HZ != 48000 )
@ -127,7 +127,7 @@ CHighPrecisionTimer::CHighPrecisionTimer ( const bool bUseDoubleSystemFrameSize
}
else
{
iNsDelay = ( (uint64_t) SYSTEM_FRAME_SIZE_SAMPLES_SMALL * 1000000000 ) /
iNsDelay = ( (uint64_t) SYSTEM_FRAME_SIZE_SAMPLES * 1000000000 ) /
(uint64_t) SYSTEM_SAMPLE_RATE_HZ; // in ns
}
@ -267,7 +267,7 @@ CServer::CServer ( const int iNewMaxNumChan,
&iOpusError );
Opus64Mode[i] = opus_custom_mode_create ( SYSTEM_SAMPLE_RATE_HZ,
SYSTEM_FRAME_SIZE_SAMPLES_SMALL,
SYSTEM_FRAME_SIZE_SAMPLES,
&iOpusError );
// init audio encoders and decoders
@ -320,7 +320,7 @@ CServer::CServer ( const int iNewMaxNumChan,
}
else
{
iServerFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES_SMALL;
iServerFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES;
}
@ -953,7 +953,7 @@ JitterMeas.Measure();
}
else if ( vecAudioComprType[i] == CT_OPUS64 )
{
iClientFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES_SMALL;
iClientFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES;
if ( vecNumAudioChannels[i] == 1 )
{
@ -988,7 +988,7 @@ JitterMeas.Measure();
// is false and the Get() function is not called at all. Therefore if the buffer is not needed
// we do not spend any time in the function but go directly inside the if condition.
if ( ( vecUseDoubleSysFraSizeConvBuf[i] == 0 ) ||
!DoubleFrameSizeConvBufIn[iCurChanID].Get ( vecvecsData[i], SYSTEM_FRAME_SIZE_SAMPLES_SMALL * vecNumAudioChannels[i] ) )
!DoubleFrameSizeConvBufIn[iCurChanID].Get ( vecvecsData[i], SYSTEM_FRAME_SIZE_SAMPLES * vecNumAudioChannels[i] ) )
{
// get current number of OPUS coded bytes
const int iCeltNumCodedBytes = vecChannels[iCurChanID].GetNetwFrameSize();
@ -1028,7 +1028,7 @@ JitterMeas.Measure();
opus_custom_decode ( CurOpusDecoder,
pCurCodedData,
iCeltNumCodedBytes,
&vecvecsData[i][iB * SYSTEM_FRAME_SIZE_SAMPLES_SMALL * vecNumAudioChannels[i]],
&vecvecsData[i][iB * SYSTEM_FRAME_SIZE_SAMPLES * vecNumAudioChannels[i]],
iClientFrameSizeSamples );
}
}
@ -1038,7 +1038,7 @@ JitterMeas.Measure();
if ( vecUseDoubleSysFraSizeConvBuf[i] != 0 )
{
DoubleFrameSizeConvBufIn[iCurChanID].PutAll ( vecvecsData[i] );
DoubleFrameSizeConvBufIn[iCurChanID].Get ( vecvecsData[i], SYSTEM_FRAME_SIZE_SAMPLES_SMALL * vecNumAudioChannels[i] );
DoubleFrameSizeConvBufIn[iCurChanID].Get ( vecvecsData[i], SYSTEM_FRAME_SIZE_SAMPLES * vecNumAudioChannels[i] );
}
}
}
@ -1131,7 +1131,7 @@ JitterMeas.Measure();
}
else if ( vecAudioComprType[i] == CT_OPUS64 )
{
iClientFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES_SMALL;
iClientFrameSizeSamples = SYSTEM_FRAME_SIZE_SAMPLES;
if ( vecNumAudioChannels[i] == 1 )
{
@ -1153,7 +1153,7 @@ JitterMeas.Measure();
// is false and the Get() function is not called at all. Therefore if the buffer is not needed
// we do not spend any time in the function but go directly inside the if condition.
if ( ( vecUseDoubleSysFraSizeConvBuf[i] == 0 ) ||
DoubleFrameSizeConvBufOut[iCurChanID].Put ( vecsSendData, SYSTEM_FRAME_SIZE_SAMPLES_SMALL * vecNumAudioChannels[i] ) )
DoubleFrameSizeConvBufOut[iCurChanID].Put ( vecsSendData, SYSTEM_FRAME_SIZE_SAMPLES * vecNumAudioChannels[i] ) )
{
if ( vecUseDoubleSysFraSizeConvBuf[i] != 0 )
{
@ -1173,7 +1173,7 @@ opus_custom_encoder_ctl ( CurOpusEncoder,
OPUS_SET_BITRATE ( CalcBitRateBitsPerSecFromCodedBytes ( iCeltNumCodedBytes, iClientFrameSizeSamples ) ) );
opus_custom_encode ( CurOpusEncoder,
&vecsSendData[iB * SYSTEM_FRAME_SIZE_SAMPLES_SMALL * vecNumAudioChannels[i]],
&vecsSendData[iB * SYSTEM_FRAME_SIZE_SAMPLES * vecNumAudioChannels[i]],
iClientFrameSizeSamples,
&vecbyCodedData[0],
iCeltNumCodedBytes );