diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-05-17 07:09:34 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-05-19 08:58:14 +0400 |
commit | ea7353fba17a2781c3810ea247b1961e2f9e063a (patch) | |
tree | 4040741650d535185f00e94d53109e73d89ce983 | |
parent | 6c727b40d32c248079b7252de335fb818b4ec8de (diff) |
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; } |