shithub: opus

Download patch

ref: c0eb2ca56df7b0fabfd061adc818d2f6d988e49e
parent: ce06772d7c0c616825b745e6ae9aadc7d9258af9
author: Jean-Marc Valin <jeanmarcv@google.com>
date: Fri Jun 13 06:48:19 EDT 2025

Fix fixed-point issue introduced in 462c50d3

--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -1486,8 +1486,8 @@
 
    if (CC==2) {
       opus_val16 thresh[2];
-      thresh[0] = MULT16_16_Q15(MULT16_16_Q15(QCONST16(.25f, 15), gain1), before[0]) + MULT16_16_Q15(QCONST16(.01f,15), before[1]);
-      thresh[1] = MULT16_16_Q15(MULT16_16_Q15(QCONST16(.25f, 15), gain1), before[1]) + MULT16_16_Q15(QCONST16(.01f,15), before[0]);
+      thresh[0] = MULT16_32_Q15(MULT16_16_Q15(QCONST16(.25f, 15), gain1), before[0]) + MULT16_32_Q15(QCONST16(.01f,15), before[1]);
+      thresh[1] = MULT16_32_Q15(MULT16_16_Q15(QCONST16(.25f, 15), gain1), before[1]) + MULT16_32_Q15(QCONST16(.01f,15), before[0]);
       /* Don't use the filter if one channel gets significantly worse. */
       if (after[0]-before[0] > thresh[0] || after[1]-before[1] > thresh[1]) cancel_pitch = 1;
       /* Use the filter only if at least one channel gets significantly better. */
--