| Index: silk/fixed/schur64_FIX.c
|
| diff --git a/silk/fixed/schur64_FIX.c b/silk/fixed/schur64_FIX.c
|
| index 5ff27567272c8f5a767c866fd00033908af42146..764a10ef3ea5d2a2f6854f3ae534151a51a018bc 100644
|
| --- a/silk/fixed/schur64_FIX.c
|
| +++ b/silk/fixed/schur64_FIX.c
|
| @@ -8,11 +8,11 @@ this list of conditions and the following disclaimer.
|
| - Redistributions in binary form must reproduce the above copyright
|
| notice, this list of conditions and the following disclaimer in the
|
| documentation and/or other materials provided with the distribution.
|
| -- Neither the name of Internet Society, IETF or IETF Trust, nor the
|
| +- Neither the name of Internet Society, IETF or IETF Trust, nor the
|
| names of specific contributors, may be used to endorse or promote
|
| products derived from this software without specific prior written
|
| permission.
|
| -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
|
| +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
| @@ -56,6 +56,17 @@ 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;
|
| + }
|
| +
|
| /* Get reflection coefficient: divide two Q30 values and get result in Q31 */
|
| rc_tmp_Q31 = silk_DIV32_varQ( -C[ k + 1 ][ 0 ], C[ 0 ][ 1 ], 31 );
|
|
|
| @@ -73,5 +84,9 @@ opus_int32 silk_schur64( /* O returns residual ene
|
| }
|
| }
|
|
|
| - return( C[ 0 ][ 1 ] );
|
| + for(; k < order; k++ ) {
|
| + rc_Q16[ k ] = 0;
|
| + }
|
| +
|
| + return silk_max_32( 1, C[ 0 ][ 1 ] );
|
| }
|
|
|