media/libopus/silk/tuning_parameters.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/libopus/silk/tuning_parameters.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,171 @@
     1.4 +/***********************************************************************
     1.5 +Copyright (c) 2006-2011, Skype Limited. All rights reserved.
     1.6 +Redistribution and use in source and binary forms, with or without
     1.7 +modification, are permitted provided that the following conditions
     1.8 +are met:
     1.9 +- Redistributions of source code must retain the above copyright notice,
    1.10 +this list of conditions and the following disclaimer.
    1.11 +- Redistributions in binary form must reproduce the above copyright
    1.12 +notice, this list of conditions and the following disclaimer in the
    1.13 +documentation and/or other materials provided with the distribution.
    1.14 +- Neither the name of Internet Society, IETF or IETF Trust, nor the
    1.15 +names of specific contributors, may be used to endorse or promote
    1.16 +products derived from this software without specific prior written
    1.17 +permission.
    1.18 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    1.19 +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1.20 +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    1.21 +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
    1.22 +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    1.23 +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    1.24 +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    1.25 +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    1.26 +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    1.27 +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    1.28 +POSSIBILITY OF SUCH DAMAGE.
    1.29 +***********************************************************************/
    1.30 +
    1.31 +#ifndef SILK_TUNING_PARAMETERS_H
    1.32 +#define SILK_TUNING_PARAMETERS_H
    1.33 +
    1.34 +#ifdef __cplusplus
    1.35 +extern "C"
    1.36 +{
    1.37 +#endif
    1.38 +
    1.39 +/* Decay time for bitreservoir */
    1.40 +#define BITRESERVOIR_DECAY_TIME_MS                      500
    1.41 +
    1.42 +/*******************/
    1.43 +/* Pitch estimator */
    1.44 +/*******************/
    1.45 +
    1.46 +/* Level of noise floor for whitening filter LPC analysis in pitch analysis */
    1.47 +#define FIND_PITCH_WHITE_NOISE_FRACTION                 1e-3f
    1.48 +
    1.49 +/* Bandwidth expansion for whitening filter in pitch analysis */
    1.50 +#define FIND_PITCH_BANDWIDTH_EXPANSION                  0.99f
    1.51 +
    1.52 +/*********************/
    1.53 +/* Linear prediction */
    1.54 +/*********************/
    1.55 +
    1.56 +/* LPC analysis regularization */
    1.57 +#define FIND_LPC_COND_FAC                               1e-5f
    1.58 +
    1.59 +/* LTP analysis defines */
    1.60 +#define FIND_LTP_COND_FAC                               1e-5f
    1.61 +#define LTP_DAMPING                                     0.05f
    1.62 +#define LTP_SMOOTHING                                   0.1f
    1.63 +
    1.64 +/* LTP quantization settings */
    1.65 +#define MU_LTP_QUANT_NB                                 0.03f
    1.66 +#define MU_LTP_QUANT_MB                                 0.025f
    1.67 +#define MU_LTP_QUANT_WB                                 0.02f
    1.68 +
    1.69 +/* Max cumulative LTP gain */
    1.70 +#define MAX_SUM_LOG_GAIN_DB								250.0f
    1.71 +
    1.72 +/***********************/
    1.73 +/* High pass filtering */
    1.74 +/***********************/
    1.75 +
    1.76 +/* Smoothing parameters for low end of pitch frequency range estimation */
    1.77 +#define VARIABLE_HP_SMTH_COEF1                          0.1f
    1.78 +#define VARIABLE_HP_SMTH_COEF2                          0.015f
    1.79 +#define VARIABLE_HP_MAX_DELTA_FREQ                      0.4f
    1.80 +
    1.81 +/* Min and max cut-off frequency values (-3 dB points) */
    1.82 +#define VARIABLE_HP_MIN_CUTOFF_HZ                       60
    1.83 +#define VARIABLE_HP_MAX_CUTOFF_HZ                       100
    1.84 +
    1.85 +/***********/
    1.86 +/* Various */
    1.87 +/***********/
    1.88 +
    1.89 +/* VAD threshold */
    1.90 +#define SPEECH_ACTIVITY_DTX_THRES                       0.05f
    1.91 +
    1.92 +/* Speech Activity LBRR enable threshold */
    1.93 +#define LBRR_SPEECH_ACTIVITY_THRES                      0.3f
    1.94 +
    1.95 +/*************************/
    1.96 +/* Perceptual parameters */
    1.97 +/*************************/
    1.98 +
    1.99 +/* reduction in coding SNR during low speech activity */
   1.100 +#define BG_SNR_DECR_dB                                  2.0f
   1.101 +
   1.102 +/* factor for reducing quantization noise during voiced speech */
   1.103 +#define HARM_SNR_INCR_dB                                2.0f
   1.104 +
   1.105 +/* factor for reducing quantization noise for unvoiced sparse signals */
   1.106 +#define SPARSE_SNR_INCR_dB                              2.0f
   1.107 +
   1.108 +/* threshold for sparseness measure above which to use lower quantization offset during unvoiced */
   1.109 +#define SPARSENESS_THRESHOLD_QNT_OFFSET                 0.75f
   1.110 +
   1.111 +/* warping control */
   1.112 +#define WARPING_MULTIPLIER                              0.015f
   1.113 +
   1.114 +/* fraction added to first autocorrelation value */
   1.115 +#define SHAPE_WHITE_NOISE_FRACTION                      5e-5f
   1.116 +
   1.117 +/* noise shaping filter chirp factor */
   1.118 +#define BANDWIDTH_EXPANSION                             0.95f
   1.119 +
   1.120 +/* difference between chirp factors for analysis and synthesis noise shaping filters at low bitrates */
   1.121 +#define LOW_RATE_BANDWIDTH_EXPANSION_DELTA              0.01f
   1.122 +
   1.123 +/* extra harmonic boosting (signal shaping) at low bitrates */
   1.124 +#define LOW_RATE_HARMONIC_BOOST                         0.1f
   1.125 +
   1.126 +/* extra harmonic boosting (signal shaping) for noisy input signals */
   1.127 +#define LOW_INPUT_QUALITY_HARMONIC_BOOST                0.1f
   1.128 +
   1.129 +/* harmonic noise shaping */
   1.130 +#define HARMONIC_SHAPING                                0.3f
   1.131 +
   1.132 +/* extra harmonic noise shaping for high bitrates or noisy input */
   1.133 +#define HIGH_RATE_OR_LOW_QUALITY_HARMONIC_SHAPING       0.2f
   1.134 +
   1.135 +/* parameter for shaping noise towards higher frequencies */
   1.136 +#define HP_NOISE_COEF                                   0.25f
   1.137 +
   1.138 +/* parameter for shaping noise even more towards higher frequencies during voiced speech */
   1.139 +#define HARM_HP_NOISE_COEF                              0.35f
   1.140 +
   1.141 +/* parameter for applying a high-pass tilt to the input signal */
   1.142 +#define INPUT_TILT                                      0.05f
   1.143 +
   1.144 +/* parameter for extra high-pass tilt to the input signal at high rates */
   1.145 +#define HIGH_RATE_INPUT_TILT                            0.1f
   1.146 +
   1.147 +/* parameter for reducing noise at the very low frequencies */
   1.148 +#define LOW_FREQ_SHAPING                                4.0f
   1.149 +
   1.150 +/* less reduction of noise at the very low frequencies for signals with low SNR at low frequencies */
   1.151 +#define LOW_QUALITY_LOW_FREQ_SHAPING_DECR               0.5f
   1.152 +
   1.153 +/* subframe smoothing coefficient for HarmBoost, HarmShapeGain, Tilt (lower -> more smoothing) */
   1.154 +#define SUBFR_SMTH_COEF                                 0.4f
   1.155 +
   1.156 +/* parameters defining the R/D tradeoff in the residual quantizer */
   1.157 +#define LAMBDA_OFFSET                                   1.2f
   1.158 +#define LAMBDA_SPEECH_ACT                               -0.2f
   1.159 +#define LAMBDA_DELAYED_DECISIONS                        -0.05f
   1.160 +#define LAMBDA_INPUT_QUALITY                            -0.1f
   1.161 +#define LAMBDA_CODING_QUALITY                           -0.2f
   1.162 +#define LAMBDA_QUANT_OFFSET                             0.8f
   1.163 +
   1.164 +/* Compensation in bitrate calculations for 10 ms modes */
   1.165 +#define REDUCE_BITRATE_10_MS_BPS                        2200
   1.166 +
   1.167 +/* Maximum time before allowing a bandwidth transition */
   1.168 +#define MAX_BANDWIDTH_SWITCH_DELAY_MS                   5000
   1.169 +
   1.170 +#ifdef __cplusplus
   1.171 +}
   1.172 +#endif
   1.173 +
   1.174 +#endif /* SILK_TUNING_PARAMETERS_H */

mercurial