shithub: opus

Download patch

ref: 960505f074deafd36e1766cd2ae380005b8d212c
parent: e4d271dcfbe203b77546f9d1409e56b7d932ba88
author: Jean-Marc Valin <[email protected]>
date: Thu Aug 5 16:35:53 EDT 2010

More N=2 stereo simplifications

--- a/libcelt/bands.c
+++ b/libcelt/bands.c
@@ -658,7 +658,6 @@
       {
          int c;
          int sign=1;
-         celt_norm v[2], w[2];
          celt_norm *x2, *y2;
          mbits = b-qalloc;
          sbits = 0;
@@ -673,15 +672,10 @@
          y2 = c ? X : Y;
          if (encode)
          {
-            /* v is the largest vector between mid and side. w is the other */
-            v[0] = x2[0];
-            v[1] = x2[1];
-            w[0] = y2[0];
-            w[1] = y2[1];
             /* Here we only need to encode a sign for the side */
-            sign = v[0]*w[1] - v[1]*w[0] > 0;
+            sign = x2[0]*y2[1] - x2[1]*y2[0] > 0;
          }
-         quant_band(encode, m, i, v, NULL, N, mbits, spread, B, tf_change, lowband, resynth, ec, remaining_bits, LM, lowband_out, NULL, level+1, seed);
+         quant_band(encode, m, i, x2, NULL, N, mbits, spread, B, tf_change, lowband, resynth, ec, remaining_bits, LM, lowband_out, NULL, level+1, seed);
          if (sbits)
          {
             if (encode)
@@ -694,14 +688,9 @@
          } else {
             sign = 1;
          }
-         w[0] = -sign*v[1];
-         w[1] = sign*v[0];
-         x2[0] = v[0];
-         x2[1] = v[1];
-         y2[0] = w[0];
-         y2[1] = w[1];
-      } else
-      {
+         y2[0] = -sign*x2[1];
+         y2[1] = sign*x2[0];
+      } else {
          /* "Normal" split code */
          celt_norm *next_lowband2=NULL;
          celt_norm *next_lowband_out1=NULL;