diff options
author | Koen Vos <koen.vos@skype.net> | 2011-12-13 23:47:31 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-12-13 23:47:31 +0400 |
commit | bf75c8ec4d0dded188bc7793de6da56c7ff0be1c (patch) | |
tree | c21bb05faf0a203b73e8f8aae90fc63dac27625d /silk/float/LPC_inv_pred_gain_FLP.c | |
parent | 6619a736376221f2782cecff55d051c3ecfc2ff7 (diff) |
SILK fixes following last codec WG meeting
decoder:
- fixed incorrect scaling of filter states for the smallest quantization
step sizes
- NLSF2A now limits the prediction gain of LPC filters
encoder:
- increased damping of LTP coefficients in LTP analysis
- increased white noise fraction in noise shaping LPC analysis
- introduced maximum total prediction gain. Used by Burg's method to
exit early if prediction gain is exceeded. This improves packet
loss robustness and numerical robustness in Burg's method
- Prefiltered signal is now in int32 Q10 domain, from int16 Q0
- Increased max number of iterations in CBR gain control loop from 5 to 6
- Removed useless code from LTP scaling control
- Optimization: smarter LPC loop unrolling
- Switched default win32 compile mode to be floating-point
resampler:
- made resampler have constant delay of 0.75 ms; removed delay
compensation from silk code.
- removed obsolete table entries (~850 Bytes)
- increased downsampling filter order from 16 to 18/24/36 (depending on
frequency ratio)
- reoptimized filter coefficients
Diffstat (limited to 'silk/float/LPC_inv_pred_gain_FLP.c')
-rw-r--r-- | silk/float/LPC_inv_pred_gain_FLP.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/silk/float/LPC_inv_pred_gain_FLP.c b/silk/float/LPC_inv_pred_gain_FLP.c index d7a5d87e..59ed7d4c 100644 --- a/silk/float/LPC_inv_pred_gain_FLP.c +++ b/silk/float/LPC_inv_pred_gain_FLP.c @@ -37,29 +37,28 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* compute inverse of LPC prediction gain, and */ /* test if LPC coefficients are stable (all poles within unit circle) */ /* this code is based on silk_a2k_FLP() */ -opus_int silk_LPC_inverse_pred_gain_FLP( /* O returns 1 if unstable, otherwise 0 */ - silk_float *invGain, /* O inverse prediction gain, energy domain */ +silk_float silk_LPC_inverse_pred_gain_FLP( /* O return inverse prediction gain, energy domain */ const silk_float *A, /* I prediction coefficients [order] */ opus_int32 order /* I prediction order */ ) { opus_int k, n; - double rc, rc_mult1, rc_mult2; + double invGain, rc, rc_mult1, rc_mult2; silk_float Atmp[ 2 ][ SILK_MAX_ORDER_LPC ]; silk_float *Aold, *Anew; Anew = Atmp[ order & 1 ]; silk_memcpy( Anew, A, order * sizeof(silk_float) ); - *invGain = 1.0f; + invGain = 1.0; for( k = order - 1; k > 0; k-- ) { rc = -Anew[ k ]; if( rc > RC_THRESHOLD || rc < -RC_THRESHOLD ) { - return 1; + return 0.0f; } rc_mult1 = 1.0f - rc * rc; rc_mult2 = 1.0f / rc_mult1; - *invGain *= (silk_float)rc_mult1; + invGain *= rc_mult1; /* swap pointers */ Aold = Anew; Anew = Atmp[ k & 1 ]; @@ -69,9 +68,9 @@ opus_int silk_LPC_inverse_pred_gain_FLP( /* O returns 1 if unstable, other } rc = -Anew[ 0 ]; if( rc > RC_THRESHOLD || rc < -RC_THRESHOLD ) { - return 1; + return 0.0f; } rc_mult1 = 1.0f - rc * rc; - *invGain *= (silk_float)rc_mult1; - return 0; + invGain *= rc_mult1; + return (silk_float)invGain; } |