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_TUNING_PARAMETERS_H Chris@69: #define SILK_TUNING_PARAMETERS_H Chris@69: Chris@69: #ifdef __cplusplus Chris@69: extern "C" Chris@69: { Chris@69: #endif Chris@69: Chris@69: /* Decay time for bitreservoir */ Chris@69: #define BITRESERVOIR_DECAY_TIME_MS 500 Chris@69: Chris@69: /*******************/ Chris@69: /* Pitch estimator */ Chris@69: /*******************/ Chris@69: Chris@69: /* Level of noise floor for whitening filter LPC analysis in pitch analysis */ Chris@69: #define FIND_PITCH_WHITE_NOISE_FRACTION 1e-3f Chris@69: Chris@69: /* Bandwidth expansion for whitening filter in pitch analysis */ Chris@69: #define FIND_PITCH_BANDWIDTH_EXPANSION 0.99f Chris@69: Chris@69: /*********************/ Chris@69: /* Linear prediction */ Chris@69: /*********************/ Chris@69: Chris@69: /* LPC analysis regularization */ Chris@69: #define FIND_LPC_COND_FAC 1e-5f Chris@69: Chris@69: /* Max cumulative LTP gain */ Chris@69: #define MAX_SUM_LOG_GAIN_DB 250.0f Chris@69: Chris@69: /* LTP analysis defines */ Chris@69: #define LTP_CORR_INV_MAX 0.03f Chris@69: Chris@69: /***********************/ Chris@69: /* High pass filtering */ Chris@69: /***********************/ Chris@69: Chris@69: /* Smoothing parameters for low end of pitch frequency range estimation */ Chris@69: #define VARIABLE_HP_SMTH_COEF1 0.1f Chris@69: #define VARIABLE_HP_SMTH_COEF2 0.015f Chris@69: #define VARIABLE_HP_MAX_DELTA_FREQ 0.4f Chris@69: Chris@69: /* Min and max cut-off frequency values (-3 dB points) */ Chris@69: #define VARIABLE_HP_MIN_CUTOFF_HZ 60 Chris@69: #define VARIABLE_HP_MAX_CUTOFF_HZ 100 Chris@69: Chris@69: /***********/ Chris@69: /* Various */ Chris@69: /***********/ Chris@69: Chris@69: /* VAD threshold */ Chris@69: #define SPEECH_ACTIVITY_DTX_THRES 0.05f Chris@69: Chris@69: /* Speech Activity LBRR enable threshold */ Chris@69: #define LBRR_SPEECH_ACTIVITY_THRES 0.3f Chris@69: Chris@69: /*************************/ Chris@69: /* Perceptual parameters */ Chris@69: /*************************/ Chris@69: Chris@69: /* reduction in coding SNR during low speech activity */ Chris@69: #define BG_SNR_DECR_dB 2.0f Chris@69: Chris@69: /* factor for reducing quantization noise during voiced speech */ Chris@69: #define HARM_SNR_INCR_dB 2.0f Chris@69: Chris@69: /* factor for reducing quantization noise for unvoiced sparse signals */ Chris@69: #define SPARSE_SNR_INCR_dB 2.0f Chris@69: Chris@69: /* threshold for sparseness measure above which to use lower quantization offset during unvoiced */ Chris@69: #define ENERGY_VARIATION_THRESHOLD_QNT_OFFSET 0.6f Chris@69: Chris@69: /* warping control */ Chris@69: #define WARPING_MULTIPLIER 0.015f Chris@69: Chris@69: /* fraction added to first autocorrelation value */ Chris@69: #define SHAPE_WHITE_NOISE_FRACTION 3e-5f Chris@69: Chris@69: /* noise shaping filter chirp factor */ Chris@69: #define BANDWIDTH_EXPANSION 0.94f Chris@69: Chris@69: /* harmonic noise shaping */ Chris@69: #define HARMONIC_SHAPING 0.3f Chris@69: Chris@69: /* extra harmonic noise shaping for high bitrates or noisy input */ Chris@69: #define HIGH_RATE_OR_LOW_QUALITY_HARMONIC_SHAPING 0.2f Chris@69: Chris@69: /* parameter for shaping noise towards higher frequencies */ Chris@69: #define HP_NOISE_COEF 0.25f Chris@69: Chris@69: /* parameter for shaping noise even more towards higher frequencies during voiced speech */ Chris@69: #define HARM_HP_NOISE_COEF 0.35f Chris@69: Chris@69: /* parameter for applying a high-pass tilt to the input signal */ Chris@69: #define INPUT_TILT 0.05f Chris@69: Chris@69: /* parameter for extra high-pass tilt to the input signal at high rates */ Chris@69: #define HIGH_RATE_INPUT_TILT 0.1f Chris@69: Chris@69: /* parameter for reducing noise at the very low frequencies */ Chris@69: #define LOW_FREQ_SHAPING 4.0f Chris@69: Chris@69: /* less reduction of noise at the very low frequencies for signals with low SNR at low frequencies */ Chris@69: #define LOW_QUALITY_LOW_FREQ_SHAPING_DECR 0.5f Chris@69: Chris@69: /* subframe smoothing coefficient for HarmBoost, HarmShapeGain, Tilt (lower -> more smoothing) */ Chris@69: #define SUBFR_SMTH_COEF 0.4f Chris@69: Chris@69: /* parameters defining the R/D tradeoff in the residual quantizer */ Chris@69: #define LAMBDA_OFFSET 1.2f Chris@69: #define LAMBDA_SPEECH_ACT -0.2f Chris@69: #define LAMBDA_DELAYED_DECISIONS -0.05f Chris@69: #define LAMBDA_INPUT_QUALITY -0.1f Chris@69: #define LAMBDA_CODING_QUALITY -0.2f Chris@69: #define LAMBDA_QUANT_OFFSET 0.8f Chris@69: Chris@69: /* Compensation in bitrate calculations for 10 ms modes */ Chris@69: #define REDUCE_BITRATE_10_MS_BPS 2200 Chris@69: Chris@69: /* Maximum time before allowing a bandwidth transition */ Chris@69: #define MAX_BANDWIDTH_SWITCH_DELAY_MS 5000 Chris@69: Chris@69: #ifdef __cplusplus Chris@69: } Chris@69: #endif Chris@69: Chris@69: #endif /* SILK_TUNING_PARAMETERS_H */