summaryrefslogtreecommitdiff
path: root/silk/float
diff options
context:
space:
mode:
authorTimothy B. Terriberry <tterribe@xiph.org>2013-11-18 13:30:13 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2013-11-18 13:41:17 -0500
commit39386e0b85ec0f978aa104d312604badb9047d58 (patch)
treee1171628bb638ec1b770b049e39609d7a268c584 /silk/float
parent530198f955e49571b3f890b4da4d933a4cd5df4e (diff)
downloadopus-39386e0b85ec0f978aa104d312604badb9047d58.tar.gz
Adds Neon assembly for correlation/convolution
Optimizing celt_pitch_xcorr()/xcorr_kernel() which also speeds up FIRs, IIRs and auto-correlations Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
Diffstat (limited to 'silk/float')
-rw-r--r--silk/float/SigProc_FLP.h3
-rw-r--r--silk/float/encode_frame_FLP.c2
-rw-r--r--silk/float/find_pitch_lags_FLP.c5
-rw-r--r--silk/float/main_FLP.h6
-rw-r--r--silk/float/pitch_analysis_core_FLP.c15
5 files changed, 19 insertions, 12 deletions
diff --git a/silk/float/SigProc_FLP.h b/silk/float/SigProc_FLP.h
index e7131f14..f0cb3733 100644
--- a/silk/float/SigProc_FLP.h
+++ b/silk/float/SigProc_FLP.h
@@ -94,7 +94,8 @@ opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced,
const silk_float search_thres2, /* I Final threshold for lag candidates 0 - 1 */
const opus_int Fs_kHz, /* I sample frequency (kHz) */
const opus_int complexity, /* I Complexity setting, 0-2, where 2 is highest */
- const opus_int nb_subfr /* I Number of 5 ms subframes */
+ const opus_int nb_subfr, /* I Number of 5 ms subframes */
+ int arch /* I Run-time architecture */
);
void silk_insertion_sort_decreasing_FLP(
diff --git a/silk/float/encode_frame_FLP.c b/silk/float/encode_frame_FLP.c
index df75db91..d54e2686 100644
--- a/silk/float/encode_frame_FLP.c
+++ b/silk/float/encode_frame_FLP.c
@@ -129,7 +129,7 @@ opus_int silk_encode_frame_FLP(
/*****************************************/
/* Find pitch lags, initial LPC analysis */
/*****************************************/
- silk_find_pitch_lags_FLP( psEnc, &sEncCtrl, res_pitch, x_frame );
+ silk_find_pitch_lags_FLP( psEnc, &sEncCtrl, res_pitch, x_frame, psEnc->sCmn.arch );
/************************/
/* Noise shape analysis */
diff --git a/silk/float/find_pitch_lags_FLP.c b/silk/float/find_pitch_lags_FLP.c
index 455db82f..f3b22d25 100644
--- a/silk/float/find_pitch_lags_FLP.c
+++ b/silk/float/find_pitch_lags_FLP.c
@@ -37,7 +37,8 @@ void silk_find_pitch_lags_FLP(
silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
silk_float res[], /* O Residual */
- const silk_float x[] /* I Speech signal */
+ const silk_float x[], /* I Speech signal */
+ int arch /* I Run-time architecture */
)
{
opus_int buf_len;
@@ -116,7 +117,7 @@ void silk_find_pitch_lags_FLP(
/*****************************************/
if( silk_pitch_analysis_core_FLP( res, psEncCtrl->pitchL, &psEnc->sCmn.indices.lagIndex,
&psEnc->sCmn.indices.contourIndex, &psEnc->LTPCorr, psEnc->sCmn.prevLag, psEnc->sCmn.pitchEstimationThreshold_Q16 / 65536.0f,
- thrhld, psEnc->sCmn.fs_kHz, psEnc->sCmn.pitchEstimationComplexity, psEnc->sCmn.nb_subfr ) == 0 )
+ thrhld, psEnc->sCmn.fs_kHz, psEnc->sCmn.pitchEstimationComplexity, psEnc->sCmn.nb_subfr, arch ) == 0 )
{
psEnc->sCmn.indices.signalType = TYPE_VOICED;
} else {
diff --git a/silk/float/main_FLP.h b/silk/float/main_FLP.h
index dbd34aef..71d58c20 100644
--- a/silk/float/main_FLP.h
+++ b/silk/float/main_FLP.h
@@ -71,7 +71,8 @@ opus_int silk_encode_frame_FLP(
/* Initializes the Silk encoder state */
opus_int silk_init_encoder(
- silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */
+ silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
+ int arch /* I Run-tim architecture */
);
/* Control the Silk encoder */
@@ -129,7 +130,8 @@ void silk_find_pitch_lags_FLP(
silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
silk_float res[], /* O Residual */
- const silk_float x[] /* I Speech signal */
+ const silk_float x[], /* I Speech signal */
+ int arch /* I Run-time architecture */
);
/* Find LPC and LTP coefficients */
diff --git a/silk/float/pitch_analysis_core_FLP.c b/silk/float/pitch_analysis_core_FLP.c
index b6bafe81..e58f041b 100644
--- a/silk/float/pitch_analysis_core_FLP.c
+++ b/silk/float/pitch_analysis_core_FLP.c
@@ -48,7 +48,8 @@ static void silk_P_Ana_calc_corr_st3(
opus_int start_lag, /* I start lag */
opus_int sf_length, /* I sub frame length */
opus_int nb_subfr, /* I number of subframes */
- opus_int complexity /* I Complexity setting */
+ opus_int complexity, /* I Complexity setting */
+ int arch /* I Run-time architecture */
);
static void silk_P_Ana_calc_energy_st3(
@@ -74,7 +75,8 @@ opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced,
const silk_float search_thres2, /* I Final threshold for lag candidates 0 - 1 */
const opus_int Fs_kHz, /* I sample frequency (kHz) */
const opus_int complexity, /* I Complexity setting, 0-2, where 2 is highest */
- const opus_int nb_subfr /* I Number of 5 ms subframes */
+ const opus_int nb_subfr, /* I Number of 5 ms subframes */
+ int arch /* I Run-time architecture */
)
{
opus_int i, k, d, j;
@@ -176,7 +178,7 @@ opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced,
silk_assert( basis_ptr >= frame_4kHz );
silk_assert( basis_ptr + sf_length_8kHz <= frame_4kHz + frame_length_4kHz );
- celt_pitch_xcorr( target_ptr, target_ptr-max_lag_4kHz, xcorr, sf_length_8kHz, max_lag_4kHz - min_lag_4kHz + 1 );
+ celt_pitch_xcorr( target_ptr, target_ptr-max_lag_4kHz, xcorr, sf_length_8kHz, max_lag_4kHz - min_lag_4kHz + 1, arch );
/* Calculate first vector products before loop */
cross_corr = xcorr[ max_lag_4kHz - min_lag_4kHz ];
@@ -409,7 +411,7 @@ opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced,
CCmax = -1000.0f;
/* Calculate the correlations and energies needed in stage 3 */
- silk_P_Ana_calc_corr_st3( cross_corr_st3, frame, start_lag, sf_length, nb_subfr, complexity );
+ silk_P_Ana_calc_corr_st3( cross_corr_st3, frame, start_lag, sf_length, nb_subfr, complexity, arch );
silk_P_Ana_calc_energy_st3( energies_st3, frame, start_lag, sf_length, nb_subfr, complexity );
lag_counter = 0;
@@ -493,7 +495,8 @@ static void silk_P_Ana_calc_corr_st3(
opus_int start_lag, /* I start lag */
opus_int sf_length, /* I sub frame length */
opus_int nb_subfr, /* I number of subframes */
- opus_int complexity /* I Complexity setting */
+ opus_int complexity, /* I Complexity setting */
+ int arch /* I Run-time architecture */
)
{
const silk_float *target_ptr;
@@ -527,7 +530,7 @@ static void silk_P_Ana_calc_corr_st3(
lag_low = matrix_ptr( Lag_range_ptr, k, 0, 2 );
lag_high = matrix_ptr( Lag_range_ptr, k, 1, 2 );
silk_assert(lag_high-lag_low+1 <= SCRATCH_SIZE);
- celt_pitch_xcorr( target_ptr, target_ptr - start_lag - lag_high, xcorr, sf_length, lag_high - lag_low + 1 );
+ celt_pitch_xcorr( target_ptr, target_ptr - start_lag - lag_high, xcorr, sf_length, lag_high - lag_low + 1, arch );
for( j = lag_low; j <= lag_high; j++ ) {
silk_assert( lag_counter < SCRATCH_SIZE );
scratch_mem[ lag_counter ] = xcorr[ lag_high - j ];