shithub: opus

Download patch

ref: b2b71a58e5ca4bd9170376dfa513bc06ba0b9f88
parent: a66c32087102e6d288c73c19322c7f09a2e81d51
author: Jean-Marc Valin <[email protected]>
date: Wed Apr 16 06:45:52 EDT 2008

Fixed incorrect energy calculation in stereo intra prediction

--- a/libcelt/vq.c
+++ b/libcelt/vq.c
@@ -358,7 +358,7 @@
       for (j=0;j<N;j++)
       {
          P[B*j+c] = s*Y[B*best+B*(N-j-1)+c];
-         E = MAC16_16(E, P[j],P[j]);
+         E = MAC16_16(E, P[B*j+c],P[B*j+c]);
       }
    }
    /*pred_gain = pred_gain/sqrt(E);*/
@@ -412,7 +412,7 @@
       for (j=0;j<N;j++)
       {
          P[B*j+c] = s*Y[best+B*(N-j-1)+c];
-         E = MAC16_16(E, P[j],P[j]);
+         E = MAC16_16(E, P[B*j+c],P[B*j+c]);
       }
    }
    /*pred_gain = pred_gain/sqrt(E);*/