diff --git a/src/client.cpp b/src/client.cpp index 60c2090f..6ad55194 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -48,6 +48,12 @@ CClient::CClient ( const quint16 iPortNumber ) : CeltEncoder = celt_encoder_create ( CeltMode ); CeltDecoder = celt_decoder_create ( CeltMode ); +#ifdef USE_LOW_COMPLEXITY_CELT_ENC + // set encoder low complexity + celt_encoder_ctl(CeltEncoder, + CELT_SET_COMPLEXITY_REQUEST, celt_int32_t ( 1 ) ); +#endif + // connections ------------------------------------------------------------- // connection for protocol diff --git a/src/global.h b/src/global.h index 92e9955a..5cc44b4c 100755 --- a/src/global.h +++ b/src/global.h @@ -73,6 +73,9 @@ #define FRAME_SIZE_FACTOR_DEFAULT 2 // 256 (for frame size 128) #define FRAME_SIZE_FACTOR_SAFE 4 // 512 (for frame size 128) +// low complexity CELT encoder (if defined) +#define USE_LOW_COMPLEXITY_CELT_ENC + // define the maximum mono audio buffer size at a sample rate // of 48 kHz, this is important for defining the maximum number // of bytes to be expected from the network interface diff --git a/src/server.cpp b/src/server.cpp index f39da92c..b67c4063 100755 --- a/src/server.cpp +++ b/src/server.cpp @@ -122,6 +122,12 @@ CServer::CServer ( const QString& strLoggingFileName, CeltEncoder[i] = celt_encoder_create ( CeltMode[i] ); CeltDecoder[i] = celt_decoder_create ( CeltMode[i] ); + +#ifdef USE_LOW_COMPLEXITY_CELT_ENC + // set encoder low complexity + celt_encoder_ctl(CeltEncoder[i], + CELT_SET_COMPLEXITY_REQUEST, celt_int32_t ( 1 ) ); +#endif } // define colors for chat window identifiers