Chris@69: /*********************************************************************** Chris@69: Copyright (c) 2006-2011, Skype Limited. All rights reserved. Chris@69: Redistribution and use in source and binary forms, with or without Chris@69: modification, are permitted provided that the following conditions Chris@69: are met: Chris@69: - Redistributions of source code must retain the above copyright notice, Chris@69: this list of conditions and the following disclaimer. Chris@69: - Redistributions in binary form must reproduce the above copyright Chris@69: notice, this list of conditions and the following disclaimer in the Chris@69: documentation and/or other materials provided with the distribution. Chris@69: - Neither the name of Internet Society, IETF or IETF Trust, nor the Chris@69: names of specific contributors, may be used to endorse or promote Chris@69: products derived from this software without specific prior written Chris@69: permission. Chris@69: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" Chris@69: AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Chris@69: IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Chris@69: ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE Chris@69: LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR Chris@69: CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF Chris@69: SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS Chris@69: INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN Chris@69: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) Chris@69: ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE Chris@69: POSSIBILITY OF SUCH DAMAGE. Chris@69: ***********************************************************************/ Chris@69: Chris@69: #ifndef SILK_CONTROL_H Chris@69: #define SILK_CONTROL_H Chris@69: Chris@69: #include "typedef.h" Chris@69: Chris@69: #ifdef __cplusplus Chris@69: extern "C" Chris@69: { Chris@69: #endif Chris@69: Chris@69: /* Decoder API flags */ Chris@69: #define FLAG_DECODE_NORMAL 0 Chris@69: #define FLAG_PACKET_LOST 1 Chris@69: #define FLAG_DECODE_LBRR 2 Chris@69: Chris@69: /***********************************************/ Chris@69: /* Structure for controlling encoder operation */ Chris@69: /***********************************************/ Chris@69: typedef struct { Chris@69: /* I: Number of channels; 1/2 */ Chris@69: opus_int32 nChannelsAPI; Chris@69: Chris@69: /* I: Number of channels; 1/2 */ Chris@69: opus_int32 nChannelsInternal; Chris@69: Chris@69: /* I: Input signal sampling rate in Hertz; 8000/12000/16000/24000/32000/44100/48000 */ Chris@69: opus_int32 API_sampleRate; Chris@69: Chris@69: /* I: Maximum internal sampling rate in Hertz; 8000/12000/16000 */ Chris@69: opus_int32 maxInternalSampleRate; Chris@69: Chris@69: /* I: Minimum internal sampling rate in Hertz; 8000/12000/16000 */ Chris@69: opus_int32 minInternalSampleRate; Chris@69: Chris@69: /* I: Soft request for internal sampling rate in Hertz; 8000/12000/16000 */ Chris@69: opus_int32 desiredInternalSampleRate; Chris@69: Chris@69: /* I: Number of samples per packet in milliseconds; 10/20/40/60 */ Chris@69: opus_int payloadSize_ms; Chris@69: Chris@69: /* I: Bitrate during active speech in bits/second; internally limited */ Chris@69: opus_int32 bitRate; Chris@69: Chris@69: /* I: Uplink packet loss in percent (0-100) */ Chris@69: opus_int packetLossPercentage; Chris@69: Chris@69: /* I: Complexity mode; 0 is lowest, 10 is highest complexity */ Chris@69: opus_int complexity; Chris@69: Chris@69: /* I: Flag to enable in-band Forward Error Correction (FEC); 0/1 */ Chris@69: opus_int useInBandFEC; Chris@69: Chris@69: /* I: Flag to actually code in-band Forward Error Correction (FEC) in the current packet; 0/1 */ Chris@69: opus_int LBRR_coded; Chris@69: Chris@69: /* I: Flag to enable discontinuous transmission (DTX); 0/1 */ Chris@69: opus_int useDTX; Chris@69: Chris@69: /* I: Flag to use constant bitrate */ Chris@69: opus_int useCBR; Chris@69: Chris@69: /* I: Maximum number of bits allowed for the frame */ Chris@69: opus_int maxBits; Chris@69: Chris@69: /* I: Causes a smooth downmix to mono */ Chris@69: opus_int toMono; Chris@69: Chris@69: /* I: Opus encoder is allowing us to switch bandwidth */ Chris@69: opus_int opusCanSwitch; Chris@69: Chris@69: /* I: Make frames as independent as possible (but still use LPC) */ Chris@69: opus_int reducedDependency; Chris@69: Chris@69: /* O: Internal sampling rate used, in Hertz; 8000/12000/16000 */ Chris@69: opus_int32 internalSampleRate; Chris@69: Chris@69: /* O: Flag that bandwidth switching is allowed (because low voice activity) */ Chris@69: opus_int allowBandwidthSwitch; Chris@69: Chris@69: /* O: Flag that SILK runs in WB mode without variable LP filter (use for switching between WB/SWB/FB) */ Chris@69: opus_int inWBmodeWithoutVariableLP; Chris@69: Chris@69: /* O: Stereo width */ Chris@69: opus_int stereoWidth_Q14; Chris@69: Chris@69: /* O: Tells the Opus encoder we're ready to switch */ Chris@69: opus_int switchReady; Chris@69: Chris@69: /* O: SILK Signal type */ Chris@69: opus_int signalType; Chris@69: Chris@69: /* O: SILK offset (dithering) */ Chris@69: opus_int offset; Chris@69: } silk_EncControlStruct; Chris@69: Chris@69: /**************************************************************************/ Chris@69: /* Structure for controlling decoder operation and reading decoder status */ Chris@69: /**************************************************************************/ Chris@69: typedef struct { Chris@69: /* I: Number of channels; 1/2 */ Chris@69: opus_int32 nChannelsAPI; Chris@69: Chris@69: /* I: Number of channels; 1/2 */ Chris@69: opus_int32 nChannelsInternal; Chris@69: Chris@69: /* I: Output signal sampling rate in Hertz; 8000/12000/16000/24000/32000/44100/48000 */ Chris@69: opus_int32 API_sampleRate; Chris@69: Chris@69: /* I: Internal sampling rate used, in Hertz; 8000/12000/16000 */ Chris@69: opus_int32 internalSampleRate; Chris@69: Chris@69: /* I: Number of samples per packet in milliseconds; 10/20/40/60 */ Chris@69: opus_int payloadSize_ms; Chris@69: Chris@69: /* O: Pitch lag of previous frame (0 if unvoiced), measured in samples at 48 kHz */ Chris@69: opus_int prevPitchLag; Chris@69: } silk_DecControlStruct; Chris@69: Chris@69: #ifdef __cplusplus Chris@69: } Chris@69: #endif Chris@69: Chris@69: #endif