As of commit 44203907 all celt bands N>1 are even, including custom modes. In light...
authorGregory Maxwell <greg@xiph.org>
Fri, 30 Sep 2011 21:57:27 +0000 (17:57 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Fri, 30 Sep 2011 23:00:51 +0000 (19:00 -0400)
celt/bands.c
celt/rate.c

index 64622ea..b8a2704 100644 (file)
@@ -751,16 +751,13 @@ static unsigned quant_band(int encode, const CELTMode *m, int i, celt_norm *X, c
    cache = m->cache.bits + m->cache.index[(LM+1)*m->nbEBands+i];
    if (!stereo && LM != -1 && b > cache[cache[0]]+12 && N>2)
    {
-      if (LM>0 || (N&1)==0)
-      {
-         N >>= 1;
-         Y = X+N;
-         split = 1;
-         LM -= 1;
-         if (B==1)
-            fill = (fill&1)|(fill<<1);
-         B = (B+1)>>1;
-      }
+      N >>= 1;
+      Y = X+N;
+      split = 1;
+      LM -= 1;
+      if (B==1)
+         fill = (fill&1)|(fill<<1);
+      B = (B+1)>>1;
    }
 
    if (split)
index 8afacda..c1ad690 100644 (file)
@@ -165,9 +165,9 @@ void compute_pulse_cache(CELTMode *m, int LM)
                int                  qb;
                int                  k;
                LM0 = 0;
-               /* Even-sized bands bigger than N=2 can be split one more
-                   time. */
-               if (N0 > 2 && !(N0&1))
+               /* Even-sized bands bigger than N=2 can be split one more time.
+                  As of commit 44203907 all bands >1 are even, including custom modes.*/
+               if (N0 > 2)
                {
                   N0>>=1;
                   LM0--;