diff --git a/silk/tests/test_unit_LPC_inv_pred_gain.c b/silk/tests/test_unit_LPC_inv_pred_gain.c index 69bf6b722fe36e3963099b1d75f2310f288c0035..dcc61bd8817ddba7a64d96b6c70d7bd3d5c6c0d6 100644 --- a/silk/tests/test_unit_LPC_inv_pred_gain.c +++ b/silk/tests/test_unit_LPC_inv_pred_gain.c @@ -73,6 +73,16 @@ int check_stability(opus_int16 *A_Q12, int order) { if( !(y[ 0 ] < 10000 && y[ 0 ] > -10000) ) { return 0; } + /* Test every 8 sample for low amplitude. */ + if( ( i & 0x7 ) == 0 ) { + double amp = 0; + for( j = 0; j < order; j++ ) { + amp += fabs(y[0]); + } + if( amp < 0.00001 ) { + return 1; + } + } } return 1; }