shithub: opus

Download patch

ref: 37e135677afb86a7b0136d038e534553e34e243e
parent: a403d5f7b5163abcb934aa18e4fc29799f3c7875
author: Gregory Maxwell <[email protected]>
date: Sat May 5 19:12:50 EDT 2012

Avoid the unnecessary resynth averaging on intensity switch when encoding.

Prevents some arithmetic on uninitialized memory that may contain nans.

--- a/celt/bands.c
+++ b/celt/bands.c
@@ -1267,8 +1267,9 @@
 
          /* Switch off dual stereo to do intensity */
          dual_stereo = 0;
-         for (j=M*eBands[start];j<M*eBands[i];j++)
-            norm[j] = HALF32(norm[j]+norm2[j]);
+         if (resynth)
+            for (j=M*eBands[start];j<M*eBands[i];j++)
+               norm[j] = HALF32(norm[j]+norm2[j]);
       }
       if (dual_stereo)
       {