fixes by Michael Gorbovitski (mickg100) for OPUS performance improvement -> Thank you!

This commit is contained in:
Volker Fischer 2013-02-20 17:22:04 +00:00
parent 2821dc78fe
commit 05a71cd572
3 changed files with 36 additions and 5 deletions

View file

@ -83,6 +83,14 @@ 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
opus_custom_encoder_ctl ( OpusEncoderMono,
OPUS_SET_APPLICATION ( OPUS_APPLICATION_RESTRICTED_LOWDELAY ) );
#ifdef USE_LOW_COMPLEXITY_CELT_ENC #ifdef USE_LOW_COMPLEXITY_CELT_ENC
// set encoder low complexity // set encoder low complexity
opus_custom_encoder_ctl ( OpusEncoderMono, opus_custom_encoder_ctl ( OpusEncoderMono,
@ -114,6 +122,14 @@ 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
opus_custom_encoder_ctl ( OpusEncoderStereo,
OPUS_SET_APPLICATION ( OPUS_APPLICATION_RESTRICTED_LOWDELAY ) );
#ifdef USE_LOW_COMPLEXITY_CELT_ENC #ifdef USE_LOW_COMPLEXITY_CELT_ENC
// set encoder low complexity // set encoder low complexity
opus_custom_encoder_ctl ( OpusEncoderStereo, opus_custom_encoder_ctl ( OpusEncoderStereo,
@ -354,13 +370,9 @@ void CClient::SetSndCrdPrefFrameSizeFactor ( const int iNewFactor )
// #### COMPATIBILITY OLD VERSION, TO BE REMOVED #### // #### COMPATIBILITY OLD VERSION, TO BE REMOVED ####
void CClient::OnOpusSupported() void CClient::OnOpusSupported()
{ {
// TODO do NOT switch to OPUS since the PLC seems to be much worse in OPUS
// compared to the good old CELT version
// -> find out why this is the case and as soon as the issue is solved,
// enable OPUS again...
if ( eAudioCompressionType != CT_OPUS ) if ( eAudioCompressionType != CT_OPUS )
{ {
// SetAudoCompressiontype ( CT_OPUS ); SetAudoCompressiontype ( CT_OPUS );
} }
} }

View file

@ -115,6 +115,9 @@ LED bar: lbr
// low complexity CELT encoder (if defined) // low complexity CELT encoder (if defined)
#define USE_LOW_COMPLEXITY_CELT_ENC #define USE_LOW_COMPLEXITY_CELT_ENC
// percentage of expected packet loss percentage in the OPUS encoder
#define OPUS_EXPECTED_PACKET_LOSS_PERC 10
// define the minimum allowed number of coded bytes for CELT (the encoder // define the minimum allowed number of coded bytes for CELT (the encoder
// gets in trouble if the value is too low) // gets in trouble if the value is too low)
#define CELT_MINIMUM_NUM_BYTES 10 #define CELT_MINIMUM_NUM_BYTES 10

View file

@ -223,6 +223,14 @@ CServer::CServer ( const int iNewNumChan,
opus_custom_encoder_ctl ( OpusEncoderMono[i], opus_custom_encoder_ctl ( OpusEncoderMono[i],
OPUS_SET_VBR ( 0 ) ); OPUS_SET_VBR ( 0 ) );
// we expect packet loss, tell the encoder about it
opus_custom_encoder_ctl ( OpusEncoderMono[i],
OPUS_SET_PACKET_LOSS_PERC ( OPUS_EXPECTED_PACKET_LOSS_PERC ) );
// we want as low delay as possible
opus_custom_encoder_ctl ( OpusEncoderMono[i],
OPUS_SET_APPLICATION ( OPUS_APPLICATION_RESTRICTED_LOWDELAY ) );
#ifdef USE_LOW_COMPLEXITY_CELT_ENC #ifdef USE_LOW_COMPLEXITY_CELT_ENC
// set encoder low complexity // set encoder low complexity
opus_custom_encoder_ctl ( OpusEncoderMono[i], opus_custom_encoder_ctl ( OpusEncoderMono[i],
@ -254,6 +262,14 @@ CServer::CServer ( const int iNewNumChan,
opus_custom_encoder_ctl ( OpusEncoderStereo[i], opus_custom_encoder_ctl ( OpusEncoderStereo[i],
OPUS_SET_VBR ( 0 ) ); OPUS_SET_VBR ( 0 ) );
// we expect packet loss, tell the encoder about it
opus_custom_encoder_ctl ( OpusEncoderStereo[i],
OPUS_SET_PACKET_LOSS_PERC ( OPUS_EXPECTED_PACKET_LOSS_PERC ) );
// we want as low delay as possible
opus_custom_encoder_ctl ( OpusEncoderStereo[i],
OPUS_SET_APPLICATION ( OPUS_APPLICATION_RESTRICTED_LOWDELAY ) );
#ifdef USE_LOW_COMPLEXITY_CELT_ENC #ifdef USE_LOW_COMPLEXITY_CELT_ENC
// set encoder low complexity // set encoder low complexity
opus_custom_encoder_ctl ( OpusEncoderStereo[i], opus_custom_encoder_ctl ( OpusEncoderStereo[i],