It is no longer necessary to have a minimum of one bit for fine energy
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Tue, 2 Jun 2009 11:59:32 +0000 (07:59 -0400)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Tue, 2 Jun 2009 11:59:32 +0000 (07:59 -0400)
allocation

libcelt/rate.c

index 8e1a9c0..3beb1e7 100644 (file)
@@ -115,15 +115,12 @@ static void interp_bits2pulses(const CELTMode *m, int *bits1, int *bits2, int to
    {
       int N, d;
       int offset;
-      int min_bits=0;
-      if (bits[j] >= C<<BITRES)
-         min_bits = 1;
 
       N=m->eBands[j+1]-m->eBands[j]; 
       d=C*N<<BITRES; 
       offset = 50 - log2_frac(N, 4);
       /* Offset for the number of fine bits compared to their "fair share" of total/N */
-      ebits[j] = IMAX(min_bits, (bits[j]-offset*N*C+(d>>1))/d);
+      ebits[j] = (bits[j]-offset*N*C+(d>>1))/d;
 
       /* Make sure not to bust */
       if (C*ebits[j] > (bits[j]>>BITRES))