- removed OPUS_EXPECTED_PACKET_LOSS_PERC because it seems not to be used in the CELT decoder (just for SILK)

- fix for loud noise at the beginning of a connection when a new server (supporting OPUS) is connected -> Still some noise left because of weird PLC effects of the OPUS codec
This commit is contained in:
Volker Fischer 2013-03-10 08:17:25 +00:00
parent b69e8a3028
commit cf0c9d192d

View file

@ -85,10 +85,6 @@ CClient::CClient ( const quint16 iPortNumber ) :
opus_custom_encoder_ctl ( OpusEncoderMono, opus_custom_encoder_ctl ( OpusEncoderMono,
OPUS_SET_VBR ( 0 ) ); OPUS_SET_VBR ( 0 ) );
// we expect packet loss, tell the encoder about it
opus_custom_encoder_ctl ( OpusEncoderMono,
OPUS_SET_PACKET_LOSS_PERC ( OPUS_EXPECTED_PACKET_LOSS_PERC ) );
// we want as low delay as possible // we want as low delay as possible
opus_custom_encoder_ctl ( OpusEncoderMono, opus_custom_encoder_ctl ( OpusEncoderMono,
OPUS_SET_APPLICATION ( OPUS_APPLICATION_RESTRICTED_LOWDELAY ) ); OPUS_SET_APPLICATION ( OPUS_APPLICATION_RESTRICTED_LOWDELAY ) );
@ -124,10 +120,6 @@ CClient::CClient ( const quint16 iPortNumber ) :
opus_custom_encoder_ctl ( OpusEncoderStereo, opus_custom_encoder_ctl ( OpusEncoderStereo,
OPUS_SET_VBR ( 0 ) ); OPUS_SET_VBR ( 0 ) );
// we expect packet loss, tell the encoder about it
opus_custom_encoder_ctl ( OpusEncoderStereo,
OPUS_SET_PACKET_LOSS_PERC ( OPUS_EXPECTED_PACKET_LOSS_PERC ) );
// we want as low delay as possible // we want as low delay as possible
opus_custom_encoder_ctl ( OpusEncoderStereo, opus_custom_encoder_ctl ( OpusEncoderStereo,
OPUS_SET_APPLICATION ( OPUS_APPLICATION_RESTRICTED_LOWDELAY ) ); OPUS_SET_APPLICATION ( OPUS_APPLICATION_RESTRICTED_LOWDELAY ) );
@ -376,6 +368,9 @@ void CClient::OnOpusSupported()
{ {
SetAudoCompressiontype ( CT_OPUS ); SetAudoCompressiontype ( CT_OPUS );
} }
// inform the GUI about the change of the network rate
emit UpstreamRateChanged();
} }
// #### COMPATIBILITY OLD VERSION, TO BE REMOVED #### // #### COMPATIBILITY OLD VERSION, TO BE REMOVED ####
@ -724,22 +719,50 @@ void CClient::Init()
{ {
if ( bUseStereo ) if ( bUseStereo )
{ {
iCeltNumCodedBytes = CELT_NUM_BYTES_STEREO_HIGH_QUALITY; if ( eAudioCompressionType == CT_CELT )
{
iCeltNumCodedBytes = CELT_NUM_BYTES_STEREO_HIGH_QUALITY;
}
else
{
iCeltNumCodedBytes = OPUS_NUM_BYTES_STEREO_HIGH_QUALITY;
}
} }
else else
{ {
iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_HIGH_QUALITY; if ( eAudioCompressionType == CT_CELT )
{
iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_HIGH_QUALITY;
}
else
{
iCeltNumCodedBytes = OPUS_NUM_BYTES_MONO_HIGH_QUALITY;
}
} }
} }
else else
{ {
if ( bUseStereo ) if ( bUseStereo )
{ {
iCeltNumCodedBytes = CELT_NUM_BYTES_STEREO_NORMAL_QUALITY; if ( eAudioCompressionType == CT_CELT )
{
iCeltNumCodedBytes = CELT_NUM_BYTES_STEREO_NORMAL_QUALITY;
}
else
{
iCeltNumCodedBytes = OPUS_NUM_BYTES_STEREO_NORMAL_QUALITY;
}
} }
else else
{ {
iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_NORMAL_QUALITY; if ( eAudioCompressionType == CT_CELT )
{
iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_NORMAL_QUALITY;
}
else
{
iCeltNumCodedBytes = OPUS_NUM_BYTES_MONO_NORMAL_QUALITY;
}
} }
} }
vecCeltData.Init ( iCeltNumCodedBytes ); vecCeltData.Init ( iCeltNumCodedBytes );