shithub: opus

Download patch

ref: d8d7763369e2d5af79925c61bf4b4e7adccb38fa
parent: f0bf32a58c71e9324d00728e13e6d2647c023435
author: Jean-Marc Valin <jeanmarcv@google.com>
date: Fri Apr 4 10:46:37 EDT 2025

Fix decoder gain for res24

--- a/celt/arch.h
+++ b/celt/arch.h
@@ -340,6 +340,7 @@
 #define MULT16_32_Q15(a,b)     ((a)*(b))
 #define MULT16_32_Q16(a,b)     ((a)*(b))
 
+#define MULT32_32_Q16(a,b)     ((a)*(b))
 #define MULT32_32_Q31(a,b)     ((a)*(b))
 
 #define MAC16_32_Q15(c,a,b)     ((c)+(a)*(b))
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -650,7 +650,11 @@
       for (i=0;i<frame_size*st->channels;i++)
       {
          opus_val32 x;
+#ifdef ENABLE_RES24
+         x = MULT32_32_Q16(pcm[i],gain);
+#else
          x = MULT16_32_P16(pcm[i],gain);
+#endif
          pcm[i] = SATURATE(x, 32767);
       }
    }
--