Commit 1cca1516 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

This fixes a bug in the new stereo code triggered only at ridiculously high

bitrates. It was caused by excessive "balance" bits leading to qb>14.
parent 331130e0
......@@ -610,6 +610,8 @@ void quant_bands_stereo(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t
qb = (b>>BITRES)-1;
if (qb<0)
qb = 0;
if (qb>14)
qb = 14;
if (qb==0)
point_stereo_mix(m, X, bandE, i, 1);
......@@ -963,6 +965,8 @@ void unquant_bands_stereo(const CELTMode *m, celt_norm_t * restrict X, celt_norm
qb = (b-2*(N-1)*(40-log2_frac(N,4)))/(32*(N-1));
if (qb > (b>>BITRES)-1)
qb = (b>>BITRES)-1;
if (qb>14)
qb = 14;
if (qb<0)
qb = 0;
qalloc = log2_frac((1<<qb)+1,4);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment