<div dir="ltr">I'm attaching the previous 11 NEON optimization patches in a zip file, which is the same as the one I sent on September 6th in reply to thread "[PATCH 9/9] Optimize silk_inner_prod_aligned_scale() for ARM NEON".<div><br></div><div>Thanks,</div><div>Linfeng</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 12, 2016 at 5:03 PM, Linfeng Zhang <span dir="ltr"><<a href="mailto:linfengz@google.com" target="_blank">linfengz@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Should call celt_inner_prod().<br>
---<br>
celt/bands.c | 7 ++++---<br>
celt/bands.h | 2 +-<br>
celt/celt_encoder.c | 6 +++---<br>
celt/pitch.c | 2 +-<br>
src/opus_multistream_encoder.c | 2 +-<br>
5 files changed, 10 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/celt/bands.c b/celt/bands.c<br>
index bbe8a4c..1ab24aa 100644<br>
--- a/celt/bands.c<br>
+++ b/celt/bands.c<br>
@@ -92,10 +92,11 @@ static int bitexact_log2tan(int isin,int icos)<br>
<br>
#ifdef FIXED_POINT<br>
/* Compute the amplitude (sqrt energy) in each of the bands */<br>
-void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM)<br>
+void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM, int arch)<br>
{<br>
int i, c, N;<br>
const opus_int16 *eBands = m->eBands;<br>
+ (void)arch;<br>
N = m->shortMdctSize<<LM;<br>
c=0; do {<br>
for (i=0;i<end;i++)<br>
@@ -155,7 +156,7 @@ void normalise_bands(const CELTMode *m, const celt_sig * OPUS_RESTRICT freq, cel<br>
<br>
#else /* FIXED_POINT */<br>
/* Compute the amplitude (sqrt energy) in each of the bands */<br>
-void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM)<br>
+void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM, int arch)<br>
{<br>
int i, c, N;<br>
const opus_int16 *eBands = m->eBands;<br>
@@ -164,7 +165,7 @@ void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *band<br>
for (i=0;i<end;i++)<br>
{<br>
opus_val32 sum;<br>
- sum = 1e-27f + celt_inner_prod_c(&X[c*N+(<wbr>eBands[i]<<LM)], &X[c*N+(eBands[i]<<LM)], (eBands[i+1]-eBands[i])<<LM);<br>
+ sum = 1e-27f + celt_inner_prod(&X[c*N+(<wbr>eBands[i]<<LM)], &X[c*N+(eBands[i]<<LM)], (eBands[i+1]-eBands[i])<<LM, arch);<br>
bandE[i+c*m->nbEBands] = celt_sqrt(sum);<br>
/*printf ("%f ", bandE[i+c*m->nbEBands]);*/<br>
}<br>
diff --git a/celt/bands.h b/celt/bands.h<br>
index c040c7f..61ae0cd 100644<br>
--- a/celt/bands.h<br>
+++ b/celt/bands.h<br>
@@ -41,7 +41,7 @@<br>
* @param X Spectrum<br>
* @param bandE Square root of the energy for each band (returned)<br>
*/<br>
-void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM);<br>
+void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM, int arch);<br>
<br>
/*void compute_noise_energies(const CELTMode *m, const celt_sig *X, const opus_val16 *tonality, celt_ener *bandE);*/<br>
<br>
diff --git a/celt/celt_encoder.c b/celt/celt_encoder.c<br>
index 5be7610..8af61d5 100644<br>
--- a/celt/celt_encoder.c<br>
+++ b/celt/celt_encoder.c<br>
@@ -1606,7 +1606,7 @@ int celt_encode_with_ec(<wbr>CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,<br>
if (secondMdct)<br>
{<br>
compute_mdcts(mode, 0, in, freq, C, CC, LM, st->upsample, st->arch);<br>
- compute_band_energies(mode, freq, bandE, effEnd, C, LM);<br>
+ compute_band_energies(mode, freq, bandE, effEnd, C, LM, st->arch);<br>
amp2Log2(mode, effEnd, end, bandE, bandLogE2, C);<br>
for (i=0;i<C*nbEBands;i++)<br>
bandLogE2[i] += HALF16(SHL16(LM, DB_SHIFT));<br>
@@ -1615,7 +1615,7 @@ int celt_encode_with_ec(<wbr>CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,<br>
compute_mdcts(mode, shortBlocks, in, freq, C, CC, LM, st->upsample, st->arch);<br>
if (CC==2&&C==1)<br>
tf_chan = 0;<br>
- compute_band_energies(mode, freq, bandE, effEnd, C, LM);<br>
+ compute_band_energies(mode, freq, bandE, effEnd, C, LM, st->arch);<br>
<br>
if (st->lfe)<br>
{<br>
@@ -1739,7 +1739,7 @@ int celt_encode_with_ec(<wbr>CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,<br>
isTransient = 1;<br>
shortBlocks = M;<br>
compute_mdcts(mode, shortBlocks, in, freq, C, CC, LM, st->upsample, st->arch);<br>
- compute_band_energies(mode, freq, bandE, effEnd, C, LM);<br>
+ compute_band_energies(mode, freq, bandE, effEnd, C, LM, st->arch);<br>
amp2Log2(mode, effEnd, end, bandE, bandLogE, C);<br>
/* Compensate for the scaling of short vs long mdcts */<br>
for (i=0;i<C*nbEBands;i++)<br>
diff --git a/celt/pitch.c b/celt/pitch.c<br>
index bf46e7d..f944a33 100644<br>
--- a/celt/pitch.c<br>
+++ b/celt/pitch.c<br>
@@ -378,7 +378,7 @@ void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTR<br>
for (j=0;j<len>>1;j++)<br>
sum += SHR32(MULT16_16(x_lp[j],y[i+j]<wbr>), shift);<br>
#else<br>
- sum = celt_inner_prod_c(x_lp, y+i, len>>1);<br>
+ sum = celt_inner_prod(x_lp, y+i, len>>1, arch);<br>
#endif<br>
xcorr[i] = MAX32(-1, sum);<br>
#ifdef FIXED_POINT<br>
diff --git a/src/opus_multistream_<wbr>encoder.c b/src/opus_multistream_<wbr>encoder.c<br>
index c07132f..6ecea5d 100644<br>
--- a/src/opus_multistream_<wbr>encoder.c<br>
+++ b/src/opus_multistream_<wbr>encoder.c<br>
@@ -295,7 +295,7 @@ void surround_analysis(const CELTMode *celt_mode, const void *pcm, opus_val16 *b<br>
freq[i] = 0;<br>
}<br>
<br>
- compute_band_energies(celt_<wbr>mode, freq, bandE, 21, 1, LM);<br>
+ compute_band_energies(celt_<wbr>mode, freq, bandE, 21, 1, LM, arch);<br>
amp2Log2(celt_mode, 21, 21, bandE, bandLogE+21*c, 1);<br>
/* Apply spreading function with -6 dB/band going up and -12 dB/band going down. */<br>
for (i=1;i<21;i++)<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.8.0.rc3.226.g39d4020<br>
<br>
</font></span></blockquote></div><br></div>