annotate src/opus-1.3/silk/tuning_parameters.h @ 79:91c729825bca pa_catalina

Update build for AUDIO_COMPONENT_FIX
author Chris Cannam
date Wed, 30 Oct 2019 12:40:34 +0000
parents 7aeed7906520
children
rev   line source
Chris@69 1 /***********************************************************************
Chris@69 2 Copyright (c) 2006-2011, Skype Limited. All rights reserved.
Chris@69 3 Redistribution and use in source and binary forms, with or without
Chris@69 4 modification, are permitted provided that the following conditions
Chris@69 5 are met:
Chris@69 6 - Redistributions of source code must retain the above copyright notice,
Chris@69 7 this list of conditions and the following disclaimer.
Chris@69 8 - Redistributions in binary form must reproduce the above copyright
Chris@69 9 notice, this list of conditions and the following disclaimer in the
Chris@69 10 documentation and/or other materials provided with the distribution.
Chris@69 11 - Neither the name of Internet Society, IETF or IETF Trust, nor the
Chris@69 12 names of specific contributors, may be used to endorse or promote
Chris@69 13 products derived from this software without specific prior written
Chris@69 14 permission.
Chris@69 15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Chris@69 16 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Chris@69 17 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Chris@69 18 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
Chris@69 19 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
Chris@69 20 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
Chris@69 21 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Chris@69 22 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
Chris@69 23 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
Chris@69 24 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Chris@69 25 POSSIBILITY OF SUCH DAMAGE.
Chris@69 26 ***********************************************************************/
Chris@69 27
Chris@69 28 #ifndef SILK_TUNING_PARAMETERS_H
Chris@69 29 #define SILK_TUNING_PARAMETERS_H
Chris@69 30
Chris@69 31 #ifdef __cplusplus
Chris@69 32 extern "C"
Chris@69 33 {
Chris@69 34 #endif
Chris@69 35
Chris@69 36 /* Decay time for bitreservoir */
Chris@69 37 #define BITRESERVOIR_DECAY_TIME_MS 500
Chris@69 38
Chris@69 39 /*******************/
Chris@69 40 /* Pitch estimator */
Chris@69 41 /*******************/
Chris@69 42
Chris@69 43 /* Level of noise floor for whitening filter LPC analysis in pitch analysis */
Chris@69 44 #define FIND_PITCH_WHITE_NOISE_FRACTION 1e-3f
Chris@69 45
Chris@69 46 /* Bandwidth expansion for whitening filter in pitch analysis */
Chris@69 47 #define FIND_PITCH_BANDWIDTH_EXPANSION 0.99f
Chris@69 48
Chris@69 49 /*********************/
Chris@69 50 /* Linear prediction */
Chris@69 51 /*********************/
Chris@69 52
Chris@69 53 /* LPC analysis regularization */
Chris@69 54 #define FIND_LPC_COND_FAC 1e-5f
Chris@69 55
Chris@69 56 /* Max cumulative LTP gain */
Chris@69 57 #define MAX_SUM_LOG_GAIN_DB 250.0f
Chris@69 58
Chris@69 59 /* LTP analysis defines */
Chris@69 60 #define LTP_CORR_INV_MAX 0.03f
Chris@69 61
Chris@69 62 /***********************/
Chris@69 63 /* High pass filtering */
Chris@69 64 /***********************/
Chris@69 65
Chris@69 66 /* Smoothing parameters for low end of pitch frequency range estimation */
Chris@69 67 #define VARIABLE_HP_SMTH_COEF1 0.1f
Chris@69 68 #define VARIABLE_HP_SMTH_COEF2 0.015f
Chris@69 69 #define VARIABLE_HP_MAX_DELTA_FREQ 0.4f
Chris@69 70
Chris@69 71 /* Min and max cut-off frequency values (-3 dB points) */
Chris@69 72 #define VARIABLE_HP_MIN_CUTOFF_HZ 60
Chris@69 73 #define VARIABLE_HP_MAX_CUTOFF_HZ 100
Chris@69 74
Chris@69 75 /***********/
Chris@69 76 /* Various */
Chris@69 77 /***********/
Chris@69 78
Chris@69 79 /* VAD threshold */
Chris@69 80 #define SPEECH_ACTIVITY_DTX_THRES 0.05f
Chris@69 81
Chris@69 82 /* Speech Activity LBRR enable threshold */
Chris@69 83 #define LBRR_SPEECH_ACTIVITY_THRES 0.3f
Chris@69 84
Chris@69 85 /*************************/
Chris@69 86 /* Perceptual parameters */
Chris@69 87 /*************************/
Chris@69 88
Chris@69 89 /* reduction in coding SNR during low speech activity */
Chris@69 90 #define BG_SNR_DECR_dB 2.0f
Chris@69 91
Chris@69 92 /* factor for reducing quantization noise during voiced speech */
Chris@69 93 #define HARM_SNR_INCR_dB 2.0f
Chris@69 94
Chris@69 95 /* factor for reducing quantization noise for unvoiced sparse signals */
Chris@69 96 #define SPARSE_SNR_INCR_dB 2.0f
Chris@69 97
Chris@69 98 /* threshold for sparseness measure above which to use lower quantization offset during unvoiced */
Chris@69 99 #define ENERGY_VARIATION_THRESHOLD_QNT_OFFSET 0.6f
Chris@69 100
Chris@69 101 /* warping control */
Chris@69 102 #define WARPING_MULTIPLIER 0.015f
Chris@69 103
Chris@69 104 /* fraction added to first autocorrelation value */
Chris@69 105 #define SHAPE_WHITE_NOISE_FRACTION 3e-5f
Chris@69 106
Chris@69 107 /* noise shaping filter chirp factor */
Chris@69 108 #define BANDWIDTH_EXPANSION 0.94f
Chris@69 109
Chris@69 110 /* harmonic noise shaping */
Chris@69 111 #define HARMONIC_SHAPING 0.3f
Chris@69 112
Chris@69 113 /* extra harmonic noise shaping for high bitrates or noisy input */
Chris@69 114 #define HIGH_RATE_OR_LOW_QUALITY_HARMONIC_SHAPING 0.2f
Chris@69 115
Chris@69 116 /* parameter for shaping noise towards higher frequencies */
Chris@69 117 #define HP_NOISE_COEF 0.25f
Chris@69 118
Chris@69 119 /* parameter for shaping noise even more towards higher frequencies during voiced speech */
Chris@69 120 #define HARM_HP_NOISE_COEF 0.35f
Chris@69 121
Chris@69 122 /* parameter for applying a high-pass tilt to the input signal */
Chris@69 123 #define INPUT_TILT 0.05f
Chris@69 124
Chris@69 125 /* parameter for extra high-pass tilt to the input signal at high rates */
Chris@69 126 #define HIGH_RATE_INPUT_TILT 0.1f
Chris@69 127
Chris@69 128 /* parameter for reducing noise at the very low frequencies */
Chris@69 129 #define LOW_FREQ_SHAPING 4.0f
Chris@69 130
Chris@69 131 /* less reduction of noise at the very low frequencies for signals with low SNR at low frequencies */
Chris@69 132 #define LOW_QUALITY_LOW_FREQ_SHAPING_DECR 0.5f
Chris@69 133
Chris@69 134 /* subframe smoothing coefficient for HarmBoost, HarmShapeGain, Tilt (lower -> more smoothing) */
Chris@69 135 #define SUBFR_SMTH_COEF 0.4f
Chris@69 136
Chris@69 137 /* parameters defining the R/D tradeoff in the residual quantizer */
Chris@69 138 #define LAMBDA_OFFSET 1.2f
Chris@69 139 #define LAMBDA_SPEECH_ACT -0.2f
Chris@69 140 #define LAMBDA_DELAYED_DECISIONS -0.05f
Chris@69 141 #define LAMBDA_INPUT_QUALITY -0.1f
Chris@69 142 #define LAMBDA_CODING_QUALITY -0.2f
Chris@69 143 #define LAMBDA_QUANT_OFFSET 0.8f
Chris@69 144
Chris@69 145 /* Compensation in bitrate calculations for 10 ms modes */
Chris@69 146 #define REDUCE_BITRATE_10_MS_BPS 2200
Chris@69 147
Chris@69 148 /* Maximum time before allowing a bandwidth transition */
Chris@69 149 #define MAX_BANDWIDTH_SWITCH_DELAY_MS 5000
Chris@69 150
Chris@69 151 #ifdef __cplusplus
Chris@69 152 }
Chris@69 153 #endif
Chris@69 154
Chris@69 155 #endif /* SILK_TUNING_PARAMETERS_H */