ref: 5d774e075ea5a810f40c3dd0f966ed463c4b89f0
parent: 129964098baf22f0a024d441e0dc9f4314671a8c
author: Jean-Marc Valin <[email protected]>
date: Wed Aug 4 13:17:18 EDT 2010
Fixed "forced intensity stereo"
--- a/libcelt/bands.c
+++ b/libcelt/bands.c
@@ -667,7 +667,7 @@
if (encode)
{
if (stereo)
- stereo_band_mix(m, X, Y, bandE, qb==0, i, 1, N);
+ stereo_band_mix(m, X, Y, bandE, 0, i, 1, N);
mid = renormalise_vector(X, Q15ONE, N, 1);
side = renormalise_vector(Y, Q15ONE, N, 1);
@@ -731,6 +731,9 @@
qalloc = log2_frac(ft,BITRES) - log2_frac(fs,BITRES) + 1;
}
itheta <<= shift;
+ } else {
+ if (stereo && encode)
+ stereo_band_mix(m, X, Y, bandE, 1, i, 1, N);
}
if (itheta == 0)
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -1105,7 +1105,7 @@
/* If there's any room left (can only happen for very high rates),
fill it with zeros */
- while (nbCompressedBytes*8 - ec_enc_tell(enc,0) >= 8)
+ while (ec_enc_tell(enc,0) + 8 <= nbCompressedBytes*8)
ec_enc_bits(enc, 0, 8);
ec_enc_done(enc);