Also fixing the DoFs for intensity stereo
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Thu, 3 Feb 2011 02:23:21 +0000 (21:23 -0500)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Thu, 3 Feb 2011 02:23:21 +0000 (21:23 -0500)
libcelt/rate.c

index a896a37..4fc1ba2 100644 (file)
@@ -448,7 +448,7 @@ static inline int interp_bits2pulses(const CELTMode *m, int start, int end, int
          bits[j] -= excess;
 
          /* Compensate for the extra DoF in stereo */
-         den=(C*N+ ((C==2 && N>2 && !*dual_stereo) ? 1 : 0));
+         den=(C*N+ ((C==2 && N>2 && !*dual_stereo && j<*intensity) ? 1 : 0));
 
          NClogN = den*(m->logN[j] + logM);