diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-05-16 23:09:34 -0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-05-16 23:14:46 -0400 |
commit | 74de3a580cca34a855c2846bf249eb224f6e9658 (patch) | |
tree | 70a361e08d82c09ae35fbf2d85218b405dadfbbe | |
parent | 6862b44e7d6500765dad4bf19e3c21423901802a (diff) | |
download | opus-74de3a580cca34a855c2846bf249eb224f6e9658.tar.gz |
Saturates the last RC to 0.99 when Schur blows up
This is a follow-up on ac76b15. When Schur blows up, we set the last RC to
+/- 0.99 instead of eliminating it.
-rw-r--r-- | silk/fixed/schur64_FIX.c | 6 | ||||
-rw-r--r-- | silk/fixed/schur_FIX.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/silk/fixed/schur64_FIX.c b/silk/fixed/schur64_FIX.c index c75f96a8..1701d5ba 100644 --- a/silk/fixed/schur64_FIX.c +++ b/silk/fixed/schur64_FIX.c @@ -58,6 +58,12 @@ opus_int32 silk_schur64( /* O returns residual ene for( k = 0; k < order; k++ ) { /* Check that we won't be getting an unstable rc, otherwise stop here. */ if (silk_abs_int32(C[ k + 1 ][ 0 ]) >= C[ 0 ][ 1 ]) { + if ( C[ k + 1 ][ 0 ] > 0 ) { + rc_Q16[ k ] = -SILK_FIX_CONST( .99f, 16 ); + } else { + rc_Q16[ k ] = SILK_FIX_CONST( .99f, 16 ); + } + k++; break; } diff --git a/silk/fixed/schur_FIX.c b/silk/fixed/schur_FIX.c index 788ad3f3..37dc42c6 100644 --- a/silk/fixed/schur_FIX.c +++ b/silk/fixed/schur_FIX.c @@ -70,6 +70,12 @@ opus_int32 silk_schur( /* O Returns residual ene for( k = 0; k < order; k++ ) { /* Check that we won't be getting an unstable rc, otherwise stop here. */ if (silk_abs_int32(C[ k + 1 ][ 0 ]) >= C[ 0 ][ 1 ]) { + if ( C[ k + 1 ][ 0 ] > 0 ) { + rc_Q15[ k ] = -SILK_FIX_CONST( .99f, 15 ); + } else { + rc_Q15[ k ] = SILK_FIX_CONST( .99f, 15 ); + } + k++; break; } |