ref: 1f589ef1431196a281f4e18af58b11bf6c87e1eb
parent: 960505f074deafd36e1766cd2ae380005b8d212c
author: Jean-Marc Valin <[email protected]>
date: Thu Aug 5 17:14:49 EDT 2010
More simplifications to N=2 stereo
--- a/libcelt/bands.c
+++ b/libcelt/bands.c
@@ -670,24 +670,19 @@
x2 = c ? Y : X;
y2 = c ? X : Y;
- if (encode)
- {
- /* Here we only need to encode a sign for the side */
- sign = x2[0]*y2[1] - x2[1]*y2[0] > 0;
- }
- quant_band(encode, m, i, x2, NULL, N, mbits, spread, B, tf_change, lowband, resynth, ec, remaining_bits, LM, lowband_out, NULL, level+1, seed);
if (sbits)
{
if (encode)
{
+ /* Here we only need to encode a sign for the side */
+ sign = x2[0]*y2[1] - x2[1]*y2[0] > 0;
ec_enc_bits((ec_enc*)ec, sign, 1);
} else {
sign = ec_dec_bits((ec_dec*)ec, 1);
}
- sign = 2*sign - 1;
- } else {
- sign = 1;
}
+ sign = 2*sign - 1;
+ quant_band(encode, m, i, x2, NULL, N, mbits, spread, B, tf_change, lowband, resynth, ec, remaining_bits, LM, lowband_out, NULL, level+1, seed);
y2[0] = -sign*x2[1];
y2[1] = sign*x2[0];
} else {