shithub: opus

Download patch

ref: 4fda6b01424aab5f6c5b13b1bd01697c899b6fcd
parent: 3039c9bde55eef9b343123a533fc2199c8793f36
author: Jean-Marc Valin <[email protected]>
date: Mon Dec 9 13:05:50 EST 2013

Using celt_inner_prod() in compute_band_energies()

--- a/celt/bands.c
+++ b/celt/bands.c
@@ -158,10 +158,8 @@
    c=0; do {
       for (i=0;i<end;i++)
       {
-         int j;
-         opus_val32 sum = 1e-27f;
-         for (j=M*eBands[i];j<M*eBands[i+1];j++)
-            sum += X[j+c*N]*X[j+c*N];
+         opus_val32 sum;
+         sum = 1e-27f + celt_inner_prod(&X[c*N+M*eBands[i]], &X[c*N+M*eBands[i]], M*(eBands[i+1]-eBands[i]));
          bandE[i+c*m->nbEBands] = celt_sqrt(sum);
          /*printf ("%f ", bandE[i+c*m->nbEBands]);*/
       }