ref: 4d3decfe4da706a7045236b02b8c4e08da22489f
parent: 6e9617371f7cf3f669a60d9540723a01f1128fc8
author: Jean-Marc Valin <[email protected]>
date: Fri Apr 22 11:10:13 EDT 2016
Fixes floating-point bug introduced in be9e747bcc542c277d30f6c78a57b0940e0c5b5e The effect was to always set HB_gain to 1.
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -1513,7 +1513,7 @@
celt_rate = total_bitRate - st->silk_mode.bitRate;
HB_gain_ref = (curr_bandwidth == OPUS_BANDWIDTH_SUPERWIDEBAND) ? 3000 : 3600;
HB_gain = SHL32((opus_val32)celt_rate, 9) / SHR32((opus_val32)celt_rate + st->stream_channels * HB_gain_ref, 6);
- HB_gain = HB_gain < (opus_int32)Q15ONE*6/7 ? HB_gain + Q15ONE/7 : Q15ONE;
+ HB_gain = HB_gain < (opus_val32)Q15ONE*6/7 ? HB_gain + Q15ONE/7 : Q15ONE;
}
} else {
/* SILK gets all bits */