summaryrefslogtreecommitdiff
path: root/silk/tests
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2017-02-18 16:43:48 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2017-02-18 16:43:48 -0500
commit0834ad61b171dc07c5653244a29632984643abdd (patch)
treef2314582edeb2c925842cdf39d306fd8f285a856 /silk/tests
parent414eef55bd26f8b295c3cb42bf933cbb2d36dcaa (diff)
downloadopus-0834ad61b171dc07c5653244a29632984643abdd.tar.gz
Speed up test_unit_LPC_inv_pred_gain by returning early on stable filters
Diffstat (limited to 'silk/tests')
-rw-r--r--silk/tests/test_unit_LPC_inv_pred_gain.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/silk/tests/test_unit_LPC_inv_pred_gain.c b/silk/tests/test_unit_LPC_inv_pred_gain.c
index 69bf6b72..dcc61bd8 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;
}