ref: e12c7f584a542ec6f2b00be67bf33165e182b24b
parent: 0e2d56d6750209a777c1b76cc75dbff37cda1a95
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Fri Feb 2 10:07:01 EST 2024
Fix log(0) on silence for fixed-point
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -956,7 +956,7 @@
/* Compute the right shift required in the MAC to avoid an overflow */
max_shift = celt_ilog2(len);
- shift = IMAX(0, (celt_ilog2(sample_max) << 1) + max_shift - 28);
+ shift = IMAX(0, (celt_ilog2(1+sample_max) << 1) + max_shift - 28);
/* Compute the energy */
for (i=0; i<len; i++)
--
⑨