summaryrefslogtreecommitdiff
path: root/silk/float
diff options
context:
space:
mode:
authorKoen Vos <koenvos@users.noreply.github.com>2016-02-19 11:11:20 +0800
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-07-17 15:05:55 -0400
commit6adea4b93ce15b5c6eab1be29da6e01806ee8853 (patch)
tree3e3ad14bd7563a834328240b9c0e07c0de6c785a /silk/float
parentfc7ce7d588afcd6c537e5063171156c9cbf16445 (diff)
downloadopus-6adea4b93ce15b5c6eab1be29da6e01806ee8853.tar.gz
pitch analysis (in FIX) now scales the input down at the start, instead of at every stage
Diffstat (limited to 'silk/float')
-rw-r--r--silk/float/pitch_analysis_core_FLP.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/silk/float/pitch_analysis_core_FLP.c b/silk/float/pitch_analysis_core_FLP.c
index d0e637a2..fc47c6ef 100644
--- a/silk/float/pitch_analysis_core_FLP.c
+++ b/silk/float/pitch_analysis_core_FLP.c
@@ -158,9 +158,16 @@ opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced,
silk_short2float_array( frame_4kHz, frame_4_FIX, frame_length_4kHz );
/* Low-pass filter */
- for( i = frame_length_4kHz - 1; i > 0; i-- ) {
- frame_4kHz[ i ] += frame_4kHz[ i - 1 ];
+ silk_assert( (frame_length_4kHz & 3) == 0 );
+ for( i = frame_length_4kHz - 1; i > 4; i -= 4 ) {
+ frame_4kHz[ i - 0 ] = silk_ADD_SAT16( frame_4kHz[ i - 0 ], frame_4kHz[ i - 1 ] );
+ frame_4kHz[ i - 1 ] = silk_ADD_SAT16( frame_4kHz[ i - 1 ], frame_4kHz[ i - 2 ] );
+ frame_4kHz[ i - 2 ] = silk_ADD_SAT16( frame_4kHz[ i - 2 ], frame_4kHz[ i - 3 ] );
+ frame_4kHz[ i - 3 ] = silk_ADD_SAT16( frame_4kHz[ i - 3 ], frame_4kHz[ i - 4 ] );
}
+ frame_4kHz[ i - 0 ] = silk_ADD_SAT16( frame_4kHz[ i - 0 ], frame_4kHz[ i - 1 ] );
+ frame_4kHz[ i - 1 ] = silk_ADD_SAT16( frame_4kHz[ i - 1 ], frame_4kHz[ i - 2 ] );
+ frame_4kHz[ i - 2 ] = silk_ADD_SAT16( frame_4kHz[ i - 2 ], frame_4kHz[ i - 3 ] );
/******************************************************************************
* FIRST STAGE, operating in 4 khz